omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

Introducing PromptPay payment method (Thailand) #170

Closed guzzilar closed 4 years ago

guzzilar commented 4 years ago

1. Objective

This pull request is introducing PromptPay payment method to Omise-WooCommerce plugin.

Related information: Related issue(s): T22500 (internal ticket)

2. Description of change

Screen Shot 2563-08-17 at 13 23 20 Screen Shot 2563-08-17 at 12 53 51

3. Quality assurance

🔧 Environments:

✏️ Details:

There are 2 aspects that we want to test for this pull request, "merchant's perspective" and "buyer's perspective". All the tests in this section will be separated into 2 situations as mentioned.

Setting up:

  1. Once installed this PR, at the admin page, from sidebar menu Omise > Settings. You will see the PromptPay payment method is listed at the Available Payment Methods table. Click config

    Screen Shot 2563-08-17 at 13 49 04
  2. You may rename or add a payment description at the payment configuration page. Then, check the Enable Omise PromptPay Payment and click Save changes

    Screen Shot 2563-08-17 at 13 49 11
  3. To be able to use the full feature of plugin, you may set the Webhook endpoint to your Omise Account as well.

    Note: As Webhook endpoint requires for HTTPS server. For localhost test, you can use https://ngrok.com tool to simulate for https protocol.

    Screen Shot 2563-08-17 at 13 49 04
  4. Once done, the PromptPay payment method will be listed at the checkout page.

    Screen Shot 2563-08-17 at 14 07 44

Placing Order:

As a buyer:

Once the payment method has been set and enabled. Buyers will be able to placing order using PromptPay payment method at the checkout page.

Screen Shot 2563-08-17 at 14 07 44

After selecting PromptPay as a payment method, PromptPay QR code will be displayed at the WooCommerce Order-Confirmation page (thank-you page), along with the QR code expiry date.

Screen Shot 2563-08-17 at 14 31 28

Important: at this step, there will be AJAX polling request running behind to keep fetch order status every 10 seconds for 10 minutes to check if the payment has been paid (to update the screen accordingly). After 10 minutes, the AJAX will be terminated and displaying "refresh status" on the screen instead.

As well, there will be an email sent to buyer's billing email.

Screen Shot 2563-08-17 at 14 53 52

At this point, user may scan the QR code to pay.

As a merchant:

Once buyers make placed an order using PromptPay payment method, a new order with on-hold status will be created on WooCommerce.

Screen Shot 2563-08-17 at 14 47 38

Complete the payment

As a buyer:

Once the buyer paid for the payment, if payment is successful, there will be a successful payment message appear on the screen.

Screen Shot 2563-08-17 at 15 04 23

Once the buyer paid for the payment, if payment is failed, there will be a failure payment message appear on the screen.

Screen Shot 2563-08-17 at 15 06 08

In case if buyer didn't complete the transaction within 10 minutes, there will be a button refresh status appeared on the screen (this means that the AJAX polling has been terminated. Buyer can click this button to reactivate the AJAX script).

Screen Shot 2563-08-17 at 15 03 11

As a merchant:

In case of payment successful, the order status will be updated to processing.

Screen Shot 2563-08-17 at 15 09 42

In case of payment successful, the order status will be updated to failed.

Screen Shot 2563-08-17 at 15 09 48

4. Impact of the change

None

5. Priority of change

Normal

6. Additional Notes

Nothing.

guzzilar commented 4 years ago

Thanks! @mayurkathale