overview error docs developer php paypal wamp payment-gateway paypal-sandbox

php - error - Paypal: capture el pago autorizado en WAMP



paypal integration (0)

Estoy trabajando en Paypal PHP SDK Sandbox en mi WAMP

He descargado https://github.com/paypal/PayPal-PHP-SDK y configurado en mi WAMP usando

https://github.com/paypal/PayPal-PHP-SDK/wiki

Al ejecutar debajo de una API en mi WAMP

https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/CreatePaymentUsingPayPal.php

WAMP URL: http: // localhost: 5000 / payments / CreatePaymentUsingPayPal.php

Obtuve ID de autorización después de ejecutar Payment.

"authorization": { "id": "94C27714AC6435104", "state": "authorized", "amount": { "total": "21.00", "currency": "USD", "details": { "subtotal": "17.50", "tax": "1.30", "shipping": "2.20" } },

Cuando ejecuto http: // localhost: 5000 / payments / AuthorizationCapture.php

http://paypal.github.io/PayPal-PHP-SDK/sample/doc/payments/AuthorizationCapture.html

También intenté al pasar mi ID de autorización

$authId = ''94C27714AC6435104'';

O

curl -v https://api.sandbox.paypal.com/v1/payments/authorization/94C27714AC6435104/capture / -H "Content-Type:application/json" / -H "Authorization: Bearer access_token$production$zsbtcmcqvdtgbfns$587003782e332bc0bbf00abc9cd89833" / -d ''{ "amount": { "currency": "USD", "total": "4.54" }, "is_final_capture": true }''

Pero todavía no está funcionando

400{"name":"UNKNOWN_ERROR","message":"An unknown error occurred.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#UNKNOWN_ERROR","debug_id":"c82898421e4ba"}exception ''PayPal/Exception/PayPalConnectionException'' with message ''Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/payment.'' in D:/wamp/www/PayPal-PHP-SDK-master/lib/PayPal/Core/PayPalHttpConnection.php:183 Stack trace: #0 D:/wamp/www/PayPal-PHP-SDK-master/lib/PayPal/Transport/PayPalRestCall.php(73): PayPal/Core/PayPalHttpConnection->execute(''{"intent":"auth...'') #1 D:/wamp/www/PayPal-PHP-SDK-master/lib/PayPal/Common/PayPalResourceModel.php(102): PayPal/Transport/PayPalRestCall->execute(Array, ''/v1/payments/pa...'', ''POST'', ''{"intent":"auth...'', NULL) #2 D:/wamp/www/PayPal-PHP-SDK-master/lib/PayPal/Api/Payment.php(579): PayPal/Common/PayPalResourceModel::executeCall(''/v1/payments/pa...'', ''POST'', ''{"intent":"auth...'', NULL, Object(PayPal/Rest/ApiContext), NULL) #3 D:/wamp/www/PayPal-PHP-SDK-master/sample/payments/AuthorizePayment.php(70): PayPal/Api/Payment->create(Object(PayPal/Rest/ApiContext)) #4 D:/wamp/www/PayPal-PHP-SDK-master/sample/capture.php(4): require(''D://wamp//www//Pay...'') #5 {main}