我们正在使用 Paypal Pro 进行直接信用卡处理。当我在请求中放入 2 笔交易时会发生什么,信用卡批准了一个交易对象,但由于资金不足而拒绝了另一个交易对象。PayPal 是否会丢弃整个交易并返回错误?
直接从 node.js 的 paypals rest api 获取以下代码
var payment_details = {
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [{
"credit_card": {
"type": "visa",
"number": "4417119669820331",
"expire_month": "11",
"expire_year": "2018",
"cvv2": "874",
"first_name": "Joe",
"last_name": "Shopper",
"billing_address": {
"line1": "52 N Main ST",
"city": "Johnstown",
"state": "OH",
"postal_code": "43210",
"country_code": "US" }}}]},
"transactions": [{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"subtotal": "7.41",
"tax": "0.03",
"shipping": "0.03"}},
"description": "This is the payment transaction description." }]};
paypal_sdk.payment.create(payment_details, function(error, payment){
if(error){
console.error(error);
} else {
console.log(payment);
}
});
当我们将 2 个交易对象放入其中时会发生什么情况,我们是否必须处理信用卡在第二次交易中被拒绝的情况?