cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Strip API place order error

Magento 2 Strip API place order error

Hello..for magento 2 when placing an order via Stripe API showing an error like “Order cannot placed because payment method was not provided”. But payment was received in Stripe dashboard. Please help. 

2 REPLIES 2

Re: Magento 2 Strip API place order error

Hello @deepumathece15 

 

 

Check that the payment token is being generated and sent to the backend. You can check this by reviewing the Stripe logs.

 

Use the Stripe JavaScript library to generate a payment token on the client-side. This token should then be sent to the server when the order is placed.

 

// Example for creating a payment method token via Stripe.js

stripe.createPaymentMethod({

  type: 'card',

  card: cardElement,  // Card Element reference

}).then(function(result) {

  if (result.error) {

    // Handle the error

    console.log(result.error.message);

  } else {

    // Send result.paymentMethod.id to Magento backend

    var paymentToken = result.paymentMethod.id;

  }

});

 

Stripe uses webhooks to notify your store about the payment status. Ensure that you have the webhook correctly configured:

 

Log in to your Stripe Dashboard.

 

Go to Developers > Webhooks and ensure that the Webhook URL is configured to point to your Magento 2 store.


Make sure that your Magento store’s webhook handler is processing the events like:


payment_intent.succeeded
payment_intent.failed
checkout.session.completed

If the webhook is not correctly configured, Stripe may process the payment, but Magento won’t be aware of the successful transaction.

 

 

Hope it helps ! 

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

 

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9

Re: Magento 2 Strip API place order error

Thank you.