subscribepro-magento2-ext
subscribepro-magento2-ext copied to clipboard
Admin ReOrder Public hash Error
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
- Create a normal order with a subscription so that you use the SP payment method at checkout
- Cancel that order
- Create a reorder for that cancelled order
- In reorder, remove one of the product items and select
Update Items and Quantities
- 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