Skip to content

CartThrob Subscriptions: cron/rebill error when Stripe requires 3d Secure validation #15

@creativearc-paul

Description

@creativearc-paul

This seems to be a more common occurrence for international orders (relative to US).

I suspect that when Stripe flags an order as requiring 3D Secure verification, CartThrob/Subscriptions doesn't know how to handle it.

Currently these subscriptions come back as successful (from a CT perspective) even though they have no transaction ID as would be expected from a valid order.

Error has these elements:

File: system/user/addons/cartthrob/cartthrob/plugins/payment_gateways/Cartthrob_stripe.php
Line: 241
The following error occurred: 
E_WARNING: foreach() argument must be of type array|object, null given 

And then:

Line: 296
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url='https://hooks.stripe.com/3d_secure_2/hosted?merchant=acct_0u6hxDzMHXGZy2XUfGxu&amp;payment_intent=pi_REDACTED&amp;payment_intent_client_secret=pi__REDACTED_secret__REDACTED&amp;publishable_key=pk_live__REDACTED&amp;source=payatt__REDACTED'" />

        <title>Redirecting to https://hooks.stripe.com/3d_secure_2/hosted?merchant=acct__REDACTED&amp;payment_intent=pi__REDACTED&amp;payment_intent_client_secret=pi__REDACTED_secret__REDACTED&amp;publishable_key=pk_live__REDACTED&amp;source=payatt__REDACTED</title>
    </head>
    <body>
        Redirecting to <a href="https://hooks.stripe.com/3d_secure_2/hosted?merchant=acct__REDACTED&amp;payment_intent=pi__REDACTED&amp;payment_intent_client_secret=pi__REDACTED_secret__REDACTED&amp;publishable_key=pk_live__REDACTED&amp;source=payatt__REDACTED">https://hooks.stripe.com/3d_secure_2/hosted?merchant=acct__REDACTED&amp;payment_intent=pi__REDACTED&amp;payment_intent_client_secret=pi__REDACTED_secret__REDACTED&amp;publishable_key=pk_live__REDACTED&amp;source=payatt__REDACTED</a>.
    </body>

And then:

TypeError caught:
Cartthrob_stripe::chargeToken(): Return value must be of type CartThrob\Transactions\TransactionState, null returned
user/addons/cartthrob/cartthrob/plugins/payment_gateways/Cartthrob_stripe.php:476
#0 user/addons/cartthrob/libraries/Cartthrob_payments.php(303): Cartthrob_stripe->chargeToken('card_0MpZc7xDzM...', 'cus_Lzzr4tS4o2l...', false)
#1 user/addons/cartthrob_subscriptions/src/Services/OrdersService.php(191): Cartthrob_payments->chargeToken('card_0MpZc7xDzM...', 'cus_Lzzr4tS4o2l...', false)
#2 user/addons/cartthrob_subscriptions/src/Services/BillingService.php(67): CartThrob\Subscriptions\Services\OrdersService->chargeSubscription(Object(CartThrob\Subscriptions\Models\Subscription), Array)
#3 user/addons/cartthrob_subscriptions/src/Services/BillingService.php(119): CartThrob\Subscriptions\Services\BillingService->processSubscription(Object(CartThrob\Subscriptions\Models\Subscription))
#4 user/addons/cartthrob_subscriptions/src/Commands/Rebill.php(57): CartThrob\Subscriptions\Services\BillingService->processRebill()
#5 ee/ExpressionEngine/Cli/Cli.php(273): CartThrob\Subscriptions\Commands\Rebill->handle()
#6 ee/ExpressionEngine/Core/Core.php(144): ExpressionEngine\Cli\Cli->process()
#7 ee/ExpressionEngine/Core/Core.php(116): ExpressionEngine\Core\Core->bootCli()
#8 ee/ExpressionEngine/Boot/boot.php(184): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#9 ee/eecli.php(105): require_once('...')
#10 {main}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions