Payments Logging in Stripe from Two Sites

Note: It is always recommended that each WPSP installation be connected to its own Stripe account

Issue

I am highlighting a specific issue with a specific user. The site URLs will obviously differ for different cases, but it helps illustrate the point of seeing specific URLs.

They use WPSP on two websites, walklistencreate.org and Placecloud.io.
I only turned on WPSP for Placecloud about 10 days ago.

Since the beginning of April, all subscription payments on walklistencreate.org have *also* been logged on Placecloud.io.

It’s as if the callback is triggered on both websites.

The user is the same Stripe account between the two websites placecloud.io and walklistencreate.org.

Please note that Stripe states separate Stripe accounts should be used for separate projects/websites/businesses: https://stripe.com/docs/account/multiple-accounts — it is highly recommended to use separate accounts to avoid issues like what you are currently seeing with the mixed transaction records.

To use the same Stripe account for multiple WP Simple Pay installations on multiple domains, you must add a custom code snippet and modify the webhook endpoints in your account to prevent the other website’s transactions from being recorded.

You’ll need to use the following gist that has a snippet for each site in question:
https://gist.github.com/spencerfinnell/8d2e53cf9ea9e1212dd380909ccf78b0

You’ll include the site-a snippet on one site and the site-b snippet on the other.

 

Then, you’ll need to update the webhooks in the Stripe dashboard and append ?site=site-a and ?site=site-b to the respective endpoints.

This allows one site to skip the events of the other. If you are unfamiliar with adding custom code snippets, you can read more here: https://wpsimplepay.com/doc/adding-custom-code/

Leave a Reply

Your email address will not be published. Required fields are marked *