How to test credit card recurring payment via REST API

anyegongjue
Contributor
Contributor

Hi there,

I want to apply a business account for my online shop. I use the REST API to build the payment gateway in my website. I want to accept credit card when client subscribes my monthly service.

 

Now I tested the API implementation using a sandbox business account and a sandbox business pro account and none of them can accept the credit card subscriptions.

 

Do I need to do some special settings to get it working?

 

This is the API document I followed.

https://developer.paypal.com/docs/api/overview/

 

Thanks.

Login to Me Too
1 REPLY 1

anyegongjue
Contributor
Contributor

Here is the error I got:

PayPal Create Recurring Payment Exception: <br />Error Message: Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/billing-agreements/.<br />Line Number: 202<br />Trace:
#0 /.../app/Vendor/paypal/rest-api-sdk-php/lib/PayPal/Transport/PayPalRestCall.php(78): PayPal\Core\PayPalHttpConnection->execute('{"name":"Email ...')
#1 /.../app/Vendor/paypal/rest-api-sdk-php/lib/PayPal/Common/PayPalResourceModel.php(104): PayPal\Transport\PayPalRestCall->execute(Array, '/v1/payments/bi...', 'POST', '{"name":"Email ...', NULL)
#2 /.../app/Vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Agreement.php(390): PayPal\Common\PayPalResourceModel::executeCall('/v1/payments/bi...', 'POST', '{"name":"Email ...', NULL, Object(PayPal\Rest\ApiContext), NULL)
#3 /.../app/Plugin/Payment/Controller/PaymentPayPalGatewayController.php(900): PayPal\Api\Agreement->create(Object(PayPal\Rest\ApiContext))
#4 [internal function]: PaymentPayPalGatewayController->admin_recurringPayment('479', '1')

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.