PayPal: Dynamically Setting the Notification URL

Hi,

is there a way to set the Notification URL dynamically with PayPal Pro Forms?

I have to different Websites / Domains and i want to enable PayPal Payments but handle both domains with the same paypal business account. But i need PayPal to send the payment notification to the website where the customer started the checkout process. If i set the IPN fixed in my PayPal account the notification is always send to this Domain.

Obviously it is possible with PayPal to send the Notification URL dynamically: https://developer.paypal.com/docs/ipn/integration-guide/IPNSetup/#setting-up-ipn-notifications-on-paypal

How to do it with s2member? I know i can pass the return-URL in the button shortcode with “success” attribute. What to use for the notification url?

1 Like

Hi,
I am also interested to solve this problem because I will soon have several sites using s2Member and PayPal to be manage on the same PayPal account…
Thank you in advance for your answer.
Best regards.

Hi,
Would it be possible to have an answer to this question please?
Best regards.

s2Member sets the IPN URL on a transaction basis for PayPal Standard, but not for the Pro integration. See: WP Admin > s2Member Pro > PayPal Options > IPN > More Info

Quick Tip: In addition to the default IPN settings inside your PayPal account, the IPN URL is also set on a per-transaction basis by the special PayPal Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal account, that’s OK. s2Member dynamically sets the IPN URL for each transaction. The result is that the IPN URL configured from within your PayPal account, becomes the default, which is then overwritten on a per-transaction basis. In fact, PayPal recently updated their system to support IPN URL preservation. One PayPal account can handle multiple sites, all using different IPN URLs.

NOT True w/ PayPal Pro: With PayPal Pro integration you absolutely must set an IPN URL inside your PayPal account. PayPal Pro integration does not allow the IPN location to be overridden on a per-transaction basis. If you’re using a single PayPal Pro account for multiple cross-domain installations, and you need to receive IPN notifications for each of your domains; you’ll want to create a central IPN processing script that scans variables in each IPN response, forking itself out to each of your individual domains. In rare cases when this is necessary, you’ll find two variables in all IPN responses for s2Member. The originating domain name (i.e., yourdomain.com ) will always be included somewhere within, either: custom and/or rp_invoice_id ; depending on the type of transaction. These variables can be used to test incoming IPNs, and fork to the proper installation. For your convenience, an example script has been provided inside: /s2m-pro-extras/paypal-central-ipn.php . You can download all Extras here: s2m-pro-extras.zip.

I hope that helps! :slight_smile:

2 Likes

Hi,
Thanks for this answer.
Could you tell me if s2Member dynamically sets the IPN URL for each transaction when I use Pro-Forms with PayPal Standard like explain in this thread: LINK?
Or it works only for PayPal free buttons…?
Best regards.

My understanding is that it sets it dynamically when using PayPal Standard buttons integration. The s2 pro-form integrates with PayPal’s Express Checkout, but not the Standard buttons.

I’d would have to do some testing and review the logs and study the source code to confirm it, but from the documentation Jason left, it seems that the pro-form integration doesn’t set the IPN URL dynamically.

1 Like

I dug into the code a bit, and it does seem that the IPN URL is set dynamically only for the PayPal button, not the pro-form.

Jason’s documentation does leave one unsure when he talks about this, as quoted in my reply above, because he’s talking about PayPal buttons agains PayPal Pro… But Express Checkout is not PayPal Pro, nor is it a button… When he says Pro, he does seem to be referring to the pro-form, which was created for the PayPal Pro integration, and also supports Express Checkout.

Here’s a reply he left in the old forums some time ago:

The central IPN handler works as a proxy for other installations of s2Member that you run, across multiple sites/domains perhaps. So you setup the central IPN handler in any location you prefer. Then, set the default IPN URL in your PayPal account, to that central location; you’re good to go.

Of course, it’s not always just that simple :slight_smile: For example, in the case of PayPal Standard Buttons, the IPN URL is set on a per-Button basis, so the concept of a central IPN handler will only work if you are running PayPal Pro; where all of your sites are using s2Member Pro Forms; instead of standard PayPal Buttons.

Then again, if you’re running PayPal Standard Buttons, you really don’t need a central IPN handler. Simply because the IPN URL is, and can be, set on a per-Button basis. Thus, there’s no need to have a central IPN handler.

There are additional/detailed instructions on how to set this up, located at the top of the central IPN example file; available in your account here at s2Member.com. Download the /s2m-pro-extras.zip file, and inside the ZIP you’ll find the example PHP script.

Still doesn’t mention Express Checkout, but he does compare the buttons with the pro-forms (“your sites are using s2Member Pro Forms; instead of standard PayPal Buttons”), rather than with just PayPal Pro.

1 Like

Hi,

Thanks a lot for this answer and the time you spent looking for it :slight_smile:

Best regards, Brice.