woocommerce / woocommerce-gateway-amazon-pay

Amazon Pay Gateway
20 stars 23 forks source link

Order being created when payment option has not been set #22

Closed dwainm closed 3 years ago

dwainm commented 4 years ago

On one of our merchant sites (www.walkinpets.com) they are receiving many cases where orders show up but without any customer info, no Amazon Pay order ID, or other details in the order view. Only way I was able to repro is to place a production order with an account that has no payment methods setup (I cannot do this in sandbox because all sandbox/test accounts come with credit cards). I see in the code that there is an exception thrown when PaymentPlanNotSet, but why is an order being added to WooCommerce orders?

Steps to reproduce the behavior:

  1. Try checking out in production mode with an account that does not have any payment methods.
  2. Observe: an order will be created in the backend Woo orders section, specifying that Amazon Pay is being used, but no other info

Screenshots image

Expected behavior The order should not go through and should not be added to the WooCommerce orders section.

Isolating the problem (mark completed items with an [x]):

WordPress Environment WP 5.3.2

``` ` ### WordPress Environment ### WordPress address (URL): https://animaldoor.com Site address (URL): https://animaldoor.com WC Version: 3.8.1 REST API Version: ✔ 1.0.2 Log Directory Writable: ✔ WP Version: 5.3.2 WP Multisite: – WP Memory Limit: 1 GB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: – ### Server Environment ### Server Info: LiteSpeed PHP Version: 7.2.28 PHP Post Max Size: 8 MB PHP Time Limit: 60 PHP Max Input Vars: 1700 cURL Version: 7.68.0 OpenSSL/1.1.1d SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.22-MariaDB-log Max Upload Size: 5 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 3.8.1 WC Database Prefix: wp_ MaxMind GeoIP Database: ✔ Total Database Size: 1531.88MB Database Data Size: 1083.25MB Database Index Size: 448.63MB wp_woocommerce_sessions: Data: 0.33MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 12.52MB + Index: 4.52MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 293.86MB + Index: 107.30MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB products: Data: 0.02MB + Index: 0.00MB + Engine InnoDB quickbooks_config: Data: 0.02MB + Index: 0.00MB + Engine InnoDB quickbooks_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB quickbooks_oauth: Data: 0.02MB + Index: 0.00MB + Engine InnoDB quickbooks_queue: Data: 0.02MB + Index: 0.06MB + Engine InnoDB quickbooks_recur: Data: 0.02MB + Index: 0.03MB + Engine InnoDB quickbooks_ticket: Data: 0.02MB + Index: 0.02MB + Engine InnoDB quickbooks_user: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_abandoned_cart_aelia_currency: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ac_abandoned_cart_history: Data: 1.52MB + Index: 0.02MB + Engine InnoDB wp_ac_email_templates: Data: 0.09MB + Index: 0.00MB + Engine InnoDB wp_ac_guest_abandoned_cart_history: Data: 0.23MB + Index: 0.06MB + Engine InnoDB wp_ac_link_clicked_email: Data: 0.09MB + Index: 0.00MB + Engine InnoDB wp_ac_notifications: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ac_notifications_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ac_opened_emails: Data: 0.30MB + Index: 0.00MB + Engine InnoDB wp_ac_sent_history: Data: 0.11MB + Index: 0.05MB + Engine InnoDB wp_ac_tiny_urls: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 44.58MB + Index: 36.09MB + Engine InnoDB wp_duplicator_pro_entities: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_duplicator_pro_packages: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_litespeed_img_optm: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_litespeed_optimizer: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_mw_wc_qbo_desk_qbd_customers: Data: 53.74MB + Index: 0.50MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_customers_pairs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_data_pairs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_items: Data: 2.00MB + Index: 0.02MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_account: Data: 0.09MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_class: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_customertype: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_inventorysite: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_paymentmethod: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_salesrep: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_salestaxcode: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_shipmethod: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_template: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_list_term: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_map_paymentmethod: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_map_promo_code: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_map_shipping_product: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_map_tax: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_map_wq_cf: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_product_pairs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_variation_pairs: Data: 0.03MB + Index: 0.01MB + Engine MyISAM wp_mw_wc_qbo_desk_qbd_vendors: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_options: Data: 6.44MB + Index: 0.44MB + Engine InnoDB wp_pet_info: Data: 0.06MB + Index: 0.02MB + Engine InnoDB wp_postmeta: Data: 281.80MB + Index: 240.73MB + Engine InnoDB wp_posts: Data: 78.56MB + Index: 16.06MB + Engine InnoDB wp_psu_redirects: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_psu_terms: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_taxjar_record_queue: Data: 1.52MB + Index: 1.52MB + Engine InnoDB wp_termmeta: Data: 0.41MB + Index: 0.16MB + Engine InnoDB wp_terms: Data: 1.52MB + Index: 0.66MB + Engine InnoDB wp_term_relationships: Data: 2.52MB + Index: 2.52MB + Engine InnoDB wp_term_taxonomy: Data: 1.52MB + Index: 0.59MB + Engine InnoDB wp_usermeta: Data: 155.58MB + Index: 33.13MB + Engine InnoDB wp_users: Data: 2.52MB + Index: 2.55MB + Engine InnoDB wp_user_popup: Data: 0.22MB + Index: 0.00MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_gpf_render_cache: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.14MB + Index: 0.33MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfBlockedIPLog: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfBlocks7: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_wfConfig: Data: 134.77MB + Index: 0.00MB + Engine MyISAM wp_wfCrawlers: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_wfFileChanges: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfFileMods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfHits: Data: 1.95MB + Index: 0.03MB + Engine MyISAM wp_wfHoover: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfIssues: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_wfKnownFileList: Data: 0.94MB + Index: 0.00MB + Engine MyISAM wp_wfLiveTrafficHuman: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfLocs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfLogins: Data: 0.16MB + Index: 0.00MB + Engine MyISAM wp_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfNotifications: Data: 0.02MB + Index: 0.00MB + Engine MyISAM wp_wfPendingIssues: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfReverseCache: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_wfSNIPCache: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wfStatus: Data: 0.03MB + Index: 0.00MB + Engine MyISAM wp_wfTrafficRates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_bundled_itemmeta: Data: 0.23MB + Index: 0.31MB + Engine InnoDB wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_exported_csv_items: Data: 0.08MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_gpf_google_taxonomy: Data: 1.52MB + Index: 0.00MB + Engine InnoDB wp_yoast_seo_links: Data: 0.17MB + Index: 0.08MB + Engine InnoDB wp_yoast_seo_meta: Data: 0.19MB + Index: 0.00MB + Engine InnoDB ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (47) ### Premmerce Permalink Manager for WooCommerce: by premmerce – 2.1.13 Advanced Custom Fields PRO: by Elliot Condon – 5.8.7 Convert Cart Analytics: by Aamir – 1.2.2 Contact Form 7: by Takayuki Miyoshi – 5.1.7 WooCommerce Coupon Generator: by Jeroen Sormani – 1.1.0 – Not tested with the active version of WooCommerce Disable Gutenberg: by Jeff Starr – 2.0 Doofinder for WooCommerce: by doofinder – 1.2.20 Duplicator Pro: by Snap Creek – 3.7.9.1 Flamingo: by Takayuki Miyoshi – 2.1.1 HPets Product in Category Widget: by Don – 1.0 iDevAffiliate WooCommerce Integration: by iDevDirect.com LLC – 1.1 – Not tested with the active version of WooCommerce LiteSpeed Cache: by LiteSpeed Technologies – 2.9.9.2 WooCommerce Sync for QuickBooks Desktop - by MyWorks Software: by MyWorks Software – 1.4.12 – Not tested with the active version of WooCommerce Social Login: by OneAll Social Login – 5.6 Password Protected: by Ben Huson – 2.2.5 PayPal for WooCommerce: by Angell EYE – 1.4.18 – Not tested with the active version of WooCommerce PixelYourSite PRO: by PixelYourSite – 7.3.6 – Not tested with the active version of WooCommerce Raw HTML Pro: by Janis Elsts – 1.8.2 TaxJar - Sales Tax Automation for WooCommerce: by TaxJar – 3.0.14 TinyMCE Advanced: by Andrew Ozz – 5.3.0 UberMenu 3 - The Ultimate WordPress Mega Menu: by Chris Mavricos SevenSpark – 3.6.1 User Password Email Disabler: by – Braintree For WooCommerce: by Payment Plugins support@paymentplugins.com – 3.1.5 Abandoned Cart Pro for WooCommerce: by Tyche Softwares – 8.3.0 – Not tested with the active version of WooCommerce WooCommerce Checkout Add-Ons: by SkyVerge – 2.2.0 – 2.2.6 is available WooCommerce Conditional Shipping and Payments: by SomewhereWarm – 1.5.9 – 1.7.5 is available WooCommerce Customer/Order/Coupon Export: by SkyVerge – 5.0.1 – 5.0.9 is available WooCommerce Dynamic Pricing: by Lucas Stark – 3.1.2 – 3.1.15 is available – Not tested with the active version of WooCommerce WooCommerce Amazon Pay: by WooCommerce – 1.11.1 WooCommerce Google Analytics Pro: by SkyVerge – 1.8.6 – 1.8.9 is available WooCommerce Perfect SEO Url: by Perfect SEO Url – 2.7.4 – Not tested with the active version of WooCommerce WooCommerce Product Add-ons: by WooCommerce – 3.0.25 – 3.0.27 is available WooCommerce Product Bundles: by SomewhereWarm – 6.1.3 – 6.1.4 is available WooCommerce Google Product Feed: by Ademti Software Ltd. – 7.9.4 – 8.1.0 is available – Not tested with the active version of WooCommerce WooCommerce Sequential Order Numbers Pro: by SkyVerge – 1.15.2 WooCommerce Shipment Tracking: by WooCommerce – 1.6.19 WooCommerce UPS Shipping: by WooCommerce – 3.2.21 – 3.2.22 is available WooCommerce USPS Shipping: by WooCommerce – 4.4.38 – 4.4.39 is available WooCommerce ShippingEasy Integration: by WooThemes – 4.1.1 – Not tested with the active version of WooCommerce WooCommerce Shop as Customer: by cxThemes – 2.16 – Not tested with the active version of WooCommerce WooCommerce: by Automattic – 3.8.1 – 4.0.1 is available Wordfence Security: by Wordfence – 7.4.6 Yoast SEO Premium: by Team Yoast – 5.7.1 WP Mail SMTP: by WPForms – 1.8.1 WP Store Locator: by Tijmen Smit – 2.2.232 Yoast SEO: WooCommerce: by Team Yoast – 5.7 – Not tested with the active version of WooCommerce Custom Product Tabs for WooCommerce: by YIKES Inc. – 1.6.13 ### Inactive Plugins (0) ### ### Dropin Plugins (1) ### advanced-cache.php: advanced-cache.php ### Settings ### API Enabled: ✔ Force SSL: ✔ Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: bundle (bundle) composite (composite) external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: ✔ ### WC Pages ### Shop base: #4 - /shop/ Cart: #5 - /cart/ Checkout: #6 - /checkout/ My account: #7 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Handicapped Pets Version: 1.0 Author URL: http://laborator.co/ Child Theme: ✔ Parent Theme Name: Aurum Parent Theme Version: 3.4.6.2 Parent Theme Author URL: https://laborator.co/ WooCommerce Support: ✔ ### Templates ### Overrides: aurum-child/woocommerce/archive-product.php version 2.0.0 is out of date. The core version is 3.4.0 aurum/woocommerce/cart/cart-empty.php aurum-child/woocommerce/cart/cart-shipping.php version 3.1.0 is out of date. The core version is 3.6.0 aurum-child/woocommerce/cart/cart-totals.php aurum-child/woocommerce/cart/cart.php version 3.1.0 is out of date. The core version is 3.8.0 aurum/woocommerce/cart/cross-sells.php aurum/woocommerce/cart/shipping-calculator.php aurum/woocommerce/checkout/form-billing.php version 3.0.9 is out of date. The core version is 3.6.0 aurum/woocommerce/checkout/form-checkout.php aurum/woocommerce/checkout/form-coupon.php aurum/woocommerce/checkout/form-login.php version 3.4.0 is out of date. The core version is 3.8.0 aurum/woocommerce/checkout/form-pay.php aurum/woocommerce/checkout/form-shipping.php version 3.0.9 is out of date. The core version is 3.6.0 aurum/woocommerce/checkout/payment-method.php aurum/woocommerce/checkout/review-order.php version 3.3.0 is out of date. The core version is 3.8.0 aurum-child/woocommerce/checkout/thankyou.php version 3.0.0 is out of date. The core version is 3.7.0 aurum-child/woocommerce/content-product.php version 3.4.0 is out of date. The core version is 3.6.0 aurum-child/woocommerce/content-product_cat.php aurum/woocommerce/content-single-product.php version 3.0.0 is out of date. The core version is 3.6.0 aurum-child/woocommerce/emails/customer-completed-order.php version 2.5.0 is out of date. The core version is 3.7.0 aurum-child/woocommerce/emails/customer-on-hold-order.php version 2.5.0 is out of date. The core version is 3.7.0 aurum-child/woocommerce/emails/customer-processing-order.php version 2.5.0 is out of date. The core version is 3.7.0 aurum-child/woocommerce/emails/customer-refunded-order.php version 2.5.0 is out of date. The core version is 3.7.0 aurum/woocommerce/global/form-login.php aurum/woocommerce/global/wrapper-end.php version 1.6.4 is out of date. The core version is 3.3.0 aurum/woocommerce/global/wrapper-start.php version 1.6.4 is out of date. The core version is 3.3.0 aurum/woocommerce/loop/add-to-cart.php version 3.0.0 is out of date. The core version is 3.3.0 aurum-child/woocommerce/loop/loop-end.php aurum-child/woocommerce/loop/loop-start.php version 2.0.0 is out of date. The core version is 3.3.0 aurum/woocommerce/loop/no-products-found.php aurum/woocommerce/loop/orderby.php aurum/woocommerce/loop/pagination.php aurum-child/woocommerce/loop/price.php aurum/woocommerce/loop/result-count.php version 3.0.0 is out of date. The core version is 3.7.0 aurum/woocommerce/loop/sale-flash.php aurum-child/woocommerce/myaccount/dashboard.php aurum/woocommerce/myaccount/form-edit-account.php aurum/woocommerce/myaccount/form-edit-address.php aurum-child/woocommerce/myaccount/form-login.php version 3.5.0 is out of date. The core version is 3.6.0 aurum/woocommerce/myaccount/form-lost-password.php aurum/woocommerce/myaccount/form-reset-password.php aurum/woocommerce/myaccount/my-account.php version 2.6.0 is out of date. The core version is 3.5.0 aurum/woocommerce/myaccount/my-address.php aurum/woocommerce/myaccount/my-downloads.php aurum/woocommerce/myaccount/orders.php version 3.2.0 is out of date. The core version is 3.7.0 aurum/woocommerce/myaccount/view-order.php aurum/woocommerce/order/form-tracking.php aurum/woocommerce/order/order-details-customer.php version 3.0.0 is out of date. The core version is 3.4.4 aurum/woocommerce/order/order-details-item.php version 3.0.0 is out of date. The core version is 3.7.0 aurum/woocommerce/order/order-details.php version 3.5.2 is out of date. The core version is 3.7.0 aurum/woocommerce/order/order-downloads.php aurum/woocommerce/order/tracking.php aurum/woocommerce/single-product/add-to-cart/grouped.php version 3.0.7 is out of date. The core version is 3.4.0 aurum-child/woocommerce/single-product/add-to-cart/variable.php version 3.0.0 is out of date. The core version is 3.5.5 aurum-child/woocommerce/single-product/meta.php aurum/woocommerce/single-product/price.php aurum/woocommerce/single-product/review-meta.php version 3.0.0 is out of date. The core version is 3.4.0 aurum/woocommerce/single-product/review.php aurum/woocommerce/single-product/sale-flash.php aurum/woocommerce/single-product/tabs/additional-information.php aurum/woocommerce/single-product/tabs/description.php aurum/woocommerce/single-product/tabs/tabs.php version 2.4.0 is out of date. The core version is 3.8.0 aurum/woocommerce/single-product/title.php aurum/woocommerce/single-product-reviews.php aurum-child/woocommerce/single-product.php Outdated Templates: ❌ Learn how to update ### WooCommerce Google Product Feed fields ### Availability: Defaults to "in stock". Condition: Defaults to "new". Brand: Defaults to "HandicappedPets.com". Manufacturer Part Number (MPN): Pre-populates from product sku. Product Type: Pre-populates from product_cat taxonomy. Google Product Category: Global Trade Item Number (GTIN): Size: Size system: Adwords labels: Bing Category: Pre-populates from product_cat taxonomy. Custom label 0: Custom label 1: Promotion ID: ### WooCommerce Google Product Feed options ### Include variations in feed: Enabled Send item_group_id: Enabled ### Product Bundles ### Database Version: 6.1.3 Template Overrides: – ### WooCommerce Customer/Order/Coupon Export ### Automated exports: 2 Custom formats: 4 Next export: Not scheduled ### Action Scheduler ### Complete: 96 Oldest: 2020-01-27 02:23:33 -0500 Newest: 2020-02-26 09:37:02 -0500 Pending: 5 Oldest: 2020-02-27 09:37:02 -0500 Newest: 2020-03-09 10:24:22 -0400 Canceled: 0 Oldest: – Newest: – In-progress: 0 Oldest: – Newest: – Failed: 1 Oldest: 2019-12-03 17:00:38 -0500 Newest: 2019-12-03 17:00:38 -0500 ` ```
dwainm commented 4 years ago

Another way to reproduce this is making a small code change to throw the exception we're interested in debugging. Add the following just before the final line of set_order_reference_details:

throw new Exception( __( 'You have not selected a payment method from your Amazon account. Please choose a payment method for this order.', 'woocommerce-gateway-amazon-payments-advanced' ) );

This will give the customer an error at checkout like this: image

And the state of the order is as described in the issue description.

I'm pretty sure this is how other payment gateways behave when processing a payment fails. I think what isn't working well here is the failure to add the Amazon Pay specific meta data to the order (and perhaps not adding an order note telling the merchant what happened).

mishaber commented 4 years ago

Thank you @dwainm, can you confirm that throwing this exception will still create the empty order? Would adding extra information to the order and a note be pretty straight forward?