Recurring payments and IPN notifications - paypal

Can anyone assist me to understand and find answers to following questions:
When first notification (IPN) occurs for recurring payment. Will it be with initial payment or no?
Does notifyurl URL itself, which PayPal calls, contains some token for validation (i.e. https://someurl.com/callback/[validation-token])?
Thank you!

Found interface (link) to monitor those notifications.
Therefore now I can answer my question myself :)
Yes it does.
Looks like no. After I have setup notify URL from PayPal console (link) my callback URL did not contained some suffix. Validation token itself is present in notification message
If you have any corrections kindly let me know.

Related

PayPal Subscription Failed Payment Webhook flow

i was wondering what webhook is sent when a subscription payment fails?. I wish to downgrade a user on my website if a payment isn't made/fails. but im unsure if the 'Billing.Subscription.Cancelled or Billing.Subscription.Suspended is sent.' I have the "max_fail_attempts": "1".
Thanks
Paypal apis & documents are suck. you can check this link
https://www.paypal-community.com/t5/Webhooks-REST-APIs/regarding-webhook-of-billing-agreement/td-p/1450631
I never see this callback sent, now i give up these webhooks and try IPN instead, hope it works.
there is another link maybe help, in 2015 guys said webhooks supports for recurring payment is in progress, I think it still in progress now.
https://github.com/paypal/PayPal-PHP-SDK/issues/242

Paypal API get payment confirmation

I am able to post payment data to the Paypal REST API, and I get a response.
However, I ran some tests and entered incorrect expire dates and invorrect CVV2 numbers, but the response I get from the API is that the credit card has been approved.
From searching around, I understand that I should use the IPN to get a confirmation of the payment. I setup the IPN listener, and when I use the simulator to test, everything seems to be working.
My question is, how to I trigger the IPN callback on the payment? Or what would be the correct method to fully test the credit card details?
Any suggestions would be greatly appreciated! TIA!
Yes, in live env., it will return the same failed response than a wrong card number.

Paypal REST API Process

Please correct me if I am wrong regarding my understanding about Paypal Rest Api process.
In reference to the links below:
https://developer.paypal.com/docs/integration/direct/create-billing-plan/
https://github.com/paypal/PayPal-node-SDK/blob/master/samples/subscription/billing_plans/create.js
I came up to a conclusion that in order for the paypal api to work, the merchant must create:
A custom button
The button must create a request to paypal in other words the merchant must manually fill out the JSON object stated on:
https://github.com/paypal/PayPal-node-SDK/blob/master/samples/subscription/billing_plans/create.js
with the merchant's product info.
Pass the request to paypal
Store the paypal response to your database.
Please advise, there are too few information out there. Thank you.
I figured it out, my question above is confirmed except that you need to active the created billing plan.
https://developer.paypal.com/docs/integration/direct/create-billing-plan/#activate-the-billing-plan

how to validate payment was made

I have read about paypal IPN but that has delays in notification.
I watched this video on setting up a paypal subscription button
http://www.youtube.com/watch?v=jHC9BoRDEOY
but the thing I am missing is that I add a url that paypal will go to after payment. When this url is hit, I need to immediately verify that payment was made(ie. I want it so if a user goes to that url without paying, we don't accidentally continue the process since he has not paid yet).
so, how can I
1. have paypal feed me some kind of unique id when it brings up my url
2. call back to paypal to verify that payment as been made.
Lastly, how can I test this all out on the paypal sandbox to make sure everything is working together?
thanks,
Dean
I did find this but this is not using the buttons at all. Is there not a way to use the buttons?
https://developer.paypal.com/docs/classic/express-checkout/ht_ec-recurringPaymentProfile-curl-etc/
thanks,
Dean

Change the IPN url on existing subscription

we plan to change the domain name for our service. Therefore we need to update the IPN-url for our existing customers. I have tried googling a solution on how to change the IPN-url for current subscriptions, but I haven't been able to find anything.
Any help is appreciated.
best regards
Thomas
I ran into this problem today.
Folks who are saying that you can change the IPN URL on an existing Paypal recurring payment are incorrect; you can't, you can only change the IPN URL for future notifications.
To resolve this, I used an Apache rewrite:
RewriteRule ^sites/all/modules/civicrm/extern/ipn.php$ https://example.org/wp-content/plugins/civicrm/civicrm/extern/ipn.php [R=307,L]
The magic is the R=307. A 307 redirect indicates that a POST request must be resent as a POST. Otherwise you lose the IPN data.
I had exactly the same problem .... I had to move servers which meant my IPN url changed.
I have spoken to 3 different paypal reps and even had a meeting with a tech support guy from there.
Unfortunately, there is NO WAY to change the IPN url for existing customers/subscriptions.
I have been advised that all existing customers/subscriptions would need to be setup again, your customers would then need to start a new subscription based on the new IPN url.
This is a right PITA ... I have just over 1500 customers I need to do this for, and I can guarantee I will lose some due to the hassle of this.
Sorry this wasn't the answer you were looking for :(
If you need to chnage IPN Url make sure that it is still turned on check from History>IPN History and turn it on.
IPN can be enabled in one of 2 ways.
In the PayPal account Profile
Passing an IPN URL as a parameter in an API call or button code.
To enable IPN in your account profile follow these steps:
Log into your account at https://www.paypal.com
Click on the Profile
subtab In "My selling tools" click Update in the Instant Payment Notifications section.
Click the Edit button or Choose IPN settings
Enter your IPN URL in the Notification URL field Make sure the radio button for 'Receive IPN messages (Enabled)' is selected
Click Save
IPN can be enabled directly in this section of the account: https://www.paypal.com/ie/cgi-bin/webscr?cmd=_profile-ipn-notify-edit (access requires login)
To pass an IPN URL as a code-level parameter you should refer to the documentation of the feature you are implementing. Typically the API variable you would pass is 'NotifyURL' but it can differ based on the API call, if the API is Name-Value-Pair (NVP) or SOAP format or if you are using non-hosted PayPal Standard button code. For standard buttons the variable is "notify_url".
This profile setting is frequently overridden by shopping carts. Still, IPN should be enabled in the account.
It's 1 May 2013 & PayPal has changed the location for the IPN.
Login, go to Profile -> My selling tools ->Instant Payment Notifications...(Update)
This shows your current IPN URL, and there is an EDIT button.
In the absence of a solution from Paypal, I would encourage anyone to submit a support ticket requesting a manual change. If enough of us do this, they will have to provide this option eventually.
Contact Paypal Technical Support here.
EDIT: I managed to successfully change all my prior IPN URLs via a ticket with Paypal Support. They told me it has to be done manually, but obliged my request. It took about a week. They were very helpful. Hope this helps someone.
Dec 2022 update:
There is IPN URL settings at https://www.paypal.com/merchantnotification/ipn/preference . I changed the IPN URL and since then all IPN notifications are coming to the new IPN URL. I do not know if super old subscription notifications will also come to this URL or not, but I can confirm that 1.5 year old subscriptions are going to this new URL now.
I have just done it.
Login, go to Profile -> My Account Settings ->Instant Payment Notifications...(Update)
This shows your current IPN URL, and there is an EDIT button, which works.
This is April 2013, so PayPal might have changed since this question was posted