Stripe causing double payments

Hello,

S2member is causing duplicate payments to be taken when using stripe. If the first payment fails, the amount is being stacked. See the screenshot here.

Isn’t that a stripe setting?

If it is, are you able to help me fix it?

Yeah - likely I was wrong about the settings. But make sure that subscriptions are cancelled after 4 unsuccessful payments within 1 month on smart retries and similar - under

Settings

[Billing]

Subscriptions and emails

Yes, that’s already set up.
I can’t see how it effects this scenario though.

I’ve seen this a few times too, but I couldn’t understand the reason behind the double payments as it didn’t happen every time. I think you’ve got it completely.
STRIPE needs a proper overhaul really soon as it’s turned into a very broken implementation, and it used to be so good. Hope this gets fixed sooner rather than later!

1 Like

Does anyone have an update on this? I am seeing this as well. It happens only about 1-2% of the time but it’s frustrating.

Further to this, I’ve just had a very upset customer on the phone who cancelled their stripe subscription back in January (monthly payments) but was still being charged. I see the original cancellation in Stripe and now I’ve cancelled it again… here is a screenshot from within Stripe. Understandably she was upset payments were still being taken!
image

Yep, I completely understand the customers response as well. I would be upset if a business did this to me. This seems to be an urgent issue. I know I see support in here from time to time but what is the status/future of this plugin?

This is happening to us too, and is a very critical issue. We just had a customer get charged 4x (!!), it looks like each retry results in another multiple of pricing. I would be incredibly upset if a business quadruple charged me. Please let us know the status of the fix for this.

Only fix I managed to find was downgrade to October release. Not had any issues since!

We are seeing multiple payment intent failures, with each one adding one more multiple until a success happens with a multiplied payment.

@CommonJuke - what do the Stripe logs show for the transaction sequence in your screenshot.

It would be interesting to see if this is a Stripe error, an S2Member error, or an error related to WordPress or another WordPress plugin. As a shortcode, it is possible that it is being called multiple times in a row and confusing the heck out of S2Member and Stripe.

They show invoice creation error, the payment fails and then the customer tries again. It doesn’t matter what payment they use as it is stripe that is keeping the amounts stacked, S2member just asks stripe to clear full balance on the account and not just the latest invoice.

Cheers James. I was looking for the actual log of the API calls & responses (with private info filtered of course). Your interpretation does not allow room for me to assist. From your screenshot it looks like the person lost patience and pressed the transaction button multiple times in a row. That may not be the case but that is what it looks like from your screenshot. I would need to see the logfile to verify or prove otherwise. Up to you :slight_smile:

Looks like there is no payment method attached to the first attempt, on second attempt the payment method is attached but both invoices are charged.

I noticed today that customers were being double charged even without the “invoice_failed”.

I diff’ed the requests and responses of a normal charge vs a double charge. The requests are essentially the same.

The responses are mainly different in that the double charge has two invoices, hence the double charge.

We are seeing about 2% of our transactions affected. We have (1) buy now, (2) subscription, and (3) subscription with trial period. Thus far, it as only affected our (3) subscription with trial period transactions.

@onepresstech Thanks for your help with this! Here are the redacted api logs for a double charge that happened without an invoice_failed:

Double Charge

POST /v1/subscriptions 
200 OK

Request parameters
{
  "customer": "cus_aaa",
  "items": {
    "0": {
      "plan": "s2_plan_bbb"
    }
  },
  "trial_from_plan": "true",
  "metadata": {
    "tax_info": "{"trial_tax":"0.00","trial_tax_per":"0%","tax":"0.00","tax_per":"0%"}"
  },
  "expand": {
    "0": "latest_invoice.payment_intent",
    "1": "pending_setup_intent"
  }
}


Response body
{
  "id": "sub_ccc",
  "object": "subscription",
  "customer": "cus_aaa",
  "items": {
    "object": "list",
    "data": [
      {
        "id": "si_ddd",
        "object": "subscription_item",
        "billing_thresholds": null,
        "created": 1585506607,
        "metadata": {
        },
        "plan": {
          "id": "s2_plan_bbb",
          "object": "plan",
          "active": true,
          "aggregate_usage": null,
          "amount": 6900,
          "amount_decimal": "6900",
          "billing_scheme": "per_unit",
          "created": 1585332440,
          "currency": "usd",
          "interval": "day",
          "interval_count": 31,
          "livemode": true,
          "metadata": {
            "recurring": "true",
            "recurring_times": "-1"
          },
          "nickname": null,
          "product": "s2_prod_eee",
          "tiers": null,
          "tiers_mode": null,
          "transform_usage": null,
          "trial_period_days": 31,
          "usage_type": "licensed"
        },
        "quantity": 1,
        "subscription": "sub_ccc",
        "tax_rates": [
        ]
      }
    ],
    "has_more": false,
    "total_count": 1,
    "url": "/v1/subscription_items?subscription=sub_ccc"
  },
  "livemode": true,
  "metadata": {
    "tax_info": "{"trial_tax":"0.00","trial_tax_per":"0%","tax":"0.00","tax_per":"0%"}"
  },
  "status": "trialing",
  "application_fee_percent": null,
  "billing": "charge_automatically",
  "billing_cycle_anchor": 1588185007,
  "billing_thresholds": null,
  "cancel_at": null,
  "cancel_at_period_end": false,
  "canceled_at": null,
  "collection_method": "charge_automatically",
  "created": 1585506607,
  "current_period_end": 1588185007,
  "current_period_start": 1585506607,
  "days_until_due": null,
  "default_payment_method": null,
  "default_source": null,
  "default_tax_rates": [
  ],
  "discount": null,
  "ended_at": null,
  "invoice_customer_balance_settings": {
    "consume_applied_balance_on_void": true
  },
  "latest_invoice": {
    "id": "in_fff",
    "object": "invoice",
    "account_country": "CA",
    "account_name": "Company Name",
    "amount_due": 33600,
    "amount_paid": 33600,
    "amount_remaining": 0,
    "application_fee_amount": null,
    "attempt_count": 1,
    "attempted": true,
    "auto_advance": false,
    "billing": "charge_automatically",
    "billing_reason": "subscription_create",
    "charge": "ch_ggg",
    "collection_method": "charge_automatically",
    "created": 1585506607,
    "currency": "usd",
    "custom_fields": null,
    "customer": "cus_aaa",
    "customer_address": null,
    "customer_email": "First.Last@gmail.com",
    "customer_name": "First Last",
    "customer_phone": null,
    "customer_shipping": null,
    "customer_tax_exempt": "none",
    "customer_tax_ids": [
    ],
    "default_payment_method": null,
    "default_source": null,
    "default_tax_rates": [
    ],
    "description": null,
    "discount": null,
    "due_date": null,
    "ending_balance": 0,
    "footer": null,
    "hosted_invoice_url": "https://pay.stripe.com/invoice/hhh",
    "invoice_pdf": "https://pay.stripe.com/invoice/hhh/pdf",
    "lines": {
      "object": "list",
      "data": [
        {
          "id": "ii_jjj",
          "object": "line_item",
          "amount": 16800,
          "currency": "usd",
          "description": "Initial period",
          "discountable": true,
          "invoice_item": "ii_jjj",
          "livemode": true,
          "metadata": {
          },
          "period": {
            "end": 1585506606,
            "start": 1585506606
          },
          "plan": null,
          "proration": false,
          "quantity": 1,
          "subscription": null,
          "tax_amounts": [
          ],
          "tax_rates": [
          ],
          "type": "invoiceitem",
          "unique_id": "il_kkk"
        },
        {
          "id": "ii_lll",
          "object": "line_item",
          "amount": 16800,
          "currency": "usd",
          "description": "Initial period",
          "discountable": true,
          "invoice_item": "ii_lll",
          "livemode": true,
          "metadata": {
          },
          "period": {
            "end": 1585503294,
            "start": 1585503294
          },
          "plan": null,
          "proration": false,
          "quantity": 1,
          "subscription": null,
          "tax_amounts": [
          ],
          "tax_rates": [
          ],
          "type": "invoiceitem",
          "unique_id": "il_mmm"
        },
        {
          "id": "sli_nnn",
          "object": "line_item",
          "amount": 0,
          "currency": "usd",
          "description": "Trial period for Company Name Product Name",
          "discountable": true,
          "livemode": true,
          "metadata": {
            "tax_info": "{"trial_tax":"0.00","trial_tax_per":"0%","tax":"0.00","tax_per":"0%"}"
          },
          "period": {
            "end": 1588185007,
            "start": 1585506607
          },
          "plan": {
            "id": "s2_plan_bbb",
            "object": "plan",
            "active": true,
            "aggregate_usage": null,
            "amount": 6900,
            "amount_decimal": "6900",
            "billing_scheme": "per_unit",
            "created": 1585332440,
            "currency": "usd",
            "interval": "day",
            "interval_count": 31,
            "livemode": true,
            "metadata": {
              "recurring": "true",
              "recurring_times": "-1"
            },
            "nickname": null,
            "product": "s2_prod_eee",
            "tiers": null,
            "tiers_mode": null,
            "transform_usage": null,
            "trial_period_days": 31,
            "usage_type": "licensed"
          },
          "proration": false,
          "quantity": 1,
          "subscription": "sub_ccc",
          "subscription_item": "si_ddd",
          "tax_amounts": [
          ],
          "tax_rates": [
          ],
          "type": "subscription",
          "unique_id": "il_nnn"
        }
      ],
      "has_more": false,
      "total_count": 3,
      "url": "/v1/invoices/in_fff/lines"
    },
    "livemode": true,
    "metadata": {
    },
    "next_payment_attempt": null,
    "number": "ooo",
    "paid": true,
    "payment_intent": {
      "id": "pi_ppp",
      "object": "payment_intent",
      "amount": 33600,
      "amount_capturable": 0,
      "amount_received": 33600,
      "application": null,
      "application_fee_amount": null,
      "canceled_at": null,
      "cancellation_reason": null,
      "capture_method": "automatic",
      "charges": {
        "object": "list",
        "data": [
          {
            "id": "ch_ggg",
            "object": "charge",
            "amount": 33600,
            "amount_refunded": 0,
            "application": null,
            "application_fee": null,
            "application_fee_amount": null,
            "balance_transaction": "txn_1GS5tdHVo8mfgqAM1lLUcQ8Y",
            "billing_details": {
              "address": {
                "city": null,
                "country": null,
                "line1": null,
                "line2": null,
                "postal_code": "10304",
                "state": null
              },
              "email": "First.Last@gmail.com",
              "name": "First Last",
              "phone": null
            },
            "captured": true,
            "created": 1585506607,
            "currency": "usd",
            "customer": "cus_aaa",
            "description": "Subscription creation",
            "destination": null,
            "dispute": null,
            "disputed": false,
            "failure_code": null,
            "failure_message": null,
            "fraud_details": {
            },
            "invoice": "in_fff",
            "livemode": true,
            "metadata": {
            },
            "on_behalf_of": null,
            "order": null,
            "outcome": {
              "network_status": "approved_by_network",
              "reason": null,
              "risk_level": "normal",
              "seller_message": "Payment complete.",
              "type": "authorized"
            },
            "paid": true,
            "payment_intent": "pi_ppp",
            "payment_method": "pm_rrr",
            "payment_method_details": {
              "card": {
                "brand": "Credit Card",
                "checks": {
                  "address_line1_check": null,
                  "address_postal_code_check": "pass",
                  "cvc_check": "pass"
                },
                "country": "US",
                "exp_month": 9,
                "exp_year": 2099,
                "fingerprint": "uuu",
                "funding": "debit",
                "installments": null,
                "last4": "9999",
                "network": "Credit Card",
                "three_d_secure": null,
                "wallet": null
              },
              "type": "card"
            },
            "receipt_email": "First.Last@gmail.com",
            "receipt_number": "2972-9843",
            "receipt_url": "https://pay.stripe.com/receipts/acct_ttt",
            "refunded": false,
            "refunds": {
              "object": "list",
              "data": [
              ],
              "has_more": false,
              "total_count": 0,
              "url": "/v1/charges/ch_ggg/refunds"
            },
            "review": null,
            "shipping": null,
            "source": null,
            "source_transfer": null,
            "statement_descriptor": null,
            "statement_descriptor_suffix": null,
            "status": "succeeded",
            "transfer_data": null,
            "transfer_group": null
          }
        ],
        "has_more": false,
        "total_count": 1,
        "url": "/v1/charges?payment_intent=pi_ppp"
      },
      "client_secret": "pi_ppp_secret_qqq",
      "confirmation_method": "automatic",
      "created": 1585506607,
      "currency": "usd",
      "customer": "cus_aaa",
      "description": "Subscription creation",
      "invoice": "in_fff",
      "last_payment_error": null,
      "livemode": true,
      "metadata": {
      },
      "next_action": null,
      "on_behalf_of": null,
      "payment_method": "pm_rrr",
      "payment_method_options": {
        "card": {
          "installments": null,
          "request_three_d_secure": "automatic"
        }
      },
      "payment_method_types": [
        "card"
      ],
      "receipt_email": null,
      "review": null,
      "setup_future_usage": "off_session",
      "shipping": null,
      "source": null,
      "statement_descriptor": null,
      "statement_descriptor_suffix": null,
      "status": "succeeded",
      "transfer_data": null,
      "transfer_group": null
    },
    "period_end": 1585506607,
    "period_start": 1585506607,
    "post_payment_credit_notes_amount": 0,
    "pre_payment_credit_notes_amount": 0,
    "receipt_number": "2972-9843",
    "starting_balance": 0,
    "statement_descriptor": null,
    "status": "paid",
    "status_transitions": {
      "finalized_at": 1585506607,
      "marked_uncollectible_at": null,
      "paid_at": 1585506609,
      "voided_at": null
    },
    "subscription": "sub_ccc",
    "subtotal": 33600,
    "tax": null,
    "tax_percent": null,
    "total": 33600,
    "total_tax_amounts": [
    ],
    "webhooks_delivered_at": null
  },
  "next_pending_invoice_item_invoice": null,
  "pause_collection": null,
  "pending_invoice_item_interval": null,
  "pending_setup_intent": null,
  "pending_update": null,
  "plan": {
    "id": "s2_plan_bbb",
    "object": "plan",
    "active": true,
    "aggregate_usage": null,
    "amount": 6900,
    "amount_decimal": "6900",
    "billing_scheme": "per_unit",
    "created": 1585332440,
    "currency": "usd",
    "interval": "day",
    "interval_count": 31,
    "livemode": true,
    "metadata": {
      "recurring": "true",
      "recurring_times": "-1"
    },
    "nickname": null,
    "product": "s2_prod_eee",
    "tiers": null,
    "tiers_mode": null,
    "transform_usage": null,
    "trial_period_days": 31,
    "usage_type": "licensed"
  },
  "quantity": 1,
  "schedule": null,
  "start": 1585506607,
  "start_date": 1585506607,
  "tax_percent": null,
  "trial_end": 1588185007,
  "trial_start": 1585506607
}

@CommonJuke - this is the request / response log for only 1 of the 4 sequential transactions that you show in your screenshot above. I don’t see any issue with this request / response. I believe the issue is that the server is sending 4 requests in a row…the question is who and why. I need to see all 4 sequential transactions to try to guess who is causing the issue.

NOTE: You have some partial credit card details in the log…set the CVC and last 4 digits to 1111 to obscure and indicate they are obscured.