交易因违规而被拒绝

时间:2020-08-23 15:53:53

标签: paypal payment-gateway

我编写了一个基于Express js(NodeJs)的电子商务脚本。在我能够通过贝宝(sandbox)付款之前,但是现在经过一周的编码之后,每次我尝试通过贝宝从脚本中购买某些东西时,我都遇到了这个错误

{
  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.

2 个答案:

答案 0 :(得分:1)

尝试创建新的沙盒企业帐户并使用其凭据(cliend_id、secret)而不是默认的沙盒企业帐户凭据。 我遇到了这个问题,这对我有帮助:)

答案 1 :(得分:0)

违反法规的原因可能有很多。

如果您要在实时环境中收到此错误,则可能需要在帐户中添加自动取款方法(例如支持取款的银行帐户或本地Visa卡)其他可能的原因。您必须联系PayPal以获得进一步的支持,以查明违规的原因。

由于您的问题是针对沙盒环境的,因此只需使用来自其他国家(例如美国或英国)的接收方企业帐户进行测试即可。在https://www.paypal.com/signin?intent=developer&returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Faccounts%2F创建一个,然后在https://developer.paypal.com/developer/applications创建一个具有ClientID / Secret的应用