当我尝试使用 paypal 执行付款时,我收到此错误。我试图避免使用 sync_mode 等方法,但没有帮助。请帮助解决这个错误我的功能
$payouts = new Payout();
$senderBatchHeader = new PayoutSenderBatchHeader();
$senderBatchHeader->setSenderBatchId(uniqid())
->setEmailSubject("You have a Payout!");
$senderItem = new PayoutItem();
$senderItem->setRecipientType('Email')
->setNote('Thanks for your patronage!')
->setReceiver('paypalemail@gmail.com')
->setSenderItemId("2014031400023")
->setAmount(new Currency('{
"value":"1.0",
"currency":"USD"
}'));
$payouts->setSenderBatchHeader($senderBatchHeader)
->addItem($senderItem);
$request = clone $payouts;
$apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(
'client_id',
'client_secrete_id'
)
);
try {
$output = $payouts>createSynchronous($apiContext);
} catch (Exception $ex) {
return $ex;
}
return $output;