woocommerce-ios
woocommerce-ios copied to clipboard
[Mobile Payments] After editing an order, quickly using `Collect Payment` can result in the wrong total being shown for the card payment.
Description
Tapping Collect Payment
rapidly after editing an order can cause payment to be collected before the edit is reflected in the app.
In that case, that the card payment messages all show the pre-edit total, but the card will be charged the post-edit total. That means the shopper could be charged an unexpected amount.
If you use Tap to Pay on iPhone, or the Wisepad3, the reader/payment screen shows the actual amount charged... but the M2 and Chipper readers don't have a screen, so the first indication of the higher amount is in the order notes after payment is taken.
Repro
- Launch the app on a store which can take IPP.
- Tap the
Orders
tab - Select an order which is
Pending Payment
– note the order total. - Edit the order
- Increase or decrease the quantity of a product to change the order total.
- Tap
Done
- Quickly tap
Collect Payment
- Select Card reader or Tap to Pay on iPhone
- Observe that the app's payment modals all show the original order total
- Complete the payment; if you're using TTP or a WisePad3, observe that the reader shows the post-edit total
- Pull to refresh the order details
- Observe that the notes show that the post-edit total was charged.
Expected Behaviour
Unsure. We should at least make sure the modals show the post-edit total, but perhaps even go further and fail the flow if the total changes between when it starts, and when the order is refreshed during the payment flow.
Screenshot
https://github.com/woocommerce/woocommerce-ios/assets/2472348/ca7c62e6-08be-4e9a-94da-5b2693f05458