VOOZH about

URL: https://payum.gitbook.io/payum/symfony/authorize.md


> For the complete documentation index, see [llms.txt](https://payum.gitbook.io/payum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://payum.gitbook.io/payum/symfony/authorize.md). # Authorize Payment In [get it started](/payum/symfony/get-it-started.md) we showed you an example of how to capture the payment. It is not always the case, sometimes you want to just authorize it and capture a bit later. ### Prepare payment We have to caThe only difference from capture one example ```php get('payum')->getStorage('Acme\PaymentBundle\Entity\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'); $storage->update($payment); /** @var TokenInterface $captureToken */ $captureToken = $this->get('payum')->getTokenFactory()->createAuthorizeToken( $gatewayName, $payment, 'done' // the route to redirect after autorize; ); return $this->redirect($captureToken->getTargetUrl()); } } ``` *** ### 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: * [Become a sponsor](https://github.com/sponsors/Payum) --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter: ``` GET https://payum.gitbook.io/payum/symfony/authorize.md?ask=