forked from angelleye/paypal-php-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddBankAccount.php
67 lines (60 loc) · 3.92 KB
/
AddBankAccount.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
// Include required library files.
require_once('includes/config.php');
require_once('includes/paypal.class.php');
// Create PayPal object.
$PayPalConfig = array(
'Sandbox' => $sandbox,
'DeveloperAccountEmail' => $developer_account_email,
'ApplicationID' => $application_id,
'DeviceID' => $device_id,
'IPAddress' => $_SERVER['REMOTE_ADDR'],
'APIUsername' => $api_username,
'APIPassword' => $api_password,
'APISignature' => $api_signature,
'APISubject' => $api_subject
);
$PayPal = new PayPal_Adaptive($PayPalConfig);
// Prepare request arrays
$AddBankAccountFields = array(
'AccountHolderDateOfBirth' => '', // The date of birth of the account holder. Format: YYYY-MM-DDZ (ie. 1970-01-01Z)
'AccountID' => '', // The ID number of the PayPal account for which a bank account is added. You must specify either AccountID or EmailAddress for this request.
'AgencyNumber' => '', // For the Brazil Agency Number
'BankAccountNumber' => '', // The account number (BBAN) of the bank account to be added.
'BankAccountType' => '', // The type of bank account to be added. Values are: CHECKING, SAVINGS, BUSINESS_SAVINGS, BUSINESS_CHECKING, NORMAL, UNKNOWN
'BankCode' => '', // The code that identifies the bank where the account is held.
'BankCountryCode' => '', // Required. The country code of the bank.
'BankName' => '', // The name of the bank.
'BankTransitNumber' => '', // The transit number of the bank.
'BranchCode' => '', // The branch code for the bank.
'BranchLocation' => '', // The branch location.
'BSBNumber' => '', // The Bank/State/Branch number for the bank.
'CLABE' => '', // CLABE represents the bank information for countries like Mexico.
'ConfirmationType' => '', // Required. Whether PayPal account holders are redirected to PayPal.com to confirm the bank account addition. When you pass NONE for this param, the addition is made without the account holder's explicit confirmation. If you pass WEB, a URL is returned. Values are: WEB, NONE. NONE requires advanced permissions.
'ControlDigit' => '', // The control digits for the bank.
'EmailAddress' => '', // The email address of the PayPal account holder. You must specify either AccountID or EmailAddress.
'IBAN' => '', // The IBAN for the bank.
'InstitutionNumber' => '', // The institution number for the bank.
'PartnerInfo' => '', // The partner informatoin for the bank.
'RibKey' => '', // The RIB Key for the bank
'RoutingNumber' => '', // The bank's routing number.
'SortCode' => '', // The branch sort code.
'TaxIDType' => '', // Tax ID type of CNPJ or CPF, only supported for Brazil
'TaxIDNumber' => '' // Tax ID number for Brazil
);
$WebOptions = array(
'CancelURL' => '', // The URL to which the user is returned when they cancel the flow at PayPal.com
'CancelURLDescription' => '', // A description for the CancelURL
'ReturnURL' => '', // The URL to which the user is returned when they complete the process.
'ReturnURLDescription' => '' // A description for the ReturnURL
);
$PayPalRequestData = array(
'AddBankAccountFields' => $AddBankAccountFields,
'WebOptions' => $WebOptions
);
// Pass data into class for processing with PayPal and load the response array into $PayPalResult
$PayPalResult = $PayPal->AddBankAccount($PayPalRequestData);
// Write the contents of the response array to the screen for demo purposes.
echo '<pre />';
print_r($PayPalResult);
?>