Skip to content

Conversation

@staskus
Copy link
Contributor

@staskus staskus commented Nov 18, 2024

Resolves: #14163
Continuation of #14422

Description

Add eligibility checking logic for sending receipts after payment functionality:

  • WooCommerce from 9.5 supports API calls to actions/send_order_details to trigger sending order details email
  • WooPayments from 8.6 supports sending emails to attached customers when order payment fails

Steps to reproduce

The feature flag is disabled, I think it could be enough to check unit test cases to confirm that supported scenarios are handled as expected. In the final PRs, we can test the full flows.

However, if you prefer testing live:

Eligible site

  1. Enable sendReceiptAfterPayment feature flag
  2. Use my testing site https://lovely-aware-sturgeon.jurassic.ninja/ details: PdfdoF-5Qj-p2
  3. Create an order
  4. Do not attach the customer
  5. Make a payment
  6. Confirm "Email receipt" button appears
  7. Tap on the button
  8. Input email
  9. Tap the CTA
  10. Confirm email appears

Ineligible site

  1. Enable sendReceiptAfterPayment feature flag
  2. Use a testing site that has released versions of WooCommerce and WooPayments
  3. Create an order
  4. Do not attach the customer
  5. Make a payment
  6. Confirm "Email receipt" doesn't appear (or it opens native Mail client if it's installed)

Testing information

  • Added unit tests
  • Tested on my site with feature flag enabled

  • I have considered if this change warrants user-facing release notes and have added them to 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:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

Sending receipt after payment depends on two plugins:
- WooCommerce from 9.5 supports API calls to actions/send_order_details to trigger sending order details email
- WooPayments from 8.6 supports sending email to attached customer when order payment fails
@staskus staskus added type: task An internally driven task. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. labels Nov 18, 2024
@staskus staskus added this to the 21.3 milestone Nov 18, 2024
@staskus staskus requested a review from iamgabrielma November 18, 2024 20:37
@wpmobilebot
Copy link
Collaborator

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14446-01c94d9
Version21.1
Bundle IDcom.automattic.alpha.woocommerce
Commit01c94d9
App Center BuildWooCommerce - Prototype Builds #11635
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@iamgabrielma iamgabrielma self-assigned this Nov 18, 2024
Copy link
Contributor

@iamgabrielma iamgabrielma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

✅ Eligible site shows the option and works as expected
✅ Non-eligible site does not show the option

@staskus staskus merged commit 09e8f0e into trunk Nov 19, 2024
23 of 27 checks passed
@staskus staskus deleted the task/14164-eligibility-checker branch November 19, 2024 06:10
@staskus staskus mentioned this pull request Dec 19, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: mobile payments Related to mobile payments / card present payments / Woo Payments. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TTPReq] Send receipts after succeeded or failed payments

4 participants