subscribepro-magento2-ext icon indicating copy to clipboard operation
subscribepro-magento2-ext copied to clipboard

Admin ReOrder Public hash Error

Open ragboyjr opened this issue 7 years ago • 0 comments

When using the Stored Card via Subscribe Pro on reorder, you can sometimes get the following error on Submit Order. Order saving error: Public hash should be defined

I tracked the bug down and found that the issue comes from the fact that in certain scenarios view/adminhtml/web/js/vault.js will not set the publicHash field which when the order gets submitted, the public hash error comes up.

Steps to Reproduce

  1. Create a normal order with a subscription so that you use the SP payment method at checkout
  2. Cancel that order
  3. Create a reorder for that cancelled order
  4. In reorder, remove one of the product items and select Update Items and Quantities
  5. Then make sure billing/shipping is set, select your shipping method, then select the Stored Card with SP.

At this point, the error is already visible by inspecting document.forms.edit_form.elements['payment[public_hash]']. Normally, by this point, the public hash should be set in that field; however, in this specific scenario, the public_hash is empty.

Workaround

Currently, to workaround, we are simply just toggling the payment methods to force the JS listener to set the public_hash

ragboyjr avatar Oct 12 '17 22:10 ragboyjr