Hello! So I am using the magento graphql api to go through the cart workflow. I am using the braintree payment method. Everything goes smoothly until I use the placeOrder mutation. It returns the error saying
Unable to place order: A server error stopped your order from being placed. Please try to place your order again |
According to these docs https://devdocs.magento.com/guides/v2.3/graphql/mutations/place-order.html that means
The shopper tried to place an order when no products are in the shopping cart. |
{ "id": "9CDxLEFLMBDdbdqdDKk6oVPoeE32ZNVi", "email": "abennett@redacted.com", "items": [ { "product": { "uid": "MzYw", "sku": "mask-child-1", "name": "Kids' Face Mask", "price_range": { "minimum_price": { "regular_price": { "value": 18.5, "currency": "CAD" } } }, "id": 360, "__typename": "SimpleProduct" }, "quantity": 1, "id": "69", "__typename": "SimpleCartItem" }, { "product": { "uid": "MzYx", "sku": "mask-adult-1", "name": "Adult Face Mask", "price_range": { "minimum_price": { "regular_price": { "value": 18.5, "currency": "CAD" } } }, "id": 361, "__typename": "SimpleProduct" }, "quantity": 1, "id": "70", "__typename": "SimpleCartItem" } ], "shipping_addresses": [ { "firstname": "Antonio", "lastname": "Bennett", "company": "Redacted", "street": [ "Redacted" ], "city": "Redacted", "region": { "code": "ON", "label": "Ontario" }, "postcode": "Redacted", "telephone": "Redacted", "country": { "code": "CA", "label": "CA" }, "available_shipping_methods": [ { "carrier_code": "cadstd", "carrier_title": "Free Standard Canada, This shipping method is not trackable", "method_code": "cadstd", "method_title": "Canada Post (3-9 business days). Please allow an additional 1-2 weeks for production." }, { "carrier_code": "cadexp", "carrier_title": "Express Canada, Tracked", "method_code": "cadexp", "method_title": "Canada Post (1-4 business days). Please allow an additional 1-2 business days for production." }, { "carrier_code": "cadpri", "carrier_title": "Priority Canada, Tracked", "method_code": "cadpri", "method_title": "FedEx (1-2 business days). Please allow an additional 1-2 business days for production." } ], "selected_shipping_method": { "carrier_code": "cadexp", "method_code": "cadexp", "carrier_title": "Express Canada, Tracked", "method_title": "Canada Post (1-4 business days). Please allow an additional 1-2 business days for production." } } ], "billing_address": { "firstname": "Antonio", "lastname": "Bennett", "company": "Redacted", "street": [ "Redacted" ], "city": "Redacted", "region": { "code": "ON", "label": "Ontario" }, "postcode": "Redacted", "telephone": "Redacted", "country": { "code": "CA", "label": "CA" } }, "selected_payment_method": { "code": "braintree" } }The kicker as well is that although the placeOrder mutation returns that error, I am able to see the order in the admin with a status of payment processed. Any Ideas??
Based on the provided information, it seems that you have products in the shopping cart, but you are still receiving an error when trying to place the order. Here are a few possible solutions you can try:
Double-check the request payload: Ensure that you are correctly sending the request payload with all the necessary fields and values required by the placeOrder mutation. Make sure that the cart_id and payment_method fields are included and populated correctly.
Verify the Braintree payment integration: Confirm that the Braintree payment integration is set up correctly in your Magento configuration. Ensure that all the necessary API credentials and settings are properly configured to process payments.
Check for any customizations or extensions: If you have any customizations or extensions related to the cart or payment process, ensure that they are not causing any conflicts or issues. Temporarily disabling any customizations/extensions and retesting the place order functionality may help identify the cause of the problem.
Review server logs and error messages: Check the server logs and error messages to see if there are any additional details about the error. This information can provide insights into the specific issue that is preventing the order placement.
Test with different products and scenarios: Try creating orders with different products, quantities, and payment methods to see if the issue is specific to certain combinations. This can help narrow down the cause and identify any patterns.
Remember, these are general suggestions, and it's always recommended to consult with a Magento developer or technical expert who can analyze your specific implementation and provide tailored solutions.
Best regard,
nguyenthuobef6
@bennettant8288 wrote:Hello! So I am using the magento graphql api to go through the cart workflow. I am using the braintree payment method. Everything goes smoothly until I use the placeOrder mutation. It returns the error saying
Unable to place order: A server error stopped your order from being placed. Please try to place your order again
According to these docs https://devdocs.magento.com/guides/v2.3/graphql/mutations/place-order.html that means
However I know this is false because I fetch and log the cart details before the placeOrder mutation. The cart details are below.
The shopper tried to place an order when no products are in the shopping cart. { "id": "9CDxLEFLMBDdbdqdDKk6oVPoeE32ZNVi", "email": "abennett@redacted.com", "items": [ { "product": { "uid": "MzYw", "sku": "mask-child-1", "name": "Kids' Face Mask", "price_range": { "minimum_price": { "regular_price": { "value": 18.5, "currency": "CAD" } } }, "id": 360, "__typename": "SimpleProduct" }, "quantity": 1, "id": "69", "__typename": "SimpleCartItem" }, { "product": { "uid": "MzYx", "sku": "mask-adult-1", "name": "Adult Face Mask", "price_range": { "minimum_price": { "regular_price": { "value": 18.5, "currency": "CAD" } } }, "id": 361, "__typename": "SimpleProduct" }, "quantity": 1, "id": "70", "__typename": "SimpleCartItem" } ], "shipping_addresses": [ { "firstname": "Antonio", "lastname": "Bennett", "company": "Redacted", "street": [ "Redacted" ], "city": "Redacted", "region": { "code": "ON", "label": "Ontario" }, "postcode": "Redacted", "telephone": "Redacted", "country": { "code": "CA", "label": "CA" }, "available_shipping_methods": [ { "carrier_code": "cadstd", "carrier_title": "Free Standard Canada, This shipping method is not trackable", "method_code": "cadstd", "method_title": "Canada Post (3-9 business days). Please allow an additional 1-2 weeks for production." }, { "carrier_code": "cadexp", "carrier_title": "Express Canada, Tracked", "method_code": "cadexp", "method_title": "Canada Post (1-4 business days). Please allow an additional 1-2 business days for production." }, { "carrier_code": "cadpri", "carrier_title": "Priority Canada, Tracked", "method_code": "cadpri", "method_title": "FedEx (1-2 business days). Please allow an additional 1-2 business days for production." } ], "selected_shipping_method": { "carrier_code": "cadexp", "method_code": "cadexp", "carrier_title": "Express Canada, Tracked", "method_title": "Canada Post (1-4 business days). Please allow an additional 1-2 business days for production." } } ], "billing_address": { "firstname": "Antonio", "lastname": "Bennett", "company": "Redacted", "street": [ "Redacted" ], "city": "Redacted", "region": { "code": "ON", "label": "Ontario" }, "postcode": "Redacted", "telephone": "Redacted", "country": { "code": "CA", "label": "CA" } }, "selected_payment_method": { "code": "braintree" } }The kicker as well is that although the placeOrder mutation returns that error, I am able to see the order in the admin with a status of payment processed. Any Ideas??
If the placeOrder mutation in your GraphQL API is not returning an order number, there could be a few reasons why this is happening:
Check the schema: Make sure that the orderNumber field is included in the schema for the placeOrder mutation. If the field is not included, the mutation will not return an order number.
Check the resolver: Make sure that the resolver for the placeOrder mutation is properly configured to return the orderNumber field. If the resolver is not configured correctly, it may not return the order number.
Check the backend system: If the schema and resolver are properly configured, the issue may be with the backend system that is processing the order. Check the logs and error messages from the backend system to see if there are any issues or errors that could be preventing the order number from being returned.
Check the client application: If the backend system is properly configured, the issue may be with the client application that is consuming the GraphQL API. Make sure that the client application is properly configured to handle the orderNumber field and that it is correctly parsing the response from the placeOrder mutation.
By checking these areas, you can identify the root cause of the issue and take steps to resolve it. If you continue to experience issues, consider reaching out to the developer or support team for the GraphQL API for additional assistance. PayByPlateMa