Closed staskus closed 1 week ago
1 Warning | |
---|---|
:warning: | This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews. |
Generated by :no_entry_sign: Danger
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
App Name | WooCommerce iOS | |
Build Number | pr14422-0322fe4 | |
Version | 21.1 | |
Bundle ID | com.automattic.alpha.woocommerce | |
Commit | 0322fe4f25521b18197752d299818a4b6bb7a5b5 | |
App Center Build | WooCommerce - Prototype Builds #11634 |
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.
Are we going to be able to select an email from existing customers, rather than writing it?
Good question. I opted for simplicity now, but I imagine a scenario where we would have a button that opens Customer search and allows them to pick one instead.
Are going to be able to "resend" to the same address (eg: retry button, reusing the already-entered email) and/or different addresses prompted from the order view?
Not in the scope of this feature. But all of that is supported by a new API.
Something I've missed is some sort of UI feedback between sending was completed and all the modals were dismissed, something like what we do when creating a coupon (a big animated checkmark before calling for dismiss)
Good point. I'll check what is done in the coupon view and try to implement it as well. 👍
Partially addresses: #14163, I'll address failed payments in the next tasks.
Description
This PR implements sending receipts after successful payments with a new API. Until now, it was only possible to send a receipt after payment using the email client.
However, after https://github.com/woocommerce/woocommerce-ios/pull/14368 was implemented and with Woo 9.5, it's possible to trigger sending receipts via API.
Note: There's an issue with this functionality on the WooCommerce trunk (p91TBi-csN-p2#comment-13579) therefore I'm not implementing an eligibility handler. I recommend doing testing on my provided site.
Solution
ReceiptEmailView
andReceiptEmailViewViewModel
for displaying a view with a single email address field and processing the "Email Receipt" action. It emulates the UI of the existing Customer Billing Information screens and reuses existing fields and buttons.CollectOrderPaymentUseCase
when users select "Email Receipt" option.Steps to reproduce
Before testing
true
fromisEligibleSendingReceiptAfterPayment
Main scenario: Successful payment + No customer
Testing information
I tested additional scenarios:
Regression cases where
isEligibleSendingReceiptAfterPayment
returns false:Screenshots
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: