<?php

require_once '../includes/config.php';
require_once '../autoload.php';
$PayPalConfig = array('Sandbox' => $sandbox, 'APIUsername' => $api_username, 'APIPassword' => $api_password, 'APISignature' => $api_signature);
$PayPal = new angelleye\PayPal\PayPal($PayPalConfig);
$CRPPFields = array('token' => '');
$DaysTimestamp = strtotime('now');
$Mo = date('m', $DaysTimestamp);
$Day = date('d', $DaysTimestamp);
$Year = date('Y', $DaysTimestamp);
$StartDateGMT = $Year . '-' . $Mo . '-' . $Day . 'T00:00:00\\Z';
$ProfileDetails = array('subscribername' => 'Tester Testerson', 'profilestartdate' => $StartDateGMT, 'profilereference' => '');
$ScheduleDetails = array('desc' => 'Angell EYE Web Hosting', 'maxfailedpayments' => '', 'autobillamt' => '1');
$BillingPeriod = array('trialbillingperiod' => '', 'trialbillingfrequency' => '', 'trialtotalbillingcycles' => '', 'trialamt' => '', 'billingperiod' => 'Month', 'billingfrequency' => '1', 'totalbillingcycles' => '0', 'amt' => '10.00', 'currencycode' => 'USD', 'shippingamt' => '', 'taxamt' => '');
$ActivationDetails = array('initamt' => '', 'failedinitamtaction' => '');
$CCDetails = array('creditcardtype' => 'Visa', 'acct' => '4635800000971893', 'expdate' => '022013', 'cvv2' => '123', 'startdate' => '', 'issuenumber' => '');
$PayerInfo = array('email' => '*****@*****.**', 'payerid' => '', 'payerstatus' => '', 'countrycode' => '', 'business' => 'Testers, LLC');
$PayerName = array('salutation' => '', 'firstname' => 'Tester', 'middlename' => '', 'lastname' => 'Testerson', 'suffix' => '');
$BillingAddress = array('street' => '123 Test Ave.', 'street2' => '', 'city' => 'Grandview', 'state' => 'MO', 'countrycode' => 'US', 'zip' => '64030', 'phonenum' => '');
$ShippingAddress = array('shiptoname' => '', 'shiptostreet' => '', 'shiptostreet2' => '', 'shiptocity' => '', 'shiptostate' => '', 'shiptozip' => '', 'shiptocountrycode' => '', 'shiptophonenum' => '');
$PayPalRequestData = array('ProfileDetails' => $ProfileDetails, 'ScheduleDetails' => $ScheduleDetails, 'BillingPeriod' => $BillingPeriod, 'CCDetails' => $CCDetails, 'PayerInfo' => $PayerInfo, 'PayerName' => $PayerName, 'BillingAddress' => $BillingAddress);
$PayPalResult = $PayPal->CreateRecurringPaymentsProfile($PayPalRequestData);
echo '<pre />';
print_r($PayPalResult);