I already created a Paypal / Developer / Sandbox account. Already got the API credentials.
Downloaded PHP SDK http://paypal.imtqy.com/PayPal-PHP-SDK/
Referring: https://developer.paypal.com/docs/api/
https://devtools-paypal.com/guide/expresscheckout/php?interactive=ON&env=sandbox
I have already completed the Sandbox One transaction using the Authorization method using my PHP Script.
What should I achieve. I need to get authorization of payments, convert payments "Authorize" to the method "Capture / sale", and also notify the client and administrator.
How to get an authorization identifier?
Going through the above document, I need to use 3 web services
- Get Authorized Payment Information
- Authorized payment capture
- Get captured payment information
Already have a transaction ID "Authorize" payment.
Please indicate the steps that should be followed, and if any example is already available, please share
It is necessary to integrate this functionality in Magento 2
[UPDATE]
I changed my Sandbox API data in the PHP SDK in the PayPal-PHP-SDK-master\sample\bootstrap.php file.
From sample/payments/AuthorizePayment.php I will receive an Authorized payment with ID: PAY-0TV39791XXX02404VK7XD32I and it works great.
When I enter my Transaction Id , it gives
{"name": "INVALID_RESOURCE_ID", "message": "The requested resource identifier was not found.", "information_link": " https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID ", "debug_id": "1f2b08ce88633"}
My Sandbox Transaction ID is 3AA32794KF48247AA . So the question is, how do you convert your transaction id to a payment id?
https://magento.stackexchange.com/questions/138579/magento-2-change-paypal-action-method-on-the-fly
Below is the answer from Paypal
Transaction ID can be generated after executing the REST API, Classic API [NVP / SOAP] DoEC API, or the usual completion of a button payment. It will not work to cancel the search in order to find the payment identifier.