Skip to content

Unable to continue with payment of order when pressing "back" to payment selection #4474

Closed
@karl-ravn

Description

@karl-ravn

When an order

Steps to reproduce

  1. Install Magento from develop branch.
  2. Add Product to the cart.
  3. Install (for instance) SaferPay plugin from CustomWeb
  4. Go to Checkout
  5. Fill in shipment details
  6. Select payment method and click "Place order"
  7. Press back in button (not cancel in payment provider)
  8. Press "Place order" again

Expected result

  1. You would go to the payment provider and continue on the already made order in the system

Actual result

  1. You get an error due to that the database table sales_order already contains the increment number
  2. The order is now in "pending payment" state until the timeout occurs, and the user cannot proceed with checkout without clearing cookies or switching web browser.

Stack trace

[2016-05-12 02:37:15] main.CRITICAL: Zend_Db_Statement_Exception: Report ID: webapi-5733ec5b3500f; Message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3000000496-3' for key 'SALES_ORDER_INCREMENT_ID_STORE_ID', query was: INSERT INTO `sales_order` (`state`, `status`, `coupon_code`, `protect_code`, `is_virtual`, `store_id`, `customer_id`, `base_discount_amount`, `base_grand_total`, `base_shipping_amount`, `base_shipping_tax_amount`, `base_subtotal`, `base_tax_amount`, `base_to_global_rate`, `base_to_order_rate`, `discount_amount`, `grand_total`, `shipping_amount`, `shipping_tax_amount`, `store_to_base_rate`, `store_to_order_rate`, `subtotal`, `tax_amount`, `total_qty_ordered`, `customer_is_guest`, `customer_note_notify`, `customer_group_id`, `quote_id`, `base_shipping_discount_amount`, `base_subtotal_incl_tax`, `base_total_due`, `shipping_discount_amount`, `subtotal_incl_tax`, `total_due`, `weight`, `increment_id`, `applied_rule_ids`, `base_currency_code`, `customer_email`, `customer_firstname`, `customer_lastname`, `customer_middlename`, `discount_description`, `global_currency_code`, `order_currency_code`, `remote_ip`, `store_currency_code`, `store_name`, `x_forwarded_for`, `total_item_count`, `discount_tax_compensation_amount`, `base_discount_tax_compensation_amount`, `shipping_discount_tax_compensation_amount`, `base_shipping_discount_tax_compensation_amnt`, `discount_tax_compensation_invoiced`, `base_discount_tax_compensation_invoiced`, `discount_tax_compensation_refunded`, `base_discount_tax_compensation_refunded`, `shipping_incl_tax`, `base_shipping_incl_tax`, `coupon_rule_name`, `gift_message_id`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) in /opt/store.traxfamily.com/vendor/magento/framework/Webapi/ErrorProcessor.php:194
Stack trace:
#0 /opt/store.traxfamily.com/vendor/magento/framework/Webapi/ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(Zend_Db_Statement_Exception))
#1 /opt/store.traxfamily.com/vendor/magento/module-webapi/Controller/Rest.php(163): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(Zend_Db_Statement_Exception))
#2 /opt/store.traxfamily.com/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#3 /opt/store.traxfamily.com/vendor/magento/framework/App/Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#4 [internal function]: Magento\Framework\App\Http->launch()
#5 /opt/store.traxfamily.com/vendor/magento/framework/Interception/Interceptor.php(144): call_user_func_array(Array, Array)
#6 /opt/store.traxfamily.com/var/generation/Magento/Framework/App/Http/Interceptor.php(26): Magento\Framework\App\Http\Interceptor->___callPlugins('launch', Array, Array)
#7 /opt/store.traxfamily.com/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()
#8 /opt/store.traxfamily.com/pub/index.php(73): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#9 {main} [] []

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions