PayPal Express Checkout,在同一SetExpressCheckout中设置多个重复配置文件失败

时间:2019-07-17 08:28:28

标签: c# asp.net paypal express-checkout recurring

因此,过去几天我一直在尝试了解为什么在尝试执行此操作时会遇到错误。我试图使用相同的令牌两次调用CreateRecurringPaymentsProfile,但是仅成功创建了第一个重复配置文件,而第二个失败,错误代码为“ 11581,数据无效,配置文件描述无效”。我仔细阅读了文档here,其中说:“如果要创建多个定期付款配置文件,则必须为每个计划创建的配置文件调用一次CreateRecurringPaymentsProfile。”,因此,我知道这是可能的。我还看到this thread遇到了同样的问题,但是尽管应用了该解决方案,仍然出现错误。

我将逐步指导我提出的每个请求以及下面的答复。

首先,我致电SetExpressCheckout,并确保每个订阅都具有&L_BILLINGTYPE0 = &L_BILLINGAGREEMENTDESCRIPTION0 =

METHOD=SetExpressCheckout
&RETURNURL=https://localhost:44302/Checkout/CheckoutReview
&CANCELURL=https://localhost:44302/Checkout/CheckoutCancel
&BRANDNAME=mycomp Ltd.
&NOSHIPPING=1
&SOLUTIONTYPE=Sole
&LANDINGPAGE=Billing
&PAYMENTREQUEST_0_AMT=24
&PAYMENTREQUEST_0_ITEMAMT=24
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_CURRENCYCODE=EUR
&PAYMENTREQUEST_0_DESC=Datasly Subscription
&L_BILLINGTYPE0=RecurringPayments
&L_BILLINGAGREEMENTDESCRIPTION0=Yearly Data Export (Individual) Subscription
&L_PAYMENTREQUEST_0_DESC0=Yearly Data Export (Individual) Subscription
&L_PAYMENTREQUEST_0_NAME0=Data Export (Individual)
&L_PAYMENTREQUEST_0_AMT0=12
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital
&L_BILLINGTYPE1=RecurringPayments
&L_BILLINGAGREEMENTDESCRIPTION1=Yearly Data Analytics (Individual) Subscription
&L_PAYMENTREQUEST_0_DESC1=Yearly Data Analytics (Individual) Subscription
&L_PAYMENTREQUEST_0_NAME1=Data Analytics (Individual)
&L_PAYMENTREQUEST_0_AMT1=12
&L_PAYMENTREQUEST_0_QTY1=1
&L_PAYMENTREQUEST_0_ITEMCATEGORY1=Digital
&USER=<redacted>
&PWD=<redacted>
&VERSION=88.0
&BUTTONSOURCE=PP-ECWizard

然后我得到以下答复:

TOKEN=EC-04G347976Y6961501
&TIMESTAMP=2019%2d07%2d17T08%3a00%3a54Z
&CORRELATIONID=500f5efdc5a15
&ACK=Success
&VERSION=88.0
&BUILD=53232958

然后我致电GetExpressCheckout,以便在用户确认购买之前在订单查看屏幕上显示一些信息

METHOD=GetExpressCheckoutDetails
&TOKEN=EC-0UG24040KK3588706
&USER=<redacted>
&PWD=<redacted>
&SIGNATURE=<redacted>
&VERSION=88.0
&BUTTONSOURCE=PP-ECWizard

这是回应

TOKEN=EC-04G347976Y6961501
&BILLINGAGREEMENTACCEPTEDSTATUS=1
&CHECKOUTSTATUS=PaymentActionNotInitiated
&TIMESTAMP=2019-07-17T08:06:19Z
&CORRELATIONID=9a2f1e788431f
&ACK=Success
&VERSION=88.0
&BUILD=53232958
&EMAIL=it-buyer@mycomp.com
&PAYERID=F9G98AX3A9JFW
&PAYERSTATUS=verified
&FIRSTNAME=test
&LASTNAME=buyer
&COUNTRYCODE=US
&ADDRESSSTATUS=Confirmed
&CURRENCYCODE=EUR
&AMT=24.00
&ITEMAMT=24.00
&SHIPPINGAMT=0.00
&HANDLINGAMT=0.00
&TAXAMT=0.00
&DESC=Datasly Subscription
&NOTIFYURL=https://www.datasly.net/PayPal_IPN
&INSURANCEAMT=0.00
&SHIPDISCAMT=0.00
&INSURANCEOPTIONOFFERED=false
&L_NAME0=Data Export (Individual)
&L_NAME1=Data Analytics (Individual)
&L_QTY0=1
&L_QTY1=1
&L_TAXAMT0=0.00
&L_TAXAMT1=0.00
&L_AMT0=12.00
&L_AMT1=12.00
&L_DESC0=Yearly Data Export (Individual) Subscription
&L_DESC1=Yearly Data Analytics (Individual) Subscription
&L_ITEMCATEGORY0=Digital
&L_ITEMCATEGORY1=Digital
&PAYMENTREQUEST_0_CURRENCYCODE=EUR
&PAYMENTREQUEST_0_AMT=24.00
&PAYMENTREQUEST_0_ITEMAMT=24.00
&PAYMENTREQUEST_0_SHIPPINGAMT=0.00
&PAYMENTREQUEST_0_HANDLINGAMT=0.00
&PAYMENTREQUEST_0_TAXAMT=0.00
&PAYMENTREQUEST_0_DESC=Datasly Subscription
&PAYMENTREQUEST_0_NOTIFYURL=https://www.datasly.net/PayPal_IPN
&PAYMENTREQUEST_0_INSURANCEAMT=0.00
&PAYMENTREQUEST_0_SHIPDISCAMT=0.00
&PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID=it-facilitator@mycomp.com
&PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED=false
&L_PAYMENTREQUEST_0_NAME0=Data Export (Individual)
&L_PAYMENTREQUEST_0_NAME1=Data Analytics (Individual)
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_QTY1=1
&L_PAYMENTREQUEST_0_TAXAMT0=0.00
&L_PAYMENTREQUEST_0_TAXAMT1=0.00
&L_PAYMENTREQUEST_0_AMT0=12.00
&L_PAYMENTREQUEST_0_AMT1=12.00
&L_PAYMENTREQUEST_0_DESC0=Yearly Data Export (Individual) Subscription
&L_PAYMENTREQUEST_0_DESC1=Yearly Data Analytics (Individual) Subscription
&L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital
&L_PAYMENTREQUEST_0_ITEMCATEGORY1=Digital
&PAYMENTREQUESTINFO_0_ERRORCODE=0

用户点击确认订单后,我遍历购物车,并使用与&L_BILLINGAGREEMENTDESCRIPTION 相同的描述,为每个带有 DESC 的商品调用CreateRecurringPaymentsProfile。下面是第一个呼叫,然后是响应。

METHOD=CreateRecurringPaymentsProfile
&TOKEN=EC-0UG24040KK3588706
&PROFILESTARTDATE=2019-07-17T00:00:0
&DESC=Yearly Data Export (Individual) Subscription
&BILLINGPERIOD=Year
&BILLINGFREQUENCY=1
&MAXFAILEDPAYMENTS=1
&AMT=12
&INITAMT=12
&CURRENCYCODE=EUR
&EMAIL=renos@mycomp.com
&L_PAYMENTREQUEST_0_NAME0=Data Export (Individual)
&L_PAYMENTREQUEST_0_AMT0=12
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital
&USER=<redacted>
&PWD=<redacted>
&SIGNATURE=<redacted>
&VERSION=88.0
&BUTTONSOURCE=PP-ECWizard

响应

PROFILEID=I-KC40GDE3WN9J
&PROFILESTATUS=PendingProfile
&TIMESTAMP=2019-07-17T07:33:05Z
&CORRELATIONID=f4e7114dcc972
&ACK=Success
&VERSION=88.0
&BUILD=53072421

然后在循环的第二次迭代中,使用与&L_BILLINGAGREEMENTDESCRIPTION

相同的描述,用 DESC 再次调用CreateRecurringPaymentsProfile
METHOD=CreateRecurringPaymentsProfile
&TOKEN=EC-0UG24040KK3588706
&PROFILESTARTDATE=2019-07-17T00:00:0
&DESC=Yearly Data Analytics (Individual) Subscription
&BILLINGPERIOD=Year
&BILLINGFREQUENCY=1
&MAXFAILEDPAYMENTS=1
&AMT=12
&INITAMT=12
&CURRENCYCODE=EUR
&EMAIL=renos@mycomp.com
&L_PAYMENTREQUEST_0_NAME0=Data Analytics (Individual)
&L_PAYMENTREQUEST_0_AMT0=12
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital
&USER=<redacted>
&PWD=<redacted>
&SIGNATURE=<redacted>
&VERSION=88.0
&BUTTONSOURCE=PP-ECWizard

响应

TIMESTAMP=2019-07-17T07:36:10Z
&CORRELATIONID=93be9ff7870f9
&ACK=Failure
&VERSION=88.0
&BUILD=53072421
&L_ERRORCODE0=11581
&L_SHORTMESSAGE0=Invalid Data
&L_LONGMESSAGE0=Profile description is invalid
&L_SEVERITYCODE0=Error

我不明白为什么无法创建第二个配置文件。

0 个答案:

没有答案