Javascript
Last updated
Last updated
To use the Javascript of the Pay Button, start by adding this script in your website’s HTML.
render
Name | Required | Type | Default Value |
---|---|---|---|
A receiver’s address that is compatible with a selected blockchain network
The amount of dollar (Fiat) that a receiver will receive
The type of blockchain network that the symbol of the token is included
The symbol of token that will actually be sent to the receiver
A label of the button
Option to display the label of the button. The default value is ‘TRUE’.
The background color of the button
Text color of the button
Function(s) that will be executed when the payment is successful.
When the payment is successful, values listed below are transferred.
Function(s) that will be executed when the payment is NOT successful. It will not be executed when there is a problem with the parameters of the button.
Parameters that the function receives is the explanation of the error.
The function that is executed when the button is loaded.
Name | Type | Description |
---|---|---|
receiver
true
string
null
amount
true
string
null
currency
true
string
‘USDC’
chainNetwork
false
string
‘SOLANA’
label
false
string
‘PAY’
useLabel
false
boolean
true
buttonColor
false
string
‘#1149FF’
buttonTextColor
false
string
‘#FFFFFF’
onLoad
false
function
null
onPayment
false
function
null
onError
false
function
null
sender
string
Sender’s public key
amount
string
The amount of USD sent
chainNetwork
string
The type of blockchain network that the symbol of the token is included. (i.e. SOLANA, BSC…)
currency
string
The ticker of token that is sent.
txId
string
Transaction id