I am using the Paypal API (Website Payments Pro) to set up recurring payments with customers, and am currently testing in the paypal-sandbox. Paypal requires me to set up both Express Checkout and Direct Payment.

Express Checkout: Works fully with recurring payments. I get a 'success' response, and I can see the payment profile in my test account. To do this, I use SetExpressCheckout to have a user be able to get to Paypal, sign in, and be redirected to a page of my choice. I then use 'CreateRecurringPaymentsProfile' to actually create the profile with the required information.

Direct Payment: I do get a 'success' response as outlined below, but I cannot see the recurring payment profile in the test account. I am simply gathering the information on my site and sending it off to Paypal with 'CreateRecurringPaymentsProfile'.

Here is the 'success' output of my attempt at creating a recurring payment:

ACK: "Success"
AMT: "1%2e00"
AVSCODE: "X"
BUILD: "2075688"
CORRELATIONID: "bbfe83b685c0a"
CURRENCYCODE: "USD"
CVV2MATCH: "M"
TIMESTAMP: "2011%2d09%2d12T14%3a27%3a58Z"
TRANSACTIONID: "62214391KD595633B"
VERSION: "54%2e0"

I can try to provide any other details! Any help is appreciated.


Edit: Thanks for the help thus far. I am, however, receiving a success message once again with no proof of the transaction in the test account. The JSON output is this:

ACK: "Success"
BUILD: "2085867"
CORRELATIONID: "3e84486e74e80"
PROFILEID: "I%2d4Y707DELPFKD"
PROFILESTATUS: "ActiveProfile"
TIMESTAMP: "2011%2d09%2d12T20%3a13%3a15Z"
VERSION: "78%2e0"

Thanks a lot,

Daniel Moniz

有帮助吗?

解决方案

You're not seeing a profile because you're calling DoDirectPayment (which is only for one-off payments).
If you want to set up a recurring payment against a card (rather than a PayPal account) you would call CreateRecurringPaymentsProfile as well, but simply specify the card details rather than the token. From the response you're showing, you're not doing this.

See also https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_CreateRecurringPayments - "Credit Card Details fields".  

A sample call would be:  
METHOD=CreateRecurringPaymentsProfile&  
PROFILESTARTDATE=YYYY-mm-ddTH:i&  
DESC=Test&  
BILLINGPERIOD=Month&  
BILLINGFREQUENCY=12&  
AMT=0.01&  
CREDITCARDTYPE=Visa&  
ACCT=4111111111111111&  
EXPDATE=102012&  
CVV2=111  

Edit: I followed it and got a 'start date is required' error which got solved on replacing space with a T between date and time in PROFILESTARTDATE i.e. PROFILESTARTDATE=YYYY-mm-ddTH:i

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top