PHP code example of amsify42 / paypal-masspayment
1. Go to this page and download the library: Download amsify42/paypal-masspayment library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
amsify42 / paypal-masspayment example snippets
'providers' => [
'Amsify42\PaypalMassPayment\PaypalMassPaymentServiceProvider',
];
'aliases' => [
'PaypalMassPayment' => 'Amsify42\PaypalMassPayment\PaypalMassPaymentFacade',
];
use PaypalMassPayment;
$receivers = array(
0 => array(
'ReceiverEmail' => "[email protected] ",
'Amount' => "0.01",
'UniqueId' => "id_001",
'Note' => " Test Streammer 1"),
1 => array(
'ReceiverEmail' => "[email protected] ",
'Amount' => "0.01",
'UniqueId' => "id_002",
'Note' => " Test Streammer 2"),
);
$response = PaypalMassPayment::executeMassPay('Some Subject', $receivers);
$response = \PaypalMassPayment::executeMassPay('Some Subject', $receivers);
$config = [
'authentication' => 'api_signature',
'environment' => 'sandbox',
'operation_type' => 'nvp',
'api_vesion' => '51.0',
'receiver_type' => 'email',
'currency' => 'USD',
'sandbox' => [
'api_username' => 'random-facilitator_api1.gmail.com',
'api_password' => 'FKJHS786JH3454',
'api_certificate' => '',
'api_signature' => 'sdfrfsf3rds3435432545df3124dg34tDFG#$sG23rfSD3',
],
'live' => [
'api_username' => '',
'api_password' => '',
'api_certificate' => '',
'api_signature' => '',
],
];
$payment = PaypalMassPayment::setConfig($config);
$response = $payment->executeMassPay('Some Subject', $receivers);
$config = [
'environment' => 'live',
'live' => [
'api_username' => '',
'api_password' => '',
'api_certificate' => '',
'api_signature' => '',
],
];
$payment = PaypalMassPayment::setConfig($config);
$response = $payment->executeMassPay('Some Subject', $receivers);
bash
$ php artisan vendor:publish