In my application, I need to set recurring billing section using paypal advanced and I am using the payflow section to do the same. I need both Pay with PayPal button process (Express Checkout process) and Credit card payment to create the recurring profile. My initial request is like this:
public static PayPalRedirectAdv PayFlow()
{
NameValueCollection requestArray = new NameValueCollection()
{
{"PARTNER", "PayPal"}, // You'll want to change these 4
{"VENDOR", "merchantname"}, // To use your own credentials
{"USER", "username"},
{"PWD", "abcdenfg"},
{"TRXTYPE", "A"},
{"AMT", "1.00"},
{"CURRENCY", "USD"},
{"CREATESECURETOKEN", "Y"},
{"SECURETOKENID", "tokenId generated"},
{"RETURNURL", UrlReturn},
{"CANCELURL", UrlCancel},
{"ERRORURL", lUrlError},
{"BILLINGTYPE","RecurringBilling"}
};
NameValueCollection resp = run_payflow_call(requestArray); // Will call the payflow end point via HttpWebRequest
if (resp["RESULT"] == "0")
{
string mode = "TEST";
return new PayPalRedirectAdv
{
Url = "https://payflowlink.paypal.com?SECURETOKEN=" + resp["SECURETOKEN"] + "&SECURETOKENID=" + resp["SECURETOKENID"] + "&MODE=" + mode
};
}
else
{
return new PayPalRedirectAdv { Url = string.Empty };
}
}
Once the process is completed, I have set the url to an IFrame and it is embedded in one of my views in my mvc project. When the IFrame is loaded, it has two issues.
1) The page is redirected to the top level. This means that the browser window is redirected to IFrame url. I have chosen Layout C as my hosted checkout page. When I use credentials supplied in the demo project, the browser navigation is solved; i.e Iframe correctly loaded in my view. Is there any setting in the Paypal manager settings to prevent this? I tried to fix this by sandboxing top level navigation, but this won't allow me to redirect to paypal site by clicking the "Check out with Paypal" button.
2) For a payment with a Credit card, once the transaction is successful, I will convert the existing transaction to a profile by:
"TRXTYPE=R&TENDER=C&PARTNER=PayPal&VENDOR=Acme&USER=Acme&PWD=a1b2c3d4&ACTION=A&PROFILENAME=RegularSubscription&ORIGID=<PNREF>&START=12012002&PAYPERIOD=
WEEK&TERM=12&OPTIONALTRX=S&OPTIONALTRXAMT=2.00&COMMENT1=First-time
customer&AMT=42.00"
This works fine and the recurring profile is created.
However, when I click on the "Check out with Paypal" button, this will take me to the Paypal page where I could login to Paypal using my Paypal credentials and then when I click the "paynow" button, it will deduct money from my account. This also has an PNERF value and when I used the same code above to convert the transaction to recurring profile by replacing Tender as P, but it shows me a response message that "the transaction id corresponding to this id is not found". The Paypal checkout process doesn't show any information about the user is going for a reccuring payment section.
Also, I followed Express Checkout with recurring billing to do the task, but I got BAID as null in the DoExpressCheckout step.
I need both pay with paypal and pay with credit options on my site, so what parameters should I use to accomplish this?
Thanks in advance.