paypal - 交易因违规而被拒绝
问题描述
我编写了一个基于 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.
解决方案
尝试创建新的沙盒业务帐户并使用它的凭据(client_id、secret)而不是默认的沙盒业务帐户凭据。我遇到了这个问题,这对我有帮助:)。
推荐阅读
- sharepoint - 从 Sharepoint 数据库中提取 Sharepoint 站点信息
- tcp - 数据包捕获是否绕过 TCP/IP 堆栈的一部分?
- python - 在 Herokuapp 上托管 flask_restplus Swagger UI 显示“未提供 API 定义”。
- kiwi-tcms - 提取产品字段以显示在测试用例搜索页面上
- php - 从 csv 导入散列用户密码
- json - Json 无法添加依赖
- google-cloud-platform - 允许用户在 Google Cloud Platform 上的我的应用中添加指向子域的自定义域
- deep-learning - 为什么 Mel-filterbank 能量在使用 CNN 进行语音命令识别方面优于 MFCC?
- python - 为什么我不应该在 python 中使用全局变量?
- angular - Master/Detail - setColumnState(...) 更新状态,但表格没有改变