Guest User

Untitled

a guest
Feb 21st, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. payum:
  2. security:
  3. token_storage:
  4. AppBundleEntityPaymentToken: { doctrine: orm }
  5. storages:
  6. AppBundleEntityPayment: { doctrine: orm }
  7. gateways:
  8. paypal_express_checkout:
  9. factory: paypal_express_checkout
  10.  
  11. public function prepareAction() {
  12. $gatewayName = 'paypal_express_checkout';
  13. $storage = $this->get('payum')->getStorage('AcmePaymentBundleEntityPayment');
  14. $payment = $storage->create();
  15. $payment->setNumber(uniqid());
  16. $payment->setCurrencyCode('USD');
  17. $payment->setTotalAmount(5);
  18. $payment->setDescription('A description');
  19. $payment->setClientId('anId');
  20. $payment->setClientEmail('foo@example.com');
  21. $storage->update($payment);
  22. $captureToken = $this->get('payum')->getTokenFactory()->createCaptureToken(
  23. $gatewayName,
  24. $payment,
  25. 'done' // the route to redirect after capture
  26. );
  27.  
  28. return $this->redirect($captureToken->getTargetUrl());
  29. }
Add Comment
Please, Sign In to add comment