PayPal 结帐 - platform_fee 订单创建
PayPal checkout - platform_fee on order create
我按照本教程在我的市场上启用 PayPal:https://developer.paypal.com/docs/business/checkout/set-up-standard-payments/
所以,我写了这段代码:
<script src="https://www.paypal.com/sdk/js?client-id=xxxxxxxxxxx"></script>
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '{{ course.price / 100 }}',
currency: 'EUR'
},
payee: {
merchant_id: '3SBUTQHGTMHWS'
},
}],
});
},
这个工作正常,但是当我想添加 platform_fee、PayPal return 422(无法处理的实体)时:
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '{{ course.price / 100 }}',
currency: 'EUR'
},
payee: {
merchant_id: '3SBUTQHGTMHWS'
},
payment_instruction: {
disbursement_mode: 'INSTANT',
platform_fees: [{
amount: {
currency_code: 'EUR',
value: '3'
}
}]
},
}],
});
},
如何使用 PayPal Checkout 收取平台费用?
感谢您的帮助
除非您是经批准的 PayPal 合作伙伴,否则您不能使用 platform_fee
我按照本教程在我的市场上启用 PayPal:https://developer.paypal.com/docs/business/checkout/set-up-standard-payments/
所以,我写了这段代码:
<script src="https://www.paypal.com/sdk/js?client-id=xxxxxxxxxxx"></script>
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '{{ course.price / 100 }}',
currency: 'EUR'
},
payee: {
merchant_id: '3SBUTQHGTMHWS'
},
}],
});
},
这个工作正常,但是当我想添加 platform_fee、PayPal return 422(无法处理的实体)时:
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '{{ course.price / 100 }}',
currency: 'EUR'
},
payee: {
merchant_id: '3SBUTQHGTMHWS'
},
payment_instruction: {
disbursement_mode: 'INSTANT',
platform_fees: [{
amount: {
currency_code: 'EUR',
value: '3'
}
}]
},
}],
});
},
如何使用 PayPal Checkout 收取平台费用? 感谢您的帮助
除非您是经批准的 PayPal 合作伙伴,否则您不能使用 platform_fee