我正在尝试将PayPal结帐整合到我的integrate站点中。集成似乎很好,但我在创建订单时总是有错误。下面将找到我使用的所有代码。
index.html
<head>
...
<script src="https://www.paypal.com/sdk/js?client-id=MY-APP-SANDBOX-ID"></script>
</head>donation.component.ts
declare var paypal;
...
export class DonationComponent implements OnInit{
...
ngOnInit(): void {
...
paypal.Buttons({
createOrder: (data, actions) => {
return actions.order.create({
purchase_units: [{
description: "Donation For Al-Darb Platform.",
amount: {
currency_code: 'USD',
value: this.value
}
}]
});
},
onApprove: async (data, actions) => {
const order = await actions.order.capture();
console.log(order);
},
onError: err => {
console.log(err);
}
}).render(this.paypalElement.nativeElement);
}
}donation.component.html
...
<div #paypal></div>在执行之后,一切只在结帐时才能正常工作(登录到Paypal并确认付款后)。我总是收到以下错误:HTTP400
{
ack: "contingency",
contingency: "UNPROCESSABLE_ENTITY"
data: {name: "UNPROCESSABLE_ENTITY", details: [{ issue: "COMPLIANCE_VIOLATION" ...}],
...
}发布于 2020-09-07 21:07:48
COMPLIANCE_VIOLATION
应该有更多的信息,如一个debug_id,你可以分享,但由于这是阿尔及利亚,我相信问题是帐户需要建立一个自动扫描方法,以接收付款。您可以阅读PayPal Receive Funds and Automatic Transfer Agreement for Algeria (country code dz) here (列表中其他适用的国家有自己的网址,但协议文本可能相同)
详细说明,可能的自动扫描方法包括一个国际银行帐户,或能够提取资金的本地Visa卡(并非所有的信用卡都可以这样做)。
一旦你把这个设置在帐户上,你就可以收到付款。联系贝宝的支持,进一步的帮助,这不是一个技术问题的堆栈溢出。
https://stackoverflow.com/questions/63783745
复制相似问题