Here's a sample from their documentation for what needs to be added:
Code: Select all
Charge the customer for the first-time and create Billing agreement ID API Request:
USER=xxxxx_biz_api1.paypal.com
PWD=xxxxxx
SIGNATURE=xxxxx
METHOD=SetExpressCheckout
VERSION=121.0
RETURNURL=https://localhost/return.php
CANCELURL=https://localhost
PAYMENTREQUEST_0_PAYMENTACTION=Sale
PAYMENTREQUEST_0_AMT =10.00
PAYMENTREQUEST_0_CURRENCYCODE =USD
PAYMENTREQUEST_0_DESC =test EC payment
[b]L_BILLINGTYPE0=MerchantInitiatedBilling[/b]
The response should be:
Array
(
[TOKEN] => EC%2d14240720UX0919338
[TIMESTAMP] => 2010%2d11%2d11T01%3a54%3a55Z
[CORRELATIONID] => 8716bb9e93de5
[ACK] => Success
[VERSION] => 64%2e0
[BUILD] => 1603004
)
So now you have the token and you redirect in the same manner taking them to PayPal.com
https://www.paypal.com/checkoutnow?token=<token>
They then return to the URL specified in the SetExpressCheckout API call with a Post Back of the Token, and the Payer ID. Once you have the PayerID and Token you can do your normal "GetExpressCheckoutDetails" call to get the data. You parse out the returned data and get ready for your DoExpressCheckoutPayment API call. DoExpressCheckoutPayment looks about the same as normal, except you get back the "BillingAgreementID":
Array
(
[TOKEN] => EC%2d14240720UX0919338
[BILLINGAGREEMENTID] => B%2d8AG97914JU089040M
[TIMESTAMP] => 2010%2d11%2d11T02%3a02%3a25Z
[CORRELATIONID] => d986158e6c496
[ACK] => Success
[VERSION] => 64%2e0
[BUILD] => 1603004
[TRANSACTIONID] => 6V1164425Y0419841
[TRANSACTIONTYPE] => expresscheckout
[PAYMENTTYPE] => instant
[ORDERTIME] => 2010%2d11%2d11T02%3a02%3a23Z
[AMT] => 10%2e00
[FEEAMT] => 0%2e01
[TAXAMT] => 0%2e00
[CURRENCYCODE] => USD
[PAYMENTSTATUS] => Completed
[PENDINGREASON] => None
[REASONCODE] => None
[PROTECTIONELIGIBILITY] => Eligible
[INSURANCEOPTIONSELECTED] => false
[SHIPPINGOPTIONISDEFAULT] => false
)
Now you save the BillingAgreementID with that customer. Then when they go back later they can use their PayPal account without having to login.
We are using AbleCommerce 7.0.7 and cannot upgrade to GOLD.