Detecting cancellation of a paypal billing agreement setup with reference transactions - paypal

I am using the 'reference transactions' of the Paypal express checkout api to set up a recurring billing scenario for our customers. I have chosen this method since the amount billed per month will vary and there is no initial payment when entering into the billing agreement.
My question is, can I use the paypal IPN to detect when the user cancels this? I know that if the customer enters into this agreement they have the power to log into their own Paypal account and cancel the agreement. What variables should I be listening for through the IPN?
Whilst I see mention of recurring payments and recurring payment profiles in the IPN documentation these are not actually the same as setting up a recurring billing scenario via reference transactions (recurring payments and reference transactions are in two different parts of the general paypal api documentation).

Enable IPN in your PayPal account , then PayPal will notify you via IPN about the Billing agreement cancel from the customer.

If you include IPN with SetExpressCheckout, it will not work with Reference Transaction. You need to Enable IPN on PayPal site.

Related

PayPal PayFlow - converting existing transaction into Recurring Payment Profile

I'm a bit confused about PayPal Payflow Recurring Billing
I read in the documentation that I can convert an existing transaction into a recurring payment profile.
This means that I can send my user to the ExpressCheckout page where she makes a "zero dollar" one time transaction, and then, PayPal sends me back the transaction ID (PNREF) which I can use as ORIGID value when I'm creating the new profile?
And if its correct, it means that I don't have to handle credit card and other sensitive information, because basically the user types her details on the PayPal hosted checkout page?
Yes, you can use a completed transaction to create a recurring billing profile, but it cannot be an auth transaction (zero dollars or otherwise). Quote from the documentation:
IMPORTANT: You can use only a Sale or Delayed Capture transaction as a
template for a profile.
https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_payflowpro_recurringbilling_guide.pdf

How to use billing agreement with chained payments?

We are setting up our marketplace transactions with PayPal and thus want to use chained payments for simple processing and to prevent being a funds aggregator.
As we want to capture buyers payment method once (upfront) and allow them to buy services from sellers later without entering their payment details every time, PayPal has 2 options: 1) pre-approvals, or 2) billing agreements.
However since buyers should also be able to pay with credit card, we can only use option 2) billing agreements.
Is our understanding correct that billing agreements are not compatible with chained payments?
Also, if they are not compatible, how can we go about it to allow for:
- Users to pay with credit card
- Not have them enter the credit card details every time at the time of purchase
- Use chained payments (prevent funds aggregation which would happen if we receive funds first and payout in a second operation)?
Thanks!
Preapproved Payments is part of the Adaptive Payments platform. Depending on what you're doing with the transaction when the time comes to submit a payment with a preapproval profile you may use a simple payment, parallel payment, or chained payment.
What you're after, billing agreements, is part of the Express Checkout API or Payments Pro. The actual term for what you'll be working with is Reference Transactions.
If you process a credit card directly over Payments Pro (either sale or auth) then you can simply use that transaction ID you get back with the DoReferenceTransaction API at any point in the future to process another transaction automatically.
If you process the original sale or authorization with Express Checkout, that's where you need to include billing agreement parameters in your SetExpressCheckout request to create that billing agreement, but then you'd still use the DoReferenceTransaction API to process future payments.

Recurring Payment IPN

Quick question about the notify_url HTML variable (from PayPal Payments Standard). I am specifying the URL as a variable that is sent to PayPal via a redirect URL for a recurring payment setup (all is working as expected when setting up the recurring payment).
But I am wondering, when PayPal goes to actually process a payment in the future (actual recurring payment), will it use the same URL for the IPN notification that was used during the recurring payment setup?
I have multiple IPN scripts, one for regular payments and one for recurring payments - I want to be sure that each future recurring payment uses a specific IPN script.
Cheers!
First, for the sake of terminology, if you're using HTML buttons then you're using Standard Subscriptions, not Recurring Payments. Technically, they're the same thing, but Recurring Payments is API based and IPN data is different for Standard Subscriptions vs. Recurring Payments. Just keep that in mind when searching for information about the two.
As for the IPN's, unfortunately, it will not continue to use that same URL. You'll need to make sure that IPN is configured in the PayPal account profile in order for future transactions related to the profile to trigger IPN's.
This goes for both Standard Subscriptions and Recurring Payments API transactions.

recurring payment with paypal advanced NOT paypal pro

I am trying to make recurring payment work with PAYPAL ADVANCED
My script works in case of SALE transactions but there are issues when i try to create recurring profile.
ISSUES
When i am posting my request with CREATESECURETOKEN set to Y. It returns Invalid transaction type: Invalid Transaction Type for secure token creation request
Here is the string. Note i have changed user and pass here
PARTNER[6]=PayPal&VENDOR[10]=#####&USER[11]=#####&PWD[9]=#####&CREATESECURETOKEN[1]=Y&TRXTYPE[1]=R&RECURRING[1]=Y&TENDER[1]=C&ACTION[1]=A&PROFILENAME[6]=Gautam&ACCT[16]=4012888888881881&EXPDATE[4]=1214&AMT[5]=10.00&START[8]=06132013&PAYPERIOD[4]=MONT&TERM[1]=0&OPTIONALTRX[1]=S&OPTIONALTRXAMT[4]=2.00&EMAIL[20]=#####&SECURETOKENID[26]=MySecTokenID-51b93e0830f70&RETURNURL[51]=http://localhost:8080/php/test/payflow/advanced.php&CANCELURL[51]=http://localhost:8080/php/test/payflow/advanced.php&ERRORURL[51]=http://localhost:8080/php/test/payflow/advanced.php&BILLTOFIRSTNAME[4]=John&BILLTOLASTNAME[3]=Doe&BILLTOSTREET[12]=123 Main St.&BILLTOCITY[8]=San Jose&BILLTOSTATE[2]=CA&BILLTOZIP[5]=95101&BILLTOCOUNTRY[2]=US&SHIPTOFIRSTNAME[4]=Jane&SHIPTOLASTNAME[5]=Smith&SHIPTOSTREET[13]=1234 Park Ave&SHIPTOCITY[8]=San Jose&SHIPTOSTATE[2]=CA&SHIPTOZIP[5]=95101&SHIPTOCOUNTRY[2]=US
if i set CREATESECURETOKEN to N i receive Invalid merchant information: 10002-You do not have permissions to make this API call
I searched for documentation on recurring payment with paypal advanced but every where i found details about payflow pro. With no information about recurring payment with paypal advanced its not easy to make things work.
Any idea about what is wrong with my post data?.
I posted my query on paypal.com/mts a week back but have no reply.
NOTE: I have subscribed to paypal advanced and paypal recurring payment.
With paypal advanced the transactions are completed on the client website itself and user is never taken to paypal site. Yes it uses iframe for the purpose.
It works for SALE type transaction but not in case of recurring payment.
Payments Pro and Advanced don't support the Recurring Payment API calls. You would be using the Recurring Billing API calls through Payflow. The new Advanced and Pro accounts use Payflow Pro or Link.
Are you setting a billing type in the Secure Token call?
What is the ticket number you submitted? I'd to look up the account to see if the account is setup to use Recurring Billing and was created correctly.
Also, Advanced accounts shouldn't be using the Recurring Billing API calls. It is possible to create Recurring Billing profiles with an Advanced account but they have to be done through the PayPal Manager site.

Do Paypal recurring payments have unique txn_ids?

I'm using the Paypal "Subscription" button. I have an IPN handler and overall I think I've got it all figured out. My last problem is that apparently there's no good way to test a recurring payment (except to wait for the cycle to occur). This issue is discussed here: [question]: Testing Paypal subscription IPN
I don't really need to test this recurring payment but I do need to know if every recurring payment will have it's own txn_id or if every payment in a subscription shares the same ID.
Thanks!
Yes, each recurring payment cycle will create a new transaction with its own transaction ID.
You'd link these transactions together via their recurring payments profile ID.