woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
276 stars 135 forks source link

[Payment Method Improvements] Add support for other payment methods #10940

Open backwardstruck opened 7 months ago

backwardstruck commented 7 months ago

See related iOS PR

and this one.

Issue Summary:

Allow the user to add a note to the order with the paid amount and the change due, for their records. We should include this information in the receipt.

Issue Description:

This issue is to add support for other payment methods to the Android application, similar to the functionality recently implemented in iOS (#11366). This allows merchants to specify their payment methods via a note attached to the order. This functionality is particularly useful when the merchant receives payment via an alternative method, such as checks, gift cards, or house accounts, and wishes to record this.

Testing Instructions (based on iOS PR):

  1. Open the application and navigate to orders.
  2. Tap on '+' to create a new order.
  3. Add the required products to the order and then tap on 'Create'.
  4. Following this, tap on 'Collect Payment'.
  5. Select 'Other Payment Methods' from the available options.
  6. Add a note about the payment method used and mark the order as complete.
  7. Verify that the order is set as complete and that the order details are duly shown.
  8. Refresh the order and ensure that a note has been added with the payment method details you entered.
  9. Repeat the previous steps without adding a note and ensure no note is added to the order.

Please also validate that the appropriate events are being tracked: when tapping on 'Other Payment Methods' option and when adding a note.

When tapping on the 'Other Payment Methods' row, this event should be tracked:

🔵 Tracked payments_flow_collect, properties: [AnyHashable("is_wpcom_store"): true, AnyHashable("site_url"): "{site_url}", AnyHashable("order_id"): order_id, AnyHashable("payment_method"): "other_payment_methods", AnyHashable("was_ecommerce_trial"): false, AnyHashable("plan"): "business-bundle", AnyHashable("blog_id"): blog_id, AnyHashable("flow"): "order_payment"]

And when adding a note, this event should be tracked:

🔵 Tracked other_payment_methods_note_added, properties: [AnyHashable("site_url"): "{site_url}", AnyHashable("was_ecommerce_trial"): false, AnyHashable("is_wpcom_store"): true, AnyHashable("blog_id"): blog_id, AnyHashable("plan"): "business-bundle"]

Lastly, ensure that the event payments_flow_completed is being tracked with the correct payment method details.

### Tasks
- [ ] Add 'Other Payment Methods' to the available options.
- [ ] Allow user to add a note about the payment method used and mark the order as complete.
- [ ] Confirm above testing steps.
- [ ] Confirm event tracking for Android based on iOS steps above.
dangermattic commented 7 months ago

Thanks for reporting! 👍

backwardstruck commented 5 months ago

Confirming details on iOS changes as those have not yet been merged.