Search code examples
phppaypalrequire

How To Use Paypal Payout PHP API


I'm using PHP and I want to send money to users who have sold their products on my platform. For this I'm trying to use Paypal Payouts, I've found this link here with an example code for a single payout.

My problem is that, I'm not that good in PHP and I have no clue how this actually works. The latter part of the script is more or less understandable however, I'm really unsure about these lines here:

require __DIR__ . '/../bootstrap.php';
$payouts = new \PayPal\Api\Payout();
$senderBatchHeader = new \PayPal\Api\PayoutSenderBatchHeader();

What is bootstrap.php and why is it necessary for this paypal payout system? Also I need to know how do these objects here work new \PayPal\Api\PayoutSenderBatchHeader() I really do not understand the syntax here.

Can someone explain what these three lines exactly mean and why they are needed for the paypal payout and how they work?


Solution

  • The PayPal-PHP-SDK is deprecated and should not be used for any new integration.

    On the list of current SDKs you will find the Payouts PHP SDK.