I coded an ecommerce script based on express js (NodeJs). before i was able to make the payment via paypal (sandbox) but after a week of coding right now every time i try to purchase something from the script via paypal i got this errors
{
name: 'COMPLIANCE_VIOLATION',
message: 'Transaction is declined due to compliance violation.',
information_link: 'https://developer.paypal.com/docs/api/payments/#errors',
debug_id: '9ebba0bda94ee',
httpStatusCode: 400
}
(node:1226) UnhandledPromiseRejectionWarning: Error: Response Status : 400
at IncomingMessage.<anonymous> (/Users/ismail/Desktop/expressjs-blank/node_modules/paypal-rest-sdk/lib/client.js:130:23)
at IncomingMessage.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1184:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:1226) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1226) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Try to create new sandbox business account and use it's credentials (cliend_id, secret) instead of default sandbox business account credentials.
I faced this problem and this help me :).
There are many possible reasons for a compliance violation.
If you were to receive this error in the live environment, you may need to add an auto withdrawal method to the account (such as a bank account or local Visa card that supports withdrawals), among other possible reasons. You would have to contact PayPal for further support in identifying the reason for the violation.
Since your question is for the sandbox environment, simply try your testing with a receiver Business account from a different country, for example US or UK. Create one at https://www.paypal.com/signin?intent=developer&returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Faccounts%2F , and then an app with a ClientID/Secret for it at https://developer.paypal.com/developer/applications
Related
How to simulate error scenarios in paypal smart buttons, and can I get error in JSON format in onError method in paypal smart button. I want issue and descriptopn of the error in onError method.
If you use the server-side front-end to call routes on your server, and in turn call the v2/checkout/orders API from your server, negative testing can be done with those underlying APIs: https://developer.paypal.com/docs/api-basics/sandbox/request-headers/
I'm not aware of ways to trigger errors with just a client-side integration.
If you want to test the error scenario then just pass that Invoice id which you used earlier for creating order request.
In on error function, you would not get any Json response but just a simple message showing a capture payment error.
I can't, for the life of me, find the meanings and causes of these PayPal payment states:
created; failed; pending; canceled; expired, in_progress
from the PayPal REST API documentation.
Downloading and checking the source code of rest-api-sdk-php yields nothing as well, but instead added a new state: partially_completed
Can anyone point me to the right reference?
I need to be able to handle properly when the payment execution state is anything other than approved.
The status field is not specific to RESTful interfaces at Paypal, and the api docs in that respect are not missing anything. I use the following to reference the status fields:
Paypal Status Reference
Were getting a lot of #INTERNAL_SERVICE_ERROR's through the rest PayPal API. To get more details about the error we have been going the PayPal Tech Support. We've been able to fix some of the issues but it is taking us a lot longer than we would like. I was wondering if there was an API call that I could make that would give me the full details of the error or DebugID?
I am not sure how you are currently consuming the API, but https://developer.paypal.com/webapps/developer/docs/api/ specs the error object which has the debug_id, the PayPal internal identifier used for correlation purposes. The error object has information link and error_details object which has the detailed reasons for the error
If you are using an sdk to consume, it is possible to get the debug_id in your logs: https://github.com/paypal/rest-api-sdk-nodejs#debugging and https://github.com/paypal/rest-api-sdk-python#create-payment show ways to do that in Python and Node.
I myself am looking for the same information. But it appears the debug ID is only so Paypal support can correlate the error to a transaction event. Technically there is no other information associated with the Debug ID.
See Receiving INTERNAL_SERVICE_ERROR REST API
When calling getAccountTransactions to retrieve account transactions, I get a UNAVAILABLE NotRefreshedReason on some accounts.
Accounts used with getAccountTransactions have a correct account type (not other).
What do we need to do in case of UNAVAILABLE NotRefreshedReason ?
I contact Intuit support and after few exchanges with them, they tell me a way to retrieve the intuit error code associated with UNAVAILABLE NotRefreshedReason.
It is possible to retrieve Intuit error code in field aggrStatusCode when calling getCustomerAccounts, getAccount or getLoginAccounts.
You can then check error codes on this link : https://developer.intuit.com/docs/0020_customeraccountdata/customer_account_data_api/0700_error_codes
Some error codes can be managed with your application users, but other may need account deletion or to contact Intuit support.
I'm in a pickle with PayPal's new (and nice) REST Api. I am able to make many calls to the Paypal REST sandbox successfully. However, there are random times it won't work for short perdiods at all and the response code is *Internal Server Error *
Is this because I'm using a Sandbox? Or am I testing it too often? Is there a log stored for my account where I can see why the sandbox returned this error?
Here are the credit cards Im generally testing with.
4000000000000002
4417119669820331
It's sporadic, and unpredictible if it will work or not. Is anyone else having this issue?
Here is the response:
debug_id: 394271a164c9
name: INTERNAL_SERVICE_ERROR