omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

[APM2-59]no longer send merchant email for new order with status equal to on-hold #230

Closed nimitomise closed 3 years ago

nimitomise commented 3 years ago

1. Objective

To prevent order email sending to merchant once order created with status as on-hold which happen when checkout card with PAYNOW.

Related information: Related issue(s): #< GitHub ticket number > (optional)

2. Description of change

Override Woocommerce filter for woocommerce_email_recipient_new_order which able to initiate with status as on-hold to not send order email to merchant.

Additionally add the reasoning for change details if they're complex or abstract.

3. Quality assurance

Ensure normal payment flow can be completed for Paynow

🔧 Environments:

Tested locally by pointing OMISE_API_URL to staging-omise

WooCommerce: v5.7.1 WordPress: v5.8 PHP version: 7.1

✏️ Details:

  1. Make sure setting merchant email at /wp-admin/admin.php?page=wc-settings&tab=email&section=wc_email_new_order or /wp-admin/admin.php?page=wc-settings&tab=email to your valid email
  2. Checkout cart with Paynow payment make sure customer email is valid and accessible
  3. Go to customer mail box should still receive new order email
  4. Go to merchant mail box should not receive new order email
  5. Checkout cart with Credit Card and accessible
  6. Go to customer mail box should still receive new order email
  7. Go to merchant mail box should still receive new order email

4. Impact of the change

List the steps that must be taken for this PR to work. E.g.: rake yak:shave, Add "yak_key" to environment variables, ...

Be sure to include all systems that needs to be changed or which system is affected by the change (Ex: Requires Elastic search to be installed and configured in secrets.yml).

Note: Please provide a screenshot if your changed impact to UI.

5. Priority of change

Normal

6. Additional Notes

No