• Resolved dewdrop99

    (@dewdrop99)


    Hello,

    I am using Payment Plugins for Stripe WooCommerce with MB WAY enabled through Universal Payment Method (UPM).

    When the customer approves the MB WAY payment, everything works correctly.

    However, when the customer cancels/rejects the payment in the MB WAY app, the checkout returns this frontend error:

    Cannot read properties of null (reading 'type')

    From Stripe/webhook logs, the flow appears to be normal for a rejected payment. For example:

    2026-04-06T21:42:19+00:00 Webhook notification received: Event: payment_intent.requires_action
    2026-04-06T21:42:33+00:00 Webhook notification received: Event: charge.failed

    It looks like the payment is correctly marked as failed when the customer cancels it, but the checkout frontend does not handle that state properly and throws the JavaScript error instead of showing a normal payment failure message.

    Could you please confirm whether this is a known issue with MB WAY via UPM, especially on the WooCommerce checkout blocks, and whether there is any recommended fix or workaround?

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Clayton R

    (@mrclayton)

    Hi @dewdrop99

    Thank you for contacting Payment Plugins. I’m not aware of this specific issue but I’ve notified the team to perform some testing to try and replicate.

    Once I’ve received an update I will update this thread with more details.

    Kind Regards

    Plugin Author Clayton R

    (@mrclayton)

    Hi @dewdrop99

    Are you able to replicate the error and provide the Javascript error stack? It would be helpful to see the exact section of code where that error is being triggered.

    Kind Regards

    Thread Starter dewdrop99

    (@dewdrop99)

    Hello,

    Yes, I was able to reproduce it and capture the JavaScript stack.

    The error is triggered here:

    const { payment_method } = result.paymentIntent;
    
    if (['promptpay', 'swish', 'paynow', 'cashapp'].includes(payment_method.type)) {

    The problem is that, after cancelling the MB WAY payment in the app, the returned PaymentIntent has:

    "status": "requires_payment_method",
    "payment_method": null

    while the response still includes the failed payment method under:

    "last_payment_error.payment_method.type": "mb_way"

    So the frontend tries to read payment_method.type even though payment_method is null, which causes:

    Cannot read properties of null (reading 'type')

    This appears to be a null-handling issue in the plugin/frontend when a customer cancels an MB WAY payment via UPM.

    I am attaching the debugger screenshot and the relevant PaymentIntent payload.

    Plugin Author Clayton R

    (@mrclayton)

    Hi @dewdrop99

    Thank you for those details, it is very helpful. We’ll work on a resolution to this issue and include it in the next release.

    Kind Regards

    Plugin Author Clayton R

    (@mrclayton)

    Hi @dewdrop99

    Can you create a support ticket via the WordPress Admin > WooCommerce > Stripe > Support page? I’d like to share the updated version so you can test before it’s released to the ww.wp.xz.cn repository.

    Please reference this support url when you submit your ticket so the support rep will know which file to share.

    Kind Regards

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.