1

Sorry if this has been answered somewhere, but from what I found, no one has answered this.

I'll be quick. I've created function that allows for the quick generation of PayPal fields so we can do quick payments through our custom built CMS. Through this, we can create multiple one time payments or subscriptions, however, it appears we can't do both at the same time. Here's an example of what I'm trying to achieve (version 63):

Array
(
    [L_PAYMENTREQUEST_0_NAME0] => XXXXXX
    [L_PAYMENTREQUEST_0_DESC0] => XXXXXXXXXX
    [L_PAYMENTREQUEST_0_AMT0] => 97.00
    [L_PAYMENTREQUEST_0_QTY0] => 1
    [L_PAYMENTREQUEST_0_NUMBER0] => 112

    [L_PAYMENTREQUEST_0_NAME1] => XXXXXX
    [L_PAYMENTREQUEST_0_DESC1] => XXXXXXXXXXX
    [L_PAYMENTREQUEST_0_AMT1] => 37.00
    [L_PAYMENTREQUEST_0_QTY1] => 1
    [L_PAYMENTREQUEST_0_NUMBER1] => 113
    [L_BILLINGAGREEMENTDESCRIPTION1] => Subscription: XXXXXXXXX
    [L_BILLINGTYPE1] => RecurringPayments

    [METHOD] => SetExpressCheckout
    [LANDINGPAGE] => Billing
    [ALLOWNOTE] => 0
    [RETURNURL] => http://XXXXXXXXXX/confirm-order
    [CANCELURL] => http://XXXXXXXXXX/checkout/cancelled
    [CURRENCYCODE] => AUD
    [PAYMENTREQUEST_0_ITEMAMT] => 134
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 0
    [PAYMENTREQUEST_0_AMT] => 134
    [PAYMENTREQUEST_0_CURRENCYCODE] => AUD
    ....

And this is what I'm getting back

[L_ERRORCODE0] => 10480
[L_SHORTMESSAGE0] => Invalid Data
[L_LONGMESSAGE0] => Invalid billing agreement type.
[L_SEVERITYCODE0] => Error

Could anyone enlighten me on what I'm doing wrong? I've done some searching, but all results have come up empty.

Thanks!

Dave
  • 862
  • 10
  • 20

1 Answers1

2

You are missing L_BILLINGTYPE0 and L_BILLINGAGREEMENTDESCRIPTION0 in your data, add them and you should be set :)

Andreas Wong
  • 59,630
  • 19
  • 106
  • 123
  • Fantastic! Should have seen this before. I get to set up my product for subscription on the final step, so I guess it doesn't matter what I throw into the setExp just as long as the `L_BILLINGAGREEMENTDESCRIPTION0` and `DESC` match. – Dave Aug 15 '12 at 03:30
  • Dave, what did you provide for your L_BILLINGAGREEMENTDESCRIPTION0 value? – Perry Tew Sep 14 '17 at 13:23