Php 在贝宝RESTAPI中,创建付款时,一次付款可以进行多个交易?
我正在使用PHP PayPal Rest API 我正在从这个链接生成代码- 它包含此代码Php 在贝宝RESTAPI中,创建付款时,一次付款可以进行多个交易?,php,arrays,paypal,transactions,payment,Php,Arrays,Paypal,Transactions,Payment,我正在使用PHP PayPal Rest API 我正在从这个链接生成代码- 它包含此代码 $transaction = new Transaction(); $transaction->setAmount($amount) ->setItemList($itemList) ->setDescription("Payment description"); ... $payment = new Payment(); $payment->setIntent
$transaction = new Transaction();
$transaction->setAmount($amount)
->setItemList($itemList)
->setDescription("Payment description");
...
$payment = new Payment();
$payment->setIntent("sale")
->setPayer($payer)
->setRedirectUrls($redirectUrls)
->setTransactions(array($transaction));
而且效果很好
似乎一次支付可以将多笔交易作为一个数组
但是,当您处理多个这样的事务时:
$transaction1 = new Transaction();
$transaction1->setAmount($amount1)
->setItemList($itemList1)
->setDescription("Payment1 description");
$transaction2 = new Transaction();
$transaction2->setAmount($amount2)
->setItemList($itemList2)
->setDescription("Payment2 description");
...
$payment = new Payment();
$payment->setIntent("sale")
->setPayer($payer)
->setRedirectUrls($redirectUrls)
->setTransactions(array($transaction1, $transaction2));
它不工作,它显示了这样的错误
'访问时获取Http响应代码400。'
是否不可能在一次付款中进行多笔交易
或者这个错误是其他原因造成的?原因是什么
非常感谢任何人的帮助