Zapper Integrations
Search…
Zapper Integrations
Introduction
API
Authentication
Invoices
Payments
Refunds
Payment Notifications
HTTP Webhook
Web
Javascript SDK
Library Installation
Payment Widget
Zapper Code
Ecommerce Plugins
Apps
App Links
Powered By
GitBook
Zapper Code
Render a dynamic Zapper QR Code without any of the UI of the Payment Widget
Functions
constructor(target: string | Element, options: ZapperCodeOptions)
1
const
zapperCode
=
new
zapper
.
payments
.
ZapperCode
(
2
"body"
,
3
{
4
merchantId
:
17212
,
5
siteId
:
15076
,
6
amount
:
1.06
,
7
size
:
200
8
}
9
)
Copied!
update(options: ZapperCodeOptions)
Updates the existing on-page Zapper Code with options: amount, reference, etc.
1
...
2
zapperCode
.
update
({
3
amount
:
20.50
4
})
5
...
Copied!
ZapperCodeOptions
Field
Type
Description
merchantId
number
Zapper Merchant ID
siteId
number
Zapper Site ID
amount
number
Amount to be paid
reference
string
Merchant or application reference. This field can be used to account the payment on the merchant integration, e.g. Order number
size
number
Image size for the Zapper Code in pixels
on(event: string, handler: function)
1
...
2
zapperCode
.
on
(
'payment'
,
(
{
status
,
paidAmount
,
zapperId
,
reference
}
)
=>
{
3
console
.
log
(
`
Received payment of
${
paidAmount
}
with reference
${
reference
}
!
`
)
4
})
5
...
Copied!
event: "payment"
Event that is triggered after a successful or declined payment by the user. The Handler is called with a single PaymentResult parameter:
Field
Type
Description
status
number
Status of the payment
paidAmount
number
Amount paid by the user
zapperId
string
Zapper's unique identifier for the transaction
reference
string
Merchant or application reference, specified in the ZapperCodeOptions
Payment Status
StatusId
Description
2
Payment was successful
5
Payment was declined
Other payment statuses are reserved for internal use
Previous
Payment Widget
Next - Web
Ecommerce Plugins
Last modified
2yr ago
Copy link
Contents
Functions
constructor(target: string | Element, options: ZapperCodeOptions)
update(options: ZapperCodeOptions)
on(event: string, handler: function)