I am using Paypal Express Checkout to set up a recurring payment. The issue that i am being blocked on is that i cant figure out how to pass the start date from my site all the way through to the CreateRecurringPaymentsProfile
function. $_SESSION
isn't working so i looked at the API and there is a field you can set in SetExpressCheckout
called PAYMENTREQUEST_n_CUSTOM
, however its only for transcations including direct payment and not recurring. Can anyone help me with this?
function CallShortcutExpressCheckout( $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $paymentStartdate)
{
$nvpstr="&AMT=". $paymentAmount;
$nvpstr .= "&PAYMENTACTION=" . $paymentType;
$nvpstr .= "&BILLINGAGREEMENTDESCRIPTION=".urlencode("Denise Austin 360 Weekly Payments");
$nvpstr .= "&BILLINGTYPE=RecurringPayments";
$nvpstr .= "&RETURNURL=" . $returnURL;
$nvpstr .= "&CANCELURL=" . $cancelURL;
$nvpstr .= "&CURRENCYCODE=" . $currencyCodeType;
$nvpstr .= "&PROFILESTARTDATE=" . urlencode($paymentStartdate);
$nvpstr .= "&PAYMENTREQUEST_0_NOTETEXT=". urlencode($paymentStartdate);
$_SESSION["currencyCodeType"] = $currencyCodeType;
$_SESSION["PaymentType"] = $paymentType;
$_SESSION["startdate"] = $paymentStartdate;
$resArray=hash_call("SetExpressCheckout", $nvpstr);
$ack = strtoupper($resArray["ACK"]);
if($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING")
{
$token = urldecode($resArray["TOKEN"]);
$_SESSION['TOKEN']=$token;
}
return $resArray;
}
As you can see i am trying to pass the startdate in the field PAYMENTREQUEST_0_NOTETEXT but when i get into the order confirmation part and i call $GetExpressCheckoutDetails($token), all that is returned is:
Array
(
[TOKEN] => EC-6JB06756S20069824
[BILLINGAGREEMENTACCEPTEDSTATUS] => 1
[CHECKOUTSTATUS] => PaymentActionNotInitiated
[TIMESTAMP] => 2014-11-22T23:58:03Z
[CORRELATIONID] => cfd8d79420c2f
[ACK] => Success
[VERSION] => 84
[BUILD] => 13630372
[EMAIL] => xxxxxxxxxxxxxxxx
[PAYERID] => xxxxxxxxxxxxxx
[PAYERSTATUS] => verified
[FIRSTNAME] => Test
[LASTNAME] => Buyer
[COUNTRYCODE] => US
[SHIPTONAME] => Test Buyer
[SHIPTOSTREET] => xxxxxxxx
[SHIPTOCITY] => xxxxxxxx
[SHIPTOSTATE] => CA
[SHIPTOZIP] => xxxxxxx
[SHIPTOCOUNTRYCODE] => US
[SHIPTOCOUNTRYNAME] => United States
[ADDRESSSTATUS] => Confirmed
[CURRENCYCODE] => USD
[AMT] => 14.99
[SHIPPINGAMT] => 0.00
[HANDLINGAMT] => 0.00
[TAXAMT] => 0.00
[INSURANCEAMT] => 0.00
[SHIPDISCAMT] => 0.00
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_AMT] => 14.99
[PAYMENTREQUEST_0_SHIPPINGAMT] => 0.00
[PAYMENTREQUEST_0_HANDLINGAMT] => 0.00
[PAYMENTREQUEST_0_TAXAMT] => 0.00
[PAYMENTREQUEST_0_INSURANCEAMT] => 0.00
[PAYMENTREQUEST_0_SHIPDISCAMT] => 0.00
[PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED] => false
[PAYMENTREQUEST_0_SHIPTONAME] => Test Buyer
[PAYMENTREQUEST_0_SHIPTOSTREET] => xxxxxxxxxx
[PAYMENTREQUEST_0_SHIPTOCITY] => xxxxxxxxxx
[PAYMENTREQUEST_0_SHIPTOSTATE] => CA
[PAYMENTREQUEST_0_SHIPTOZIP] => xxxxxxxxx
[PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => US
[PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME] => United States
[PAYMENTREQUEST_0_ADDRESSSTATUS] => Confirmed
[PAYMENTREQUESTINFO_0_ERRORCODE] => 0
)