phppaypalexpress-checkoutrecurring-billing

PayPal Express Checkout call does not produce BAID in Layout C


For their web subscription service, my client is fully subscribed to Paypal Payments Pro (a.k.a. Payflow) and has also subscribed to the Recurring Billing add-on.

I have been able to set up recurring billing using credit cards without a problem. However, I am mystified by the PayPal Express checkout for recurring billing.

The problem that I am having is with the side-by-side integration of PayPal Express Checkout and Hosted Credit Card checkout in the context of Payflow's "Layout C". I don't seem to have a means to provide the differing information to each of the Layout's two different payment methods (tenders).

I've read the documentation quite thoroughly, and repeatedly. I appear to have missed something though.

I have perused the php API library, and can't find a reference. Is there something there that someone may point me to?

When I use a secure token and to produce an iframe with Layout C, that layout automatically produces a two-tiered stack with 1. PayPal Express Checkout on top and 2. credit card checkout on the bottom. The problem remains that the two separate components seem to require different cURL calls (with different NVPs) and I know no way to provide separate calls to the form in the layout.

There seems to be a higher-level concept that I am missing. (Keep in mind, I – roughly – understand Einstein's stuff. This makes me even more frustrated that I can't comprehend PayPal's stuff!)

To give you a better idea of what I am trying currently, here are those details: I tried assuming that using Layout C automatically initialized a BAID. This seemed like a good assumption, because the authorization did return a TOKEN in the POST variables. However, using this token returns an error result:

RESULT=12&PNREF=BJPXXX8333D4&RESPMSG=Declined: 11455-Buyer did not accept billing agreement

Here is what I am currently doing:

First step: To get the payments form in "Layout C", with both payment methods (Express Checkout and credit card), I am submitting these NVPs and ONLY these NVPs:

USER=[user]
&VENDOR=[vendor]
&PARTNER=PayPalCA
&PWD=[password]
&CREATESECURETOKEN=Y
&SECURETOKENID=randomlygenerated
&TRXTYPE=A
&AMT=8.95
&CURRENCY=USD
&CSCREQUIRED=TRUE
&EMAIL=buyersemail@email.com
&FIRSTNAME=namelikeBob
&LASTNAME=namelikeDobbs

This works to:

Second step: My current strategy (which is failing) for converting this authorization to a recurring payment is to analyze the TENDER value from the POST that PayPal sends back to my success page. I then set up the recurring payment differently, depending on whether that value is a "C" or a "P".

I have been successful in setting up credit card (TENDER=C) recurring payment profiles, using these NVPs:

USER=[user]
&VENDOR=[vendor]
&PARTNER=PayPalCA
&PWD=[password]
&TRXTYPE=R
&ACTION=A
&ORIGID=fromPayPalsPOSTedPNREF
&START=aworkingdate
&TENDER=C
&PROFILENAME=Monthly Subscription
&PAYPERIOD=MONT
&TERM=0 // continue all subscriptions until the client deactivates  
&AMT=8.95
&CURRENCY=USD

However the PayPal (TENDER=P) BAID fails. Again, these NVPs may not be the problem. It may be that I have not found a way to send BILLINGTYPE=MerchantInitiatedBilling in an earlier request:

USER=[user]
&VENDOR=[vendor]
&PARTNER=PayPalCA
&PWD=[password]
&TRXTYPE=A
&ACTION=X
&START=aworkingdate
&TENDER=P
&TOKEN=fromPayPalsPOSTedTOKEN
&PAYPERIOD=MONT
&TERM=0 // continue all subscriptions until the client deactivates  
&AMT=8.95
&CURRENCY=USD

There seem like a lot of details here, but if I have left anything out, please let me know and I will provide the info pronto!


Solution

  • Have you tried actually placing:

    &BILLINGTYPE=MerchantInitiatedBilling
    &BA_DESC=ADescriptionIsRequired
    

    in the first step that creates the secure token?

    Another thing you can try that might make a difference is to include, as an actual NVP parameter:

    &PAYPAL-NVP=Y
    

    What this used to do is tell Payflow to forward any extra parameters (even unrecognized ones) on to PayPal, and give the full response from PayPal.