Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- payum:
- security:
- token_storage:
- AppBundleEntityPaymentToken: { doctrine: orm }
- storages:
- AppBundleEntityPayment: { doctrine: orm }
- gateways:
- paypal_express_checkout:
- factory: paypal_express_checkout
- public function prepareAction() {
- $gatewayName = 'paypal_express_checkout';
- $storage = $this->get('payum')->getStorage('AcmePaymentBundleEntityPayment');
- $payment = $storage->create();
- $payment->setNumber(uniqid());
- $payment->setCurrencyCode('USD');
- $payment->setTotalAmount(5);
- $payment->setDescription('A description');
- $payment->setClientId('anId');
- $payment->setClientEmail('foo@example.com');
- $storage->update($payment);
- $captureToken = $this->get('payum')->getTokenFactory()->createCaptureToken(
- $gatewayName,
- $payment,
- 'done' // the route to redirect after capture
- );
- return $this->redirect($captureToken->getTargetUrl());
- }
Add Comment
Please, Sign In to add comment