Paypal Payout API
I am trying to figure out the best workflow for Paypal bulk payout:
I have everything working i.e. I can send bulk payouts and read and store responses.
I have a PaypalService class that interacts with Paypals API.
// ...
use myApp\Contracts\Payment;
class PaypalService implements Payment
{
public function sendBatchPayout(...)
{
...
}
public function getPayoutDetails($payout_batch_id)
{
...
}
}
// .. etc
I want to know what the ideal process is to handle bulk payouts.
for eg:
3 recipients need to get X amount
I do this with:
create batch payout.
This returns a response with the 'payout_batch_id' , and this is asynchronous.
Do I make a call to get payout batch details immidiately after to get the status? or is there a waiting period?
What part of the response am I to store in my Storage/DB, I create a record for each recipient of the bulk payout, should I assign 'payout_batch_id' to each of these records
no.5 is important since the next time I wish to send a payout I want to deduct the amount of previous successful payouts from the current payout amount.
Please help. Thank you.
Please or to participate in this conversation.