According to Omise documents, those Alipay (online) and Installment payment methods are supporting refund via Omise API. However the plugin is still behind and doesn't provide this feature.
This pull request is to add a refund-feature support to those 2 payment methods.
Related information:
Related issue(s): T18953, T19969 (internal ticket)
2. Description of change
Adding refund feature to Alipay (online) and Installment payment methods.
3. Quality assurance
🔧 Environments:
WooCommerce: v3.9.3
WordPress: v5.3.2
PHP version: 7.3.3
✏️ Details:
1. To test refunding a charge using Alipay payment method, you will need to place an order and go through the normal WooCommerce checkout step.
1.1. At WooCommerce Order page, click "refund" button
1.2. Enter a refund amount and click "Refund [amount] via Omise Alipay".
1.3. Successfully refund will be shown on the "Order Notes" section, as well as displaying its refund transaction under the "items" section at WooCommerce Order page.
1.4. You may as well, test for a failure case by modifying the code (as WooCommerce provides frontend-validation, the easiest way is to modify Omise code to create a refund with a false amount).
At file: includes/gateway/class-omise-payment.php Line: 252, replace $amount with any invalid number, then create another refund via WooCommerce Order page.
There will be a alert-dialog showing **"Refund failed: ..."*** with a message (from Omise API)
2. To test refunding a charge using Installment payment method, you will need to place an order and go through the normal WooCommerce checkout step the same Alipay.
2.1. At WooCommerce Order page, click "refund" button
2.2. Enter a refund amount and click "Refund [amount] via Omise Installment".
2.3. Successfully refund will be shown on the "Order Notes" section, as well as displaying its refund transaction under the "items" section at WooCommerce Order page.
Also for a full-refund, the order status will be updated to Refunded.
2.4. However, Installment payment method does not support for partial-refund.
If you try to create a refund with a partial amount, it will result showing alert-dialog saying: "Refund failed: charge partial refunds is not permitted for this type of charge."
1. Objective
According to Omise documents, those Alipay (online) and Installment payment methods are supporting refund via Omise API. However the plugin is still behind and doesn't provide this feature.
This pull request is to add a refund-feature support to those 2 payment methods.
References:
Related information: Related issue(s): T18953, T19969 (internal ticket)
2. Description of change
Adding refund feature to Alipay (online) and Installment payment methods.
3. Quality assurance
🔧 Environments:
✏️ Details:
1. To test refunding a charge using Alipay payment method, you will need to place an order and go through the normal WooCommerce checkout step.
1.1. At WooCommerce Order page, click "refund" button
1.2. Enter a refund amount and click "Refund [amount] via Omise Alipay".
1.3. Successfully refund will be shown on the "Order Notes" section, as well as displaying its refund transaction under the "items" section at WooCommerce Order page.
1.4. You may as well, test for a failure case by modifying the code (as WooCommerce provides frontend-validation, the easiest way is to modify Omise code to create a refund with a false amount). At file:
includes/gateway/class-omise-payment.php
Line:252
, replace$amount
with any invalid number, then create another refund via WooCommerce Order page.There will be a alert-dialog showing **"Refund failed: ..."*** with a message (from Omise API)
2. To test refunding a charge using Installment payment method, you will need to place an order and go through the normal WooCommerce checkout step the same Alipay. 2.1. At WooCommerce Order page, click "refund" button
2.2. Enter a refund amount and click "Refund [amount] via Omise Installment".
2.3. Successfully refund will be shown on the "Order Notes" section, as well as displaying its refund transaction under the "items" section at WooCommerce Order page. Also for a full-refund, the order status will be updated to
Refunded
.2.4. However, Installment payment method does not support for partial-refund. If you try to create a refund with a partial amount, it will result showing alert-dialog saying: "Refund failed: charge partial refunds is not permitted for this type of charge."
4. Impact of the change
none
5. Priority of change
Normal
6. Additional Notes
none