Unable to perform credit card payment in production

paulwoodring
Contributor
Contributor

Hi Support team,

 

I have a website that is developed in php and i sucesfully integrated PayPal-PHP-Sdk. Using the sdk i performed credit card payment it is working as expected in sandbox but not in live, below are my log's  in production. Could you please guide me to resolve this.

 

[17-11-2017 03:23:48] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/oauth2/token
[17-11-2017 03:23:49] PayPal\Core\PayPalHttpConnection : INFO: Invalid or no certificate authority found - Retrying using bundled CA certs file
[17-11-2017 03:23:50] PayPal\Core\PayPalHttpConnection : INFO: Response Status     : 200
[17-11-2017 03:23:50] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/vault/credit-cards
[17-11-2017 03:23:50] PayPal\Core\PayPalHttpConnection : INFO: Invalid or no certificate authority found - Retrying using bundled CA certs file
[17-11-2017 03:23:51] PayPal\Core\PayPalHttpConnection : INFO: Response Status     : 201
[17-11-2017 03:23:51] PayPal\Core\PayPalHttpConnection : INFO: GET https://api.paypal.com/v1/vault/credit-cards/CARD-5PG687970N058774GLIHLDDQ
[17-11-2017 03:23:52] PayPal\Core\PayPalHttpConnection : INFO: Invalid or no certificate authority found - Retrying using bundled CA certs file
[17-11-2017 03:23:53] PayPal\Core\PayPalHttpConnection : INFO: Response Status     : 200
[17-11-2017 03:29:23] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/payments/payment
[17-11-2017 03:29:23] PayPal\Core\PayPalHttpConnection : INFO: Invalid or no certificate authority found - Retrying using bundled CA certs file
[17-11-2017 03:29:24] PayPal\Core\PayPalHttpConnection : INFO: Response Status     : 401
[17-11-2017 03:29:24] PayPal\Core\PayPalHttpConnection : ERROR: Got Http response code 401 when accessing https://api.paypal.com/v1/payments/payment. {"name":"UNAUTHORIZED_PAYMENT","message":"Unauthorized payment.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"fbfd36faa8462"}
[17-11-2017 03:30:24] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/payments/payment
[17-11-2017 03:30:24] PayPal\Core\PayPalHttpConnection : INFO: Invalid or no certificate authority found - Retrying using bundled CA certs file
[17-11-2017 03:30:25] PayPal\Core\PayPalHttpConnection : INFO: Response Status     : 401
[17-11-2017 03:30:25] PayPal\Core\PayPalHttpConnection : ERROR: Got Http response code 401 when accessing https://api.paypal.com/v1/payments/payment. {"name":"UNAUTHORIZED_PAYMENT","message":"Unauthorized payment.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"2ec0637f47e3"}

 

 

Login to Me Too
5 REPLIES 5

MTS_Justin
Moderator
Moderator
Hello,

It appears you are experiencing one of the following issues.

1. You are using a sandbox client id and client secret, but are submitting the transaction request to a production endpoint. (each REST app has both sandbox and live credentials, you need to use the correct credential within the correct environment)

2. You have submitted a transaction request, but have no first requested and received an authorization token. (you need to request an authorization token before you can submit any transaction requests)

Was my post helpful? If so, please give me a kudos!
Login to Me Too

paulwoodring
Contributor
Contributor

Hi @MTS_Justin ,

 

Thanks for your response. Below are my responses.

 

1. You are using a sandbox client id and client secret, but are submitting the transaction request to a production endpoint. (each REST app has both sandbox and live credentials, you need to use the correct credential within the correct environment)

 I am sure i am using the live credentials.

2. You have submitted a transaction request, but have no first requested and received an authorization token. (you need to request an authorization token before you can submit any transaction requests)

 

This is not the case.

 

 Couple days research on this , i found that To acctpet "payment_method": "credit_card" paypal account should be pro enabled.  Could you please suggest me on this same.

Login to Me Too

MTS_Justin
Moderator
Moderator
Hi @paulwoodring

Yes, in order to use the "payment_method" of "credit_card", which is essentially a direct payment, you need to have that functionality enabled on your PayPal account.

REST API direct card payments require a UK business account which has been enabled for PayPal Payments Pro. This is the only supported country for direct card payments via REST API.

Was my post helpful? If so, please give me a kudos!
Login to Me Too

layeeqa
Contributor
Contributor

Hi

 I am using version 1 Rest apis in sandbox and are working fine in sandbox, when i use live credentials it is giving me error as unauthorised.

Kindly help me on this.

 

 

Login to Me Too

MTS_Justin
Moderator
Moderator
Hello @layeeqa

As this is a different issue, please create a new thread and provide details of the issue.

Authentication issues (unauthorised) are caused either by the credentials being incorrect, request is being submitted to an environment for which the credentials are not valid (using sandbox credentials on a production endpoint, or vice-versa) or you're attempting to submit a transaction request for which you're account is not authorised (payouts in production for example).

As I mentioned above, you'll need to create a new thread and provide detailed information about the request you're submitting, including the API response you're receiving back where the error is shown.

Thanks !

Was my post helpful? If so, please give me a kudos!
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.