I am following this tutorial to process cart / checkout for placing orders using graphql. Magento GraphQl Tutorial. And we have installed stripe on magento(backend).
So we are facing issue while placing order, we have done few steps upto point 5.
- Customer logs in get a authentication token
- Create empty cart
- Add product to cart
- Set billing and shipping address for cart
- Set payment method to stripe_payments (without card details)
- How to set payment information and where to set ?
- Placing order receiving error here
How can I set payment method and debit card details to cart using graphql and place an successful test order?
2
Answers
Make sure all steps ( 1 to 5 ) have been done without any issue. Please check the below steps for the mutation by which you can set the payment method and place the order.
Example: Use the setPaymentMethodOnCart mutation to set the payment method for your order. The value checkmo (“Check / Money order” payment method code) was returned in the query.
Response:
If the operation is successful, the response contains the code of the selected payment method.
Set payment method and place order
Use the setPaymentMethodAndPlaceOrder mutation to set the payment method and place the order.
Request:
Response:
If the operation is successful, the response contains the order ID.
Note: Make sure “setPaymentMethodAndPlaceOrder mutation” is not deprecated in the current version of Magento 2.
First check the available payment method ( added from magneto dashboard only)
Then set that payment method and post the query
https://devdocs.magento.com/guides/v2.4/graphql/tutorials/checkout/checkout-payment-method.html