Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe s2Member Pro Plugin returning card_declined in live mode

I am using the s2Member Pro plugin with a Wordpress installation to accept subscription payments.

Throughout all testing the Stripe plugin worked every time and when I switched it to live mode my card worked as well so I assumed everything was fine, however now I am seeing that most cards are getting a card_declined error returned when they submit the form for payment.

Users fill out the form with first,last,email,password,username and then when the users click 'add payment' the Stripe checkout overlay pops up, I enter the card details the stripe plugin accepts them with a green tick but when I hit submit I see the error.

The site is https://naturalbusinesstools.com/pricing and it has all the correct SSL setup and all the Stripe account details, web hooks and verifications are correct [as I mentioned its only certain cards, particular those from the Commonwealth Bank]. I should also mention that regardless of payment success/failure the customer is created in the Stripe account.

Is there some layer of security that would be stopping these from going through?

*** UPDATE Ok so theres been a development. I have tried 4 separate personal credit cards [friends and families] and they all worked perfectly. Then I tried a couple of business credit/debit cards and they all failed....

So it looks like s2 or stripe is failing Business card transactions... is this a common problem?

*** UPDATE

Ok so there has been a big development with this issue. i finally got onto the s2 member pro plugin creator and he had this to say:

"So I reproduced this behavior on your site, and I traced it back to a card update that takes place within s2Member. Upon final submission, s2Member adds the customer's name, address_zip, address_state, and address_country right after the card (aka: source) is added to your Stripe customer.

The card_declined error that you're seeing is from the Stripe API, and it's returning a card_declined error whenever s2Member attempts to update the card with those basic details. I suspect this is a bug in the Stripe API, but I wanted to post the information here first, just in case any of this might give you some of idea of why this particular update might fail.

Armed with the knowledge of which Stripe API call resulted in a card_declined error from Stripe, I then setup a test page on your site where I ran back through the update calls and attempted to update one piece of information at a time. I was able to update the name, address_state, and address_zip without issue. However, on this particular card whenever I attempt to update address_country to a value of AU the Stripe API says, card_declined for some reason."

Referencing unexpected API response failure from Stripe in their PHP SDK:

                [file] => .../wp-content/plugins/s2member-pro/includes/classes/gateways/stripe/stripe-sdk/lib/Stripe/ApiRequestor.php
                [line] => 109
                [function] => _interpretResponse
                [class] => Stripe_ApiRequestor
                [type] => ->
                [args] => Array
                    (
                        [0] => {
"error": {
"message": "Your card was declined.",
"type": "card_error",
"param": "",
"code": "card_declined"
}

So it turns out it is a bug in the Stripe API. Not sure if anyone has a workaround?

like image 509
Roksalt Avatar asked Jul 15 '15 02:07

Roksalt


1 Answers

SHORT TERM WORKAROUND

Find this line of code in your copy of s2Member Pro: https://github.com/websharks/s2member-pro/blob/000000-dev/s2member-pro/includes/classes/gateways/stripe/stripe-utilities.inc.php#L166 File: s2member-pro/includes/classes/gateways/stripe/stripe-utilities.inc.php

Change:

$source->save();

To:

// $source->save();

That will prevent the additional update from taking place. It's only there for tax reporting purposes anyway, and that should resolve the issue in the short-term until we can get to the bottom of this.

like image 109
Roksalt Avatar answered Sep 30 '22 03:09

Roksalt