问题
See how I started complete procedure,
Step 1. First called SetExpressCheckout,
AMT=0.00
PAYMENTREQUEST_0_AMT=0.00
PAYMENTACTION
BILLINGAGREEMENTDESCRIPTION
BILLINGTYPE=MerchantInitiatedBilling
RETURNURL
CANCELURL
CURRENCYCODE
SOLUTIONTYPE=Sole
LOCALECODE=us
LANDINGPAGE=Billing
step 2. then I called CreateBillingAgreement
TOKEN
PAYERID
PAYMENTACTION
AMT
CURRENCYCODE
IPADDRESS
It returns Billing Id.
Step 3. calling DoReferenceTransaction with parameters:
&REFERENCEID=B-0GJ65589SA3528026 //billing Id generated by CreateBillingAgreement method
&PAYMENTACTION=Sale
&AMT=3.00
&CURRENCYCODE=USD
&IPADDRESS=paypalrecurring.com
&L_ITEMCATEGORY0=Digital
&DESC=Test+Recurring+Payment%28+%243.00+monthly%29
&L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_NAME0=Test Name
&L_PAYMENTREQUEST_0_AMT0=3.00
&L_NAME0=Test Name
&L_DESC0=Test+Recurring+Payment%28+%243.00+monthly%29
&L_AMT0=3.00
&ITEMAMT=3.00
&L_QTY0=1
But the aerror ocuurs:
Array
(
[TIMESTAMP] => 2015-11-03T11:29:51Z
[CORRELATIONID] => 811b64f880aff
[ACK] => Failure
[VERSION] => 69
[BUILD] => 000000
[L_ERRORCODE0] => 10004
[L_SHORTMESSAGE0] => Invalid Data
[L_LONGMESSAGE0] => This transaction cannot be processed.
[L_SEVERITYCODE0] => Error
[TRANSACTIONTYPE] => None
[PAYMENTTYPE] => None
[ORDERTIME] => 1970-01-01T00:00:00Z
[PAYMENTSTATUS] => None
[PENDINGREASON] => None
[REASONCODE] => None
)
Please tell me where I am wrong. Note: Paypal team said RT enabled. (Sandbox testing)
回答1:
First try to set
RECURRING
field of DoReferenceTransaction API call.
If it's without success use method CreateRecurringPaymentsProfile instead DoReferenceTransaction. API Documentation link.
I recommend to not use paypal sandbox - just use https://api-3t.paypal.com/nvp and set price to 0.01 - this will prevent double testing
Error 10004 has appear when has incompatibility between methods SetExpressCheckout and ( in your case ) DoReferenceTransaction
About error "Express Checkout Digital Goods is no longer available for new integrations" : We made a contact with Paypal support to activate the Digital Goods for our main paypal account. Also we tried many times to activate Digital Goods inside our paypal account and after several days this error disappear like a miracle :)
I am not so sure how I resolve this error but after trying many different tests ( including asking PayPal support ) he just disappear. So my advice is to continue trying with different ways and combinations
来源:https://stackoverflow.com/questions/33493444/not-getting-success-for-doreferencetransaction