Stripe connect v3 error when a card is declined - hanging on card details page

  • Posts: 44
  • Thank you received: 0
  • Hikamarket Multivendor Hikashop Business
3 years 10 months ago #319508

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.18
-- PHP version -- : 7.2.31
-- Browser(s) name and version -- : Chrome - Version 81.0.4044.138 (Official Build) (64-bit)
-- Error-message(debug-mod must be tuned on) -- : There is no php error being reported

Hi,

I'm experiencing a problem with the Stripe connect payment method when a card is declined. When a card payment is declined the site hangs on the card details page of the checkout with a spinner spinning rather than either displaying an error message or redirecting another page.

When turning on debug mode and error reporting I'm not seeing any errors, however when checking in the apache logs I can see the following:

500 Error - POST /index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=stripeconnect&tmpl=component&order_id=5421&lang=en&2eb9e6a7532e2863a95b557aef520bff=1 HTTP/1.0	https://shop.xxx.org/orders/order/pay/order_id-5421	Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36	1.15 K	Apache SSL/TLS access
And also see the following via the browser developer console:
POST https://shop.xxx.org/index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=stripeconnect&tmpl=component&order_id=5421&lang=en&2eb9e6a7532e2863a95b557aef520bff=1 500
(anonymous) @ VM665:1
xRequest @ hikashop.js?v=430:217
_notifyPaymentMethod @ stripeconnect.js?v=1-0-4:214
(anonymous) @ stripeconnect.js?v=1-0-4:166
Promise.then (async)
_handlePaymentMethod @ stripeconnect.js?v=1-0-4:141
(anonymous) @ stripeconnect.js?v=1-0-4:81
stripeconnect.js?v=1-0-4:178 Uncaught TypeError: Cannot read property 'error' of null
    at Object._handleNotifyResponse (stripeconnect.js?v=1-0-4:178)
    at stripeconnect.js?v=1-0-4:215
    at XMLHttpRequest.xhr.onreadystatechange (hikashop.js?v=430:206)
_handleNotifyResponse @ stripeconnect.js?v=1-0-4:178
(anonymous) @ stripeconnect.js?v=1-0-4:215
xhr.onreadystatechange @ hikashop.js?v=430:206
XMLHttpRequest.send (async)
(anonymous) @ VM665:1
xRequest @ hikashop.js?v=430:217
_notifyPaymentMethod @ stripeconnect.js?v=1-0-4:214
(anonymous) @ stripeconnect.js?v=1-0-4:166
Promise.then (async)
_handlePaymentMethod @ stripeconnect.js?v=1-0-4:141
(anonymous) @ stripeconnect.js?v=1-0-4:81

Any help would be greatly appreciated

Thanks

KH

Last edit: 3 years 10 months ago by vividfish.

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
3 years 10 months ago #319510

Hello,

In the "stripeconnect.php" file, please replace the line

$intent->confirm();
if($intent->status == 'succeeded') {
By
$ret = $this->api->confirmPaymentIntent($intent);
if($ret === true && $intent->status == 'succeeded') {
It should handle the error thrown by the Stripe SDK.

If the problem persist, it would require to get the content of the POST call which returned a 500 error.
I do think that the problem is related to an Exception which is not catch by the plugin ; which would explain why you have nothing in the error log. But the error should be displayed by the Joomla core in the returned page.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 0
  • Hikamarket Multivendor Hikashop Business
3 years 10 months ago #319571

Hi Jerome,

Thanks for your reply. Unfortunately this hasn't had any effect.

When you say you'd need to see the content of the POST call which returned the 500 error, would the below be what you mean?

{
  "id": "pi_1GkzsQBaliC5Ig8csGMS3qeQ",
  "object": "payment_intent",
  "last_payment_error": null,
  "livemode": true,
  "next_action": null,
  "status": "canceled",
  "amount": 5065,
  "amount_capturable": 0,
  "amount_received": 0,
  "application": null,
  "application_fee_amount": null,
  "canceled_at": 1590011916,
  "cancellation_reason": null,
  "capture_method": "automatic",
  "charges": {
    "object": "list",
    "data": [
      {
        "id": "ch_1GkzsRBaliC5Ig8cfsS53JGO",
        "object": "charge",
        "amount": 5065,
        "amount_refunded": 0,
        "application": null,
        "application_fee": null,
        "application_fee_amount": null,
        "balance_transaction": null,
        "billing_details": {
          "address": {
            "city": "test",
            "country": "UG",
            "line1": "test",
            "line2": null,
            "postal_code": "65456",
            "state": "Adjumani"
          },
          "email": "xxx@xxx.net",
          "name": "test test",
          "phone": null
        },
        "calculated_statement_descriptor": "xxx xxxxx xxx",
        "captured": false,
        "created": 1590011703,
        "currency": "gbp",
        "customer": null,
        "description": null,
        "destination": null,
        "dispute": null,
        "disputed": false,
        "failure_code": "incorrect_number",
        "failure_message": "Your card number is incorrect.",
        "fraud_details": {
        },
        "invoice": null,
        "livemode": true,
        "metadata": {
        },
        "on_behalf_of": null,
        "order": null,
        "outcome": {
          "network_status": "declined_by_network",
          "reason": "incorrect_number",
          "risk_level": "normal",
          "seller_message": "The bank returned the decline code `incorrect_number`.",
          "type": "issuer_declined"
        },
        "paid": false,
        "payment_intent": "pi_1GkzsQBaliC5Ig8csGMS3qeQ",
        "payment_method": "pm_1GkzsPBaliC5Ig8cECOdz3KV",
        "payment_method_details": {
          "card": {
            "brand": "mastercard",
            "checks": {
              "address_line1_check": "unavailable",
              "address_postal_code_check": "unavailable",
              "cvc_check": "unavailable"
            },
            "country": "US",
            "exp_month": 12,
            "exp_year": 2021,
            "fingerprint": "ZADg8yR0fJo7HKhs",
            "funding": "credit",
            "installments": null,
            "last4": "7654",
            "network": "mastercard",
            "three_d_secure": null,
            "wallet": null
          },
          "type": "card"
        },
        "receipt_email": null,
        "receipt_number": null,
        "receipt_url": null,
        "refunded": false,
        "refunds": {
          "object": "list",
          "data": [
          ],
          "has_more": false,
          "total_count": 0,
          "url": "/v1/charges/ch_1GkzsRBaliC5Ig8cfsS53JGO/refunds"
        },
        "review": null,
        "shipping": null,
        "source": null,
        "source_transfer": null,
        "statement_descriptor": null,
        "statement_descriptor_suffix": null,
        "status": "failed",
        "transfer_data": null,
        "transfer_group": null
      }
    ],
    "has_more": false,
    "total_count": 1,
    "url": "/v1/charges?payment_intent=pi_1GkzsQBaliC5Ig8csGMS3qeQ"
  },
  "client_secret": "pi_1GkzsQBaliC5Ig8csGMS3qeQ_secret_fQ1DRR8XVw68nLtCb1cK6laK5",
  "confirmation_method": "manual",
  "created": 1590011702,
  "currency": "gbp",
  "customer": null,
  "description": null,
  "invoice": null,
  "metadata": {
  },
  "on_behalf_of": null,
  "payment_method": null,
  "payment_method_options": {
    "card": {
      "installments": null,
      "request_three_d_secure": "automatic"
    }
  },
  "payment_method_types": [
    "card"
  ],
  "receipt_email": null,
  "review": null,
  "setup_future_usage": null,
  "shipping": null,
  "source": null,
  "statement_descriptor": null,
  "statement_descriptor_suffix": null,
  "transfer_data": null,
  "transfer_group": null
}

Thanks

KH

Last edit: 3 years 10 months ago by vividfish.

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
3 years 10 months ago #319585

Hello,

That data is interesting but we need to know what your website replied for the 500 error page.
In the browser console (developper tools => ctrl+shit+i ), you have a "network" tab which should allow you to see what was the 500 page content.
In that page we could have more details about the error which need to be fix.
If the page do not provide enough details, activating temporally the Joomla debug mode will help.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 2
3 years 10 months ago #319791

This problem has also been reported by many of our customers. I managed to reproduce it on Firefox but it's not happening on Chrome it seems.

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
3 years 10 months ago #319827

Hello,

I used a test website with the Stripe Connect plugin configured with a test account (so not in production).
Via the Stripe Test cards, I tried several cards for different errors : stripe.com/docs/testing
The tests did not generate a 500 error page in the website, the calls were correctly handled by the API and returned an error to the customer.

I do understand that the error can happen to several customers but I do not have enough information to be able to see the problem directly or reproduce it in my local website.
I really need to have details about the error or a way to see/reproduce it.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 2
3 years 10 months ago #319855

We don't get a 500 error, the only error we see is a warning about the samesite cookie attribute not being set correctly for Stripe.

We are using the newest version of the Stripe Connect plugin, but it calls an old version of the Stripe API. Could it be that the old Stripe API is not configuring the cookie correctly and this is causing problems?

I can see that Firefox has enforced the use of "secure" for "samesite:none", but Chrome still tolerates that it isn't set according to the new standards. That might explain why we only get reports from users on Firefox. I tried to replicate the issue, and it also only succeeded on Firefox, not Chrome. The warning is displayed during checkout on www.earmaster.com/shop.html

Please Log in or Create an account to join the conversation.

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
3 years 10 months ago #319857

Hello,

If you do not have the same issue than the first post of that thread ; please open a new one since it's a different problem and it will create more confusion than helping to solve the two different questions.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.083 seconds
Powered by Kunena Forum