Conversation
7d05f3e to
fe2f2dc
Compare
…ent payment methods.
fe2f2dc to
585e936
Compare
mayurkathale
approved these changes
Apr 9, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.phpLine:252, replace$amountwith 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