• PHP message: PHP Fatal error:  Uncaught Stripe\Error\Card: Your card was declined. in */wp-content/plugins/direct-stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php:214 from API request 'req_NHetKTO3pkx5JH'
    Stack trace:
    #0 */wp-content/plugins/direct-stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php(173): Stripe\ApiRequestor::_specificAPIError('{\n  "error": {\n...', 402, Object(Stripe\Util\CaseInsensitiveArray), Array, Array)
    #1 */wp-content/plugins/direct-stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php(473): Stripe\ApiRequestor->handleErrorResponse('{\n  "error": {\n...', 402, Object(Stripe\Util\CaseInsensitiveArray), Array)
    #2 */wp-content/plugins/direct-stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php(126): Stripe\ApiRequestor->_interpretResponse('{\n  "error": {\n...', 402, Object(Stripe\Util\CaseInsensitiveArray))
    #3 */wp-content/plugins/" while reading response header from upstream, client: 78.22.144.137, server: magic-forum.club, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "*", referrer: "*"
    • This topic was modified 5 years, 11 months ago by ikovalyov.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Nicolas Figueira

    (@nahuelmahe)

    Hello @ikovalyov ,

    Thank you for using Direct Stripe.

    Could you provide more information about the scenario that result in this error ?

    I see that magic-forum.club don’t have https properly enabled, also it seems like ajax requests are blocked.

    Kind regards,

    Thread Starter ikovalyov

    (@ikovalyov)

    Hi.
    In case stripe declines processing request fails with error 500.
    Thanks.

    Plugin Author Nicolas Figueira

    (@nahuelmahe)

    Hello @ikovalyov ,

    That’s not really helping, this is a situation I am not facing.

    Could you share the message from Stripe logs ?
    Explain which kind of button are you using ?
    What happens when the request fails ?

    Kind regards,

    Thread Starter ikovalyov

    (@ikovalyov)

    Hi.
    My card has disabled online payments. As you can see in logs from the first message

    vendor/stripe/stripe-php/lib/ApiRequestor.php

    throw an exception because of it with type Stripe\Error\Card. It wasn’t caught by your code and payment request from the user side failed with error 500.

    Do you have a try-catch block around payment processing which is catching these exceptions?

    Unfortunately I’m not at home and can’t change your codebase right now.

    Thanks.

    • This reply was modified 5 years, 10 months ago by ikovalyov.
    Thread Starter ikovalyov

    (@ikovalyov)

    *and can’t check your codebase right now

    Plugin Author Nicolas Figueira

    (@nahuelmahe)

    Hello @ikovalyov ,

    You’re welcome to open a PR for what you need at https://github.com/New0/direct-stripe when you get home.

    Kind regards,

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fatal error if [ayment failed’ is closed to new replies.