Examples
Paypal Express checkout
Described in Get it started
Payment model
Configuration
$ php composer.phar require payum/payum-laravel-package payum/offline// bootstrap/start.php
App::resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) {
$payumBuilder
->addGateway('offline', ['factory' => 'offline'])
;
});Prepare payment
<?php
// app/controllers/PaymentController.php
use Payum\LaravelPackage\Controller\PayumController;
class PaymentController extends PayumController
{
public function preparePayment()
{
$storage = $this->getPayum()->getStorage('Payum\Core\Model\Payment');
$payment = $storage->create();
$payment->setNumber(uniqid());
$payment->setCurrencyCode('EUR');
$payment->setTotalAmount(123); // 1.23 EUR
$payment->setDescription('A description');
$payment->setClientId('anId');
$payment->setClientEmail('foo@example.com');
$payment->setDetails(array(
// put here any fields in a gateway format.
// for example if you use Paypal ExpressCheckout you can define a description of the first item:
// 'L_PAYMENTREQUEST_0_DESC0' => 'A desc',
));
$storage->update($payment);
$captureToken = $payum->getTokenFactory()->createCaptureToken('offline', $payment, 'payment_done');
return \Redirect::to($captureToken->getTargetUrl());
}
}Stripe.Js
Configuration
Prepare payment
Stripe Checkout
Configuration
Prepare payment
Stripe Direct (via Omnipay)
Configuration
Prepare payment
Supporting Payum
Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our customers. If you'd like to join them, please consider:
Last updated