Skip to content
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

Refresh QR payment screen once customer completes payment #198

Merged
merged 5 commits into from
Dec 1, 2020

Conversation

mayurkathale
Copy link
Contributor

1. Objective

This PR is to removes QR code from order success page and show actual status of payment in real time, once customer scans the QR code and make the payment. Timeout of 10 minutes has been added on the order success page to keep checking status of charge.

Payment Pending screen:

Screen Shot 2020-11-30 at 14 11 29

Payment complete screen:

Screen Shot 2020-11-30 at 14 12 06

Payment timeout screen:

Screen Shot 2020-11-30 at 14 11 14

Related information:
Related issue(s): https://omise.atlassian.net/browse/FES-207

2. Description of change

  • Updated includes/gateway/class-omise-payment-paynow.php template page by adding javascript code which sends xhr request to rest api.
  • Updated includes/class-omise-rest-webhooks-controller.php to add new rest api controller.
  • Modified omise-css.css, added new image file

3. Quality assurance

🔧 Environments:

i.e.

  • WooCommerce: v4.3.0
  • WordPress: v5.4.2
  • PHP version: 7.3.3
  • Omise plugin version: Omise-WooCommerce 4.3 (optional, in case of submitting a new issue)

✏️ Details:

  • Added product to cart.
  • Checkout using Paynow QR payment.
  • Observe order success page.

4. Impact of the change

Order success page should be modified after this PR. It should show actual payment status.

5. Priority of change

Normal

6. Additional Notes

None

@@ -93,7 +93,72 @@ public function display_qrcode( $order, $context = 'view' ) {
<div class="omise omise-paynow-qrcode">
<img src="<?php echo $qrcode; ?>" alt="Omise QR code ID: <?php echo $charge['source']['scannable_code']['image']['id']; ?>">
</div>
<div class="omise-paynow-payment-status">
<div class="pending">
<?php echo __( 'Waiting for payment. Session on this window for payment would timeout in <span id="timer">10:00</span> minutes.', 'omise' ); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "Payment session will time out in..."?

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