Stripe iframe not loading after applying coupon

Dear s2member community and support,

I recently configured the Stripe payment gateway for s2member, and was able to successfully run a test purchase in Developer mode using Stripe Pro Form. However, when I apply a coupon code, after the page reloads (when hitting the Apply button, which is normal), the “Billing” section that shows the Stripe iframe with credit card info does not display (or seem to load). The coupon for s2member works, and the prices changes as expected, but the Stripe billing section of the form does not load when the coupon is applied.

Is anyone else having this issue? What do you recommend the solution is?

Here’s my Stripe Pro Form shortcode:
[s2Member-Pro-Stripe-Form level=“1” ccaps=“mycustom_ccaps” desc=“Sample Product Description” cc=“USD” custom=“mywebsitedomain.com” ta=“0” tp=“0” tt=“D” ra=“100” rp=“1” rt=“L” rr=“0” rrt="" coupon="" accept_coupons=“1” default_country_code="" captcha=“0” success="/thank-you/?item_number=%%item_number%%&regular=%%regular%%" /]

Any help is appreciated!

On another note, are there any plans on integrating s2member with Stripe using the API in the s2member backend and NOT using an iframe? The iframe integration with Stripe is not an elegant solution, and restricts form style and logic customizations that I would like to implement.

Hi Mario.

integrating s2member with Stripe using the API in the s2member backend and NOT using an iframe?

Do you mean the row with the card fields? It’s handling the payment details on Stripe’s end without taking the customer off-site. Using this approach is what Stripe is recommending. https://stripe.com/docs/stripe-js

I may look at other ways of doing it, but not immediately. At some point in the future I plan to rebuild all the gateway integrations, and maybe then I would consider a different approach for this.

It’s stylable, but through the JS… https://stripe.com/docs/js/appendix/style

Is anyone else having this issue? What do you recommend the solution is?

That’s an interesting behavior… I haven’t had that experience myself or seen someone mention it before you either. Hmm… I’ll see if I can reproduce it.

Did you test deactivating other plugins or changing the theme to see if the problem goes away? Maybe one of those is introducing the problem.

I look forward to your update :slight_smile:

Hi Cristián, thank you for your reply!

I figured out the cause of my issue with the coupon code removing the stripe credit card input fields after being applied. The cause of the issue was that I had set the product price to 50 cents, and with a couple code applied, the cost came to 1 cent. This cost seems too small for Stripe to work properly.

Once I changed the price to $100, applying a couple code that made the final price $1 did not have any negative affect on the Stripe credit card fields.

During testing, I noticed that if the price is less than 50 cents, s2member will show an error; however if the coupon code brings the price below 50 cents, there is no error shown, only Stripe credit card fields get removed. It may be worthwhile adding a graceful error message in this use case.

TLDR; product price below 50 cents results in Stripe credit card fields not showing. Make sure price is 50 cents or greater AFTER coupon code is applied.

Ah! Nice catch! That’s right, Stripe’s minimum is 50 cents.

Well done figuring out that that’s what was happening in you case.

Thank you for the update! Mystery solved. :slight_smile: