Did u know? Now
we can generate the Payment QR code in salesforce using google
chartAPI.
QR codes, also referred to as hardlinks or physical
world hyperlinks, have gained widespread popularity as a form of
two-dimensional barcode. They have the capacity to store a versatile range of
up to 4,296 alphanumeric characters, allowing them to encode various types of
information such as URLs, contact details, phone numbers, or even literary
works like poems. QR codes can be decoded by optical devices equipped with the
necessary software, which includes dedicated QR code readers as well as mobile
phones.
Syntax
Root URL: https://chart.googleapis.com/chart?
QR code requests support the following URL query
parameters after the ? in the root URL:
Parameter |
Required or Optional |
Description |
cht=qr |
Required |
Specifies a QR code. |
chs=<width>x<height> |
Required |
Image size. |
chl=<data> |
Required |
The data to encode. Data can
be digits (0-9), alphanumeric characters, binary bytes of data, or Kanji. You
cannot mix data types within a QR code. The data must be UTF-8 URL-encoded.
Note that URLs have a 2K maximum length, so if you want to encode more than
2K bytes (minus the other URL characters), you will have to send your data
using POST. |
Steps to generate
the QR Code:
· Login into Salesforceà Go to setup à Go to object Manager
· Choose the Object where you want
to show the QR Code.
· Create one Formula Field à return type should be Text.
· Put the below formula in formula
text box.
o
HYPERLINK("https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl=upi://pay?pa=xxxxxxxxx@ybl%26am="+TEXT(
Amount__c )+"%26pn=SALESFORCEWALLAH%26cu=INR%26tr=001%26tn="+
AccountNumber ,"Download EMI QR ")
· Four Important parameters that
you must have to fill it to see the payment qr code,
o
Cht=qr,
this should always be qr, which defines the type.
o
Pa=your_upi_Id,
you have to put your UPI Id here where you want the payment/money.
o
Cu=INR,
It should be INR only, Cu defines the currency type, what should be the
currency of current transactions.
o
Amount__c
-> This is an salesforce custom field to give the amount of transaction.
· Save the Field and from app launcher go to that object and check.
Demo:
Comments
Post a Comment
Please Write your comment here.