首页 > 解决方案 > 交易因违规而被拒绝

问题描述

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

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

标签: paypalpayment-gateway

解决方案


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


推荐阅读