question

jbbdev avatar image
jbbdev asked jbbdev commented

QR Code Generation

Hi, I am working on allowing customers to scan a QR code from the receipt. I have followed this doc https://docs.clover.com/docs/smart-receipts#enabling-smart-receipts.

I have filled in the smart receipt info as follows in the receipt customizations.
Smart Receipt Text: Hello world
Smart Receipt URL: http://XXX.herokuapp.com/QRCode

The smart receipt URL is to an endpoint I am hosting that accepts parameters like this:
http://XXX.herokuapp.com/QRCode?m=MERCHANT_ID&o=ORDER_ID&p=PAYMENT_ID&c=p

Where m, o, p, and c, are String values, and the endpoint returns a JSON response for now.

{"merchantID":"MERCHANT_ID","orderID":"ORDER_ID","paymentID":"PAYMENT_ID","receiptContext":"p"}

I emailed a receipt to myself after making a purchase on my Dev Kit and this is what I get.

whereqrcode.jpg


From https://docs.clover.com/docs/smart-receipts#web-receipts:
"On a web receipt, the name of your application appears after the receipt details. An iframe element contains the content associated with the Smart Receipt URL you provide.

The iframe's alt attribute value is the smart receipt text."

The name of my application does appear (crossed out in red), but no content is produced.

Why is no content produced?

Thanks for any help you can provide!

clover developer communityPrintDevKit
whereqrcode.jpg (42.6 KiB)
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
jbbdev avatar image
jbbdev answered jbbdev commented

Just wondering if anyone is looking into this or can assist me?

4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·
Are you certain your server is returning content?
0 Likes 0 ·
jbbdev avatar image jbbdev David Marginian ♦♦ commented ·

For this request http://XXX.herokuapp.com/QRCode?m=MERCHANT_ID&o=ORDER_ID&p=PAYMENT_ID&c=p. I return the following JSON response:

                     
  1. { "merchantID":"MERCHANT_ID","orderID":"ORDER_ID","paymentID":"PAYMENT_ID","receiptContext":"p"}

Is this enough for 'content' to generate a QR code? Or do you see something wrong with my URL? It is a GET request.

It's also weird that my smart receipt text 'Hello World' does not appear, as I would expect it to based on this from the docs "The iframe's alt attribute value is the smart receipt text."

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ jbbdev commented ·

I have never used Smart Receipts, but I am pretty sure your server/url is supposed to return the content to display (the qr code, whatever), not return JSON.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community