My clients don't want to handle credit card data so I have implemented 2 options, 1) PayPal Advanced with Hosted Pages, and 2) PayPal Pro Transparent redirect. I am able to create recurring payments by
- Getting my secure token
- Committing a transaction
- Converting transaction to Recurring Billing Profile
PayPal requires that I give the user the option to pay with a PayPal account but when I convert that payment to a RBP and then let it create a transaction the trans fails with result 7 - Field Format Error. I notice that the RBP created has no account number.
With option 1 I think I'm out of luck yes?
With option 2, I use Payflow.net dll to process the EC which works fine (see code sample). Is there a code sample somewhere on how to create a RBP with a token instead of a CC num or BAID?
...
partner = pageSettings.PageSettings["PayPalPartner"];
vendor = pageSettings.PageSettings["PayPalLogin"];
user = pageSettings.PageSettings["PayPalUser"];
pwd = Utilities.DecryptSettingValue(pageSettings.PageSettings["PayPalPassword"])
UserInfo creds = new UserInfo(user, vendor, partner, pwd);
string url = ConfigurationManager.AppSettings.Get("PayflowLive");
PayflowConnectionData connection = new PayflowConnectionData(url);
ECDoRequest doRequest = new ECDoRequest(token, payerID);
PayPalTender tender = new PayPalTender(doRequest);
Invoice inv = new Invoice();
inv.Amt = new Currency(amount, "USD");
inv.Comment1 = fundName;
SaleTransaction trans = new SaleTransaction(creds, connection, inv, tender, PayflowUtility.RequestId);
Response resp = trans.SubmitTransaction();
I don't have the code but I can direct you on how you can create the recurring profile using the PayPal Payments . It includes the four steps :
1. Call the SetExpressCheckout API
2.Redirect the customer using the generated token :
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-8DA60888D41196708
3. Once the buyer accept the agreement use the token to get the billing agreement id
4. After getting BAID , make a call to create the recurring billing using BAID