If you are going to fasten PayPal payment support on the site, or rather Website Payments Pro (WPP), or rather
Direct Recurring Payments , then most likely you have already read the documentation from the service itself:
Integrating Recurring Payments .
But if you didn’t screw this particular type of payments before, then you probably don’t even know about some features of its testing.
In general, to test payment via PayPal, there is a
sandbox , which is quite easy to use - you just need to register at
https://developer.paypal.com , then create a test account. In this case, it is easier to create an account using the “Create a preconfigured account” method, choose Account Type = Website Payments Pro (WPP), the rest is optional. And voila - on the Test Accounts page you will have a merchant account for WPP.
But we remember that we need Direct Recurring Payments WPP, so we log in as a seller at
https://www.sandbox.paypal.com and go to his profile.
')
Here we need 2 things:
1) the link “Request API credentials”, clicking on which we choose “Option 1” >> the link “Set up PayPal API credentials and permissions”. And then “Option 2”> link “View API Signature”. From this page we save ourselves:
API Username ,
API Password ,
Signature , which corresponds to the parameters
USER ,
PWD ,
SIGNATURE in requests to PayPal API (for more details, see the
documentation ).
2) the “Instant Payment Notification preferences” link, by clicking on which and clicking the “Choose IPN Settings” button, you can set the URL of your PayPal message listener. (why you need it, you can find
there )
And here, having inspired you, write your form for receiving payments from the user, and sending the first test requests to PayPal will receive a message like:
DPRP Is Disabled For This MerchantScratching the back of your head, double-checking all the parameters, passwords, URLs, and again get “DPRP Is Disabled For This Merchant.” Scribble whiskey and google about it on the Internet, and maybe stumble upon instructions such as
these . But what you really need in this position is this
branch of the PayPal developer network forum .
Because for some inexplicable reasons, the PayPal service considers it normal not to fix this bug since at least February 2010. Instead, the Paypalians kindly offer to write a WPP test account soap in this thread so that in some tricky way (inaccessible to mere mortals) you can include these same DPRPs.
So, if required, then register, and then we write something like:
Hi,
I'd like my test account to be enabled for DPRP:
< >
Thanks!
And we wait for about a day (well, or as lucky, depending on your time zone, calendar holidays and moderators' mood)
Having cherished:
Hi < >,
DPRP is already enabled for your account.
from the user with the PayPal X icon in his profile (left),
you can finally start integrating Website Payments Pro, Direct Recurring Payments.
Oh, and a small moment: after creating a profile (CreateRecurringPaymentsProfile), be sure to check its status (via GetRecurringPaymentsProfileDetails), it is likely that the status in the response to the first request will not be entirely correct.
I hope that this small essay will save good people reading Habr a day or two and a bunch of nerves :)