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
magento\vendor\magento\module-paypal\Model\Express.php
We have below methods
canCapture()
capture()
Can anybody have any idea how to achieve this?
Best 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 thepayment
node or you can useadditional_information
frompayment
node (most of the payment methods store transaction details inadditional_information
).To capture transaction on PayPal side, you can try to use PayPal Capture API entry point.