A client of mine wanted to streamline his retreat registration system. These retreat events can be over $1,000, and letting people pay in thirds plus a small fee increases the number of people who are able to attend. Installment payments is the way to go.

I wanted to avoid adding any additional SASS products or services my client would need to sign up for, such as the option to integrate PayFlexi. Finally I came across a great snippet of code from Gravity Forms that allows me to set up subscription products to act as a system for installment payments*

In order to accomplish this, there are a couple of extra premium plug-ins that can help. GP Conditional Pricing and Gravitywiz make it so that when a user clicks the product field that asks about installments, the cost of that product is changed so that it’s now the total cost is a third of what it would be were you to pay in full..

So for folks that pay up front, the display looks like:

but if they click yes, then the price of the product option is reduced, $49/3 is added to the total and a conditional note is displayed that the total is the recurring total.

Stripe has the option to charge an upfront setup fee, which you can configure on the Strip feed settings page, but I thought it was better to build this into the recurring payment amount.

I also needed to set up a different Stripe feed for the installment payment option (subscription), which only activates when the installment payment option is selected. To avoid double charges, you need to set up the paid in full stripe feed to also only process conditionally. Otherwise, you will double bill the customer.

Fix Stripe subscription renewal failures by whitelisting

The subscriptions were getting set up correctly within Stripe. But then upon renewal, the draft invoice was created but wasn’t automatically charged as it should. This drove me crazy, since there were not any errors in the logs available in the Stripe dashboard about Webhooks not going through correctly.

I contacted gravity forms tech support, but they were unable to help me. All they said was

“Gravity Forms doesn’t have any involvement after sending the request to start the subscription. Stripe does send webhooks to your site but they are only used to update the entry with the subscription status (active, cancelled etc). and to add notes when they report capturing the payments.”

Basic WP debugging 1010 says to eliminate all variables, so I disabled all the other plug-ins, deactivated Cloudflare and went to dinner. After some time the test subscriptions for which the draft invoices previously failed finally did go auto charge. My best guess was that the iThemes Security plug-in was blocking some webhook events.

So I found the full list of Stripe IP addresses that webhook notifications may come from, and added those to the iThemes Authorized Hosts list under Security>Configure>Global Setitngs>Authorized Hosts

After re-enabling the iThemes Security plugin and whitelisting the Stripe webhook IP addresses, I’m happy to say it worked.


Notes:

*there’s also a plugin that accomplishes the same as the code snippet, but I didn’t find it to work at this point, since it’s 3 years since it was last updated. https://wordpress.org/plugins/installments-for-stripe-gf/

Leave a Reply

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

Post comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.