-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing PayNow payment method (only available in Singapore) #152
Conversation
@@ -0,0 +1,153 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at a lot of these class-omise-payment-xxxxx.php
files, there is a lot of replication. Should we consider a hierarchy of classes here - to prevent further duplication and simplify existing classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also see some part of the code that could be lean a bit more (__construct
, charge
, and result
methods). But as for business perspective, probably not so efficient if we to do it at this time (as refactoring will take a lot of time to discuss and review).
But noted and acknowledged that we could improve those class-omise-payment-xxxxx.php
classes a bit more.
I'll look into it after #149, #152 and one more coming PR, "API localization" get merged and released.
Thanks 👍
omise-woocommerce.php
Outdated
@@ -81,6 +81,7 @@ public function init() { | |||
register_omise_creditcard(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like we should have a list of payment methods, then iterate over a list to call these register_omise_xxxx
functions. Such a list would also be beneficial for including the files etc. - when a new payment method was added, you could simply add a new name to the list
@@ -139,6 +139,7 @@ | |||
new Omise_Payment_Creditcard, | |||
new Omise_Payment_Installment, | |||
new Omise_Payment_Internetbanking, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here again, feels like this code could be simplified by having a general list of available payment methods somewhere. Then you could just update the list instead of updating this code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonrandy how do you feel about this approach?
https://github.com/omise/omise-woocommerce/pull/153/files
…e way to register a new payment method).
1. Objective
As Omise has been providing a support for PayNow payment method.
This pull request is to integrate the new PayNow payment to WooCommerce plugin.
Related information:
Related issue(s): T19391 (internal ticket)
2. Description of change
At Omise Settings page, you will see a new payment method, "PayNow".
processing
.3. Quality assurance
🔧 Environments:
✏️ Details:
1. Making sure that the payment method's setting is available only on Omise Singapore account.
Using Omise Singapore account

Using Omise Japan account

2. Making sure that once enabled the PayNow payment method, the method will be displayed at WooCommerce Checkout page properly.

3. Making sure that once the order has been placed, a PayNow QR code will be displayed at the Order Received page, scannable.

The example using

QR Reader
application, on iPhoneAn order has been placed with

on-hold
order status.4. Making sure that Omise
charge.complete
event will be caught properly once the payment has been paid.To simulate this situation, firstly Omise Webhook feature must be promptly set with a store's webhook endpoint.

Then to go to Omise Dashboard and mark a particular charge as successful.

Once done, the plugin will be able to catch a

charge.complete
event that has been triggered by Omise, then update an order status accordingly.The following graphic is showing an overview of the payment flow.

4. Impact of the change
None
5. Priority of change
Normal
6. Additional Notes
This pull request is providing the least basic feature of PayNow payment method.
There are still numbers of thing that can be added to make its experience better however will be discussed and implemented later.
i.e.
An input from Irista suggested a counting down mechanism to automatically cancel the payment & order after a certain time if the payment hasn't been paid (10-15 minutes).
Adding more text or footnote to provide an instruction of how to use PayNow.
Including QR code to the WooCommerce Order Confirmation email.
and so on.