Is there a way to check and stop order being placed if the card is declined/not authorized?

  • Any card payment provider extension should do this by default without having to do anything on your side. If it is not the case then there is probably some code on your side that interfere with this process. Commented Nov 4, 2022 at 18:05

1 Answer 1


Yes, there is a way to check and stop an order from being placed if the card is declined or not authorized when using Stripe payment gateway in Magento 2.

When a payment is processed through Stripe, the payment gateway will return a response code that indicates whether the payment was successful or not. In Magento 2, you can configure the payment settings to automatically cancel the order if the payment is declined or not authorized.

To set this up, follow these steps:

  • Log in to your Magento 2 admin panel and navigate to Stores > Configuration.

  • Click on Sales > Payment Methods.

  • Locate the Stripe payment method and click on it to expand the settings.

  • Scroll down to the "Advanced Settings" section and set the "Automatically Invoice All Items" option to "No".

  • Set the "New Order Status" option to "Canceled".

  • Save the configuration and test the payment method by placing a test order with a declined or not authorized card.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.