PayPal Subscription + One time order (NVP)
-
26-06-2021 - |
Pergunta
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!
Solução
You are missing L_BILLINGTYPE0
and L_BILLINGAGREEMENTDESCRIPTION0
in your data, add them and you should be set :)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow