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 as pending 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, and TrueMoney Wallet.
3. Quality assurance
🔧 Environments:
WooCommerce: v3.7.0
WordPress: v5.2.3
PHP: 7.3.3
✏️ 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. Open includes/gateway/class-omise-payment-truemoney.php file with your text editor.
Find the method callback() and search for the following line
/**
* @return void
*/
public function callback() {
...
try {
$charge = OmiseCharge::retrieve( $order->get_transaction_id() );
$charge['paid'] = false; // add the code right here
$charge['status'] = 'pending'; // add the code right here
...
}
Save the file, then back to WooCommerce store. Place an order with Omise TrueMoney Wallet payment method. WooCommerce Order will be created with TrueMoney Wallet payment, with on-hold status.
Note, there will be 2 double notes and that is a normal-expected behaviour.
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)
An order status will be changed to processing.
A note will be added with the following message
Omise: Payment successful.
An amount {amount} {currency} has been paid (manual sync).
In case of "failed" payment (charge.status = failed)
In case of "pending" payment (charge.status = pending)
There may be a chance where a particular charge has not yet been processed even after a while.
An order status stays as on-hold
A note will be added with the following message
Omise: Payment is still in progress.
You might wait for a moment before click sync the status again or contact Omise support team at support@omise.co if you have any questions (manual sync).
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).
Place an order with Bill Payment method, then go to Omise Dashboard to mark a charge to be either "successful" or "failed"
In a case of either "successful" or "failed", the result will be identically the same as TrueMoney Wallet payment (and the same as the rest of other payment methods).
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 to on-hold instead)
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
.In case of "failed" payment (
charge.status = failed
)failed
.In case of "pending" payment (
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).Place an order with Bill Payment method, then go to Omise Dashboard to mark a charge to be either "successful" or "failed"
In a case of either "successful" or "failed", the result will be identically the same as TrueMoney Wallet payment (and the same as the rest of other payment methods).
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)