Skip to content

Integrating WooCommerce refund's reason parameter to Omise Refund object.#165

Merged
guzzilar merged 1 commit intomasterfrom
refund-reason
Apr 27, 2020
Merged

Integrating WooCommerce refund's reason parameter to Omise Refund object.#165
guzzilar merged 1 commit intomasterfrom
refund-reason

Conversation

@guzzilar
Copy link
Copy Markdown
Contributor

@guzzilar guzzilar commented Apr 20, 2020

1. Objective

WooCommerce has provided a "reason" field for merchant to add a comment on the refund transaction. However, it hasn't been integrated to Omise Refund object.

Since Omise Refund API accepts for metadata parameter, it would be best to integrate it now.

Related information:
Internal ticket (T20652)

2. Description of change

There is nothing change in the term of UI. However, merchant now, can check for their refund's reason at Omise Dashboard as well.

3. Quality assurance

🔧 Environments:

  • WooCommerce: v4.0.1 (latest, at the time)
  • WordPress: v5.4 (latest, at the time)
  • PHP version: 7.3.3

✏️ Details:

Making sure that merchant can create a refund with a reason-adding.

  1. At the WooCommerce Order Detail page (admin), click at the refund button.

refund-reason-01

  1. There will be 2 fields show up, Refund Amount, and Reason for refund (optional).
    Entering any message to the Reason for refund (optional) field.

refund-reason-02

  1. If successful, a refund transaction will be displayed on WooCommerce Order page, as well as in Omise Dashboard, refund page.

refund-reason-03

refund-reason-04

  1. We would also make sure that, without adding any message to the Reason for refund (optional) field, there should not be any problem.

refund-reason-05

At Omise `metadata.reason`, it will show as empty string.

refund-reason-06

  1. Also making sure that the HTML (and script) tags will be sanitized before submitting to the Omise Refund API.

refund-reason-07

refund-reason-08

4. Impact of the change

No

5. Priority of change

Normal

6. Additional Notes

I think it would be nice if the coming metadata name is broadly used in another of Omise plugins as well, so please feel free to discuss about the naming there. (This PR is introducing $refund['metadata']['reason']).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants