Песочница работает нормально, но когда я перехожу к жизни, она показывает - Получил Http код ответа 403 при доступе к https://api.paypal.com/v1/payments/payouts?. Служба выплат также включена в моем приложении REST.
Моя функция выплат здесь:
public function singlePayout(Request $request)
{
$payouts = new Payout();
$senderBatchHeader = new PayoutSenderBatchHeader();
$senderBatchHeader->setSenderBatchId(uniqid())
->setEmailSubject("You have a redeem amount.");
$senderItem1 = new PayoutItem();
$senderItem1->setRecipientType('Email')
->setNote("Thanks for your patronage")
->setReceiver($withdrawRequest->paypal_acc_email)
->setSenderItemId(uniqid())
->setAmount(new Currency(json_encode([
'value' => $request->amount,
'currency' => 'USD'
])));
$payouts->setSenderBatchHeader($senderBatchHeader)
->addItem($senderItem1);
$request = clone $payouts;
try {
$createPayout = $payouts->create(null, $this->_paypal_api_context);
$payoutBatchID = $createPayout->batch_header->payout_batch_id;
$payoutBatchDetail = $payouts->get($payoutBatchID, $this->_paypal_api_context);
$payoutItemTransactionStatus = $payoutBatchDetail->items[0]->transaction_status;
} catch (\Exception $ex) {
return response()->json([
'status' => 'failed',
'msg' => $ex->getMessage()
]);
}
return response()->json([
'status' => 'success',
'info' => 'The recipient for this transaction will receive the amount within a while.',
'msg' => 'Amount has been transferred successfully.'
]);
}
Есть ли какое-либо решение для сервиса выплат PayPal?