Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.22 KB

checkout_mollie.md

File metadata and controls

57 lines (40 loc) · 1.22 KB

Credit Card

One-off Credit Card payments are supported.

Capture

use Payum\Core\Request\Capture;

$payment = [];
$payment['method'] = 'creditcard';

$payum
    ->getGateway('mollie')
    ->execute(new Capture($payment));

Symfony integration:

<?php

//src/Acme/PaymentBundle/Controller
namespace AcmeDemoBundle\Controller;

use Payum\Core\Security\SensitiveValue;
use Symfony\Component\HttpFoundation\Request;

class PaymentController extends Controller
{
    public function prepareAction(Request $request)
    {
        $gatewayName = 'mollie';

        $storage = $this->get('payum')->getStorage('Acme\PaymentBundle\Entity\PaymentDetails');

        /** @var \Acme\PaymentBundle\Entity\PaymentDetails $details */
        $details = $storage->create();
        $details['currency'] = 'EUR';
        $details['amount'] = 5.42;

        $storage->update($details);

        $captureToken = $this->get('payum')->getTokenFactory()->createCaptureToken(
            $gatewayName,
            $details,
            'acme_payment_done' // the route to redirect after capture;
        );

        return $this->redirect($captureToken->getTargetUrl());
    }
}