TransWikia.com

Magento 2: Paypal Payment Authorize Now and Capture later

Magento Asked on November 10, 2021

I have requirement that need to “Authorize” PayPal payment for now.

Capture/Process after X days.

On Magento side it’s storing info info

sales_order_payment
sales_payment_transaction

I think need to use API, may be one of the Method

https://github.com/paypal/PayPal-PHP-SDK/tree/master/sample/payments

magentovendormagentomodule-paypalModelExpress.php

We have below methods

canCapture()
capture()

Can anybody have any idea how to achieve this?

One Answer

To retrieve payment transaction details you can use Magento REST API.

One of the available methods is V1/orders/{id} (salesOrderRepositoryV1).

The returned order entity will contain the last_trans_id attribute in the payment node or you can use additional_information from payment node (most of the payment methods store transaction details in additional_information).

To capture transaction on PayPal side, you can try to use PayPal Capture API entry point.

Answered by joni jones on November 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP