Stripe subscription billing modification logic error

I have found what might be a bug in the Stripe subscription or Stripe billing modification logic. I have created a test subscription that renews daily for testing. Daily billing worked correctly. I then used the billing modification pro-form to change the credit card. I can see in the Stripe admin panel that the customer’s default payment method was changed to the new credit card, but daily billing continued to charge the original credit card. That’s not the behavior I expected. I expected the daily billing to begin to use the new credit card.

I noticed in the Stripe admin panel in the description detail for the subscription that Billing method = “Charge specific payment method” and Payment method = the last 4 digits of the original credit card, not the new credit card.

I believe the solution is either 1) modify the billing modification logic to include updating the subscription’s payment method, or 2) modify the logic that originally creates the subscription to set the billing method to the default invoice payment method (see below). I am happy to test any fix to this problem.

Below is the subscription request post that originally created the subscription I am testing. Notice the default payment method is set to a specific payment method on file (the original credit card).

Subscriptions API
Request POST body

“customer”: “cus_NbaRNcLyEramnt”,
“metadata”: {
“tax_info”: “{“tax”:“0.00”,“tax_per”:“0%”}”
“default_payment_method”: “pm_1MqRVbCylVvE4X8BjRvajv6Q”,
“trial_from_plan”: “true”,
“items”: {
“0”: {
“plan”: “s2_plan_109a1d79eec04d7968414c299bdab416”
“expand”: {
“0”: “latest_invoice.payment_intent”,
“1”: “pending_setup_intent”

Below are citations from the Stripe subscriptions API documentation. It suggests that if you want the subscription to use the default payment method you should not include default payment method in the subscriptions request post.

default_payment_method - optional
ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer’s invoice_settings.default_payment_method or default_source.

ID of a payment method that’s attached to the customer, to be used as the customer’s default payment method for subscriptions and invoices.

Note: I see in the S2member billing modification request posts and responses that the invoice_settings.default_payment_method is set to the new credit card by the billing modification pro-form logic.

ID of the default payment source for the customer.
If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

We have encountered this issue as well, and worked with Stripe to identify it was something in the way the subscriptions are being setup by S2Member.

We’ve been having to manually go through all Failed transactions and hunt to see if the member updated their card, update the default on file and manually re-run the transactions.

It’s been most annoying for our staff.

I have not seen any thing on our end that we can adjust in the Stripe Pro Form short code to change this behavior.

We do hope that S2Member can correct this, and perhaps provide guidance on how to do a bulk adjustment to all our existing subscriptions.

  • Chris
    (S2Member customer since 2014).

I understand from Cristián Lávaque the fix for this is in v230504.


Right, v230504 addresses this. Let me know how it works for you. :slight_smile:

We do hope that S2Member can correct this, and perhaps provide guidance on how to do a bulk adjustment to all our existing subscriptions.

A bulk updater would be trickier… I’ll see what I can do.

Are you only selling the subscription, or also getting some buy-now (single) payments?

BTW, my testing has confirmed that the following v230504 fix corrects this issue.

  • (Pro) Fix : Stripe subscriptions weren’t using customer cards updated with the Billing Update pro-form. The subscription saved the first card, instead of defaulting to the card in the customer’s profile. This release fixes that. The card is not added to a new subscription anymore, only to the customer’s profile, and updating his profile’s card with the Billing Update pro-form, will also update the subscription so it uses it. Thanks to Jim Antonucci for his help with this.