Payments not working due to empty shipping address, but we don’t use shipping
-
Following the latest plugin update (2.8.0) — (most likely since that’s when our customers started reporting the issue),payments with credit cards via Square, on the /checkout/order-pay/ pages aren’t working.
In the WooCommerce notes we can see the following error: “Square Payment Failed (Status code INVALID_ENUM_VALUE: “ is not a valid enum value for
Country
(line 1, character 759))”We do not require customers to have accounts in order to pay for products. Our shop currency matches square currency and payments were working fine until last update.
The issue is not present on the checkout page where customers need to choose their country (default USA).
The products are Virtual. I am mentioning this because I noticed this being important on the only support topic on WordPress that I could find: https://www.ads-software.com/support/topic/payment-failed-status-code-invalid_enum_value-is-not-a-valid-enum-value-for/
We don’t require a shipping address since products are virtual. But, after checking the square logs in WooCommerce, I notice that the error/issue is connected to the shipping address. Here’s a snippet of the log, I can send you the whole thing if needed. This is an error while I was testing the issue, I’m based in Romania.
This is from an order created in the back end. The client receives an email with order details and button with link to the /checkout/order-pay/ page for their specific order.
body: Array ( [errors] => Array ( [0] => stdClass Object ( [code] => INVALID_ENUM_VALUE [detail] => <code></code> is not a valid enum value for <code>Country</code> (line 1, character 759) [field] => shipping_address.country [category] => INVALID_REQUEST_ERROR ) ) ) 01-25-2022 @ 12:13:36 - Status code INVALID_ENUM_VALUE: <code></code> is not a valid enum value for <code>Country</code> (line 1, character 759) 01-25-2022 @ 12:24:15 - Request method: uri: createPaymentWithHttpInfo user-agent: WooCommerce-Square/2.8.0 (WooCommerce/6.1.1; WordPress/5.8.3) headers: Array ( ) body: { "source_id": "cnon:CBASEPkgi1vwyXZJlNhCqc5PQe4", "idempotency_key": "728c794a34a3df780d6e8b65aa8b197608d4aa96", "amount_money": { "amount": 204, "currency": "USD" }, "autocomplete": true, "order_id": "4oVi8n0g6P7fzV84gbp1UsCmubVZY", "customer_id": "2GFS2NW2AWZEKDBEGAP02SF3AG", "location_id": "0ZWHHMSYZ9EES", "reference_id": "PTC-1086", "buyer_email_address": "[email protected]", "billing_address": { "address_line_1": "1 street 1", "address_line_2": "", "locality": "Iasi", "administrative_district_level_1": "IS", "postal_code": "71170", "country": "RO", "first_name": "Baciu", "last_name": "Catalin", "organization": "" }, "shipping_address": { "address_line_1": "1 street 1", "address_line_2": "", "locality": "Iasi", "administrative_district_level_1": "IS", "postal_code": "71170", "country": "", "first_name": "Baciu", "last_name": "Catalin" }, "note": "PhotoFly Travel Club - Order PTC-1086" } duration: 0.25087s
As I can see above, the billing country is looking good on the "billing_address" but it's empty on "shipping_Address"
I'm not a developer so I can only guess what's happening, but I don't know how to interpret the code. These CC transactions worked perfectly on 2.7.0 version of the plugin. It only happens on /checkout/order-pay/ pages for orders we create in the back-end (woocommerce order). We don't fill in the shipping address in the order screen most of the time since we don't need it.
Please help, this is URGENT since customers can't use credit cards to pay for pending payment orders. I have created a support ticket on the WooCommerce website as recommended but I didn't get any reply in almost 48h.
Since the error happened, I reconnected Square to WooCommerce (disconnected and connected again).
I don't know what exactly is happening, and it needs to be fixed, but I guess that forcing the shipping address to match the billing address would somehow be a work-around for this issue? The website in question is photoflytravel.org
- The topic ‘Payments not working due to empty shipping address, but we don’t use shipping’ is closed to new replies.