Adding ability to sync payment status to Bill Payment and TrueMoney Payment. #140
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
In a case of
offsite
payment, there is a chance that a payment transaction will not be resolved immediately after users have completed their payment at the 3rd-party payment page (i.e. Internet Banking). Omise Charge status will stay aspending
and as so, WooCommerce order status.With the above case, unless the Webhook feature is properly set. Merchant will need to go to Omise Dashboard to check a final status later on, then manually update his/her order status accordingly.
This pull request is to add a functionality where merchants can pull a latest status of a particular Omise Charge transaction and automatically update WooCommerce Order's status accordingly right at the WooCommerce Order page.
Related information:
Related issue(s): T17007 (internal ticket)
2. Description of change
This feature has been implemented to the rest payment methods.
However, there are 2 missing payment methods, which are,
Bill Payment
, andTrueMoney Wallet
.3. Quality assurance
🔧 Environments:
WooCommerce: v3.7.0
✏️ Details:
As we cannot test the
pending
case with Omise test account. This test requires a little modification on Omise-WooCommerce's code.Preparation
At directory
includes/gateway
, you will see bunch of classes that are representing of each payment method. Openincludes/gateway/class-omise-payment-truemoney.php
file with your text editor.Find the method
callback()
and search for the following lineThen add this code after.
Output
on-hold
status.Test for TrueMoney Wallet payment
At the right-top of WooCommerce Order page, Order actions section. Choose: Omise: Manual sync payment status.
Click "Update" button.
In case of "successful" payment (
charge.status = successful
)processing
.charge.status = failed
)failed
.charge.status = pending
)There may be a chance where a particular charge has not yet been processed even after a while.
on-hold
Test for Bill Payment
Bill Payment case is similar to TrueMoney Wallet payment, except that you don't need to alter the plugin code at
callback
method (because Bill Payment payment method is an offline method, there is no redirection after finished the purchase).Pending > Successful
Failed
4. Impact of the change
None
5. Priority of change
Normal
6. Additional Notes
Please note that at the moment, a pending status of Bill Payment is shown as
pending payment
which will be corrected in the coming Pull Request. (it should be set toon-hold
instead)