Skip to content

PayNow, adding a link to the QR code url at the order-confirmation email#185

Merged
mayurkathale merged 3 commits intomasterfrom
paynow-email
Sep 28, 2020
Merged

PayNow, adding a link to the QR code url at the order-confirmation email#185
mayurkathale merged 3 commits intomasterfrom
paynow-email

Conversation

@guzzilar
Copy link
Copy Markdown
Contributor

1. Objective

Currently when placing an order using PayNow payment method, the QR code will be shown only on the order-received (thank-you) page.

This pull request is adding the QR code's link to the WC order-confirmation email as well.

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

2. Description of change

Adding a QR code link to the order-confirmation email when placing a new order using PayNow payment method.

3. Quality assurance

🔧 Environments:

  • WooCommerce: v4.3.0
  • WordPress: v5.4.2
  • PHP version: 7.3.3

✏️ Details:

An order-confirmation email that is sent by placing a new order using PayNow payment method should contain a link to the PayNow QR code.
Screen Shot 2563-08-18 at 05 03 43

4. Impact of the change

Nothing

5. Priority of change

Normal

6. Additional Notes

None

<div class="omise omise-paynow-qrcode">
<img src="<?php echo $qrcode; ?>" alt="Omise QR code ID: <?php echo $charge['source']['scannable_code']['image']['id']; ?>">

if ( 'view' === $context ) : ?>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should exclude this part if order placement has failed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Am I understanding correctly that you mean when buyer attempts to scan the QR code and get failed status back from Charge API?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sorry for the confusion, I wanted to add this comment into other part. consider this for line no 97.

<?php echo __( 'Scan the QR code to pay', 'omise' ); ?>
</p>
<div class="omise omise-paynow-qrcode">
<img src="<?php echo $qrcode; ?>" alt="Omise QR code ID: <?php echo $charge['source']['scannable_code']['image']['id']; ?>">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This link downloads the QR image directly which is likely isn't standard flow. Should we create a public link to new page and display QR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I actually was 50/50 about this... One side kinda assume that to pay a QR code, probably buyer does not need to open an entire website to scan a code (also it's easier to implement). Another side, for its credibility, maybe we need to render the webpage.

What do you think?

Copy link
Copy Markdown
Contributor

@mayurkathale mayurkathale left a comment

Choose a reason for hiding this comment

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

Few comments above.

</div>
</div>
<?php
<?php elseif ( 'email' === $context ) : ?>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be excluded from email content if the charge with failed status.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From the implementation, buyers will not get into this part of code (thank-you page) if the charge status is failed.
Did you get the result otherwise? (maybe I missed some cases...)

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.

3 participants