HTML
Last updated
Last updated
The easiest way to add Pay Button to a website is to use HTML.
Before defining the button, start by adding this code to the website in any place.
This script enables a user to produce and modify two main components of Pay Button.
HTML tags with certain properties that function as placeholders of the button; this document will describe how to set this component.
Javascript components for dynamically using and setting global PIP button components; 🔗JAVASCRIPT document will explain this point.
HTML PIP Button is the wrapper with Javascript. Some of the details are skipped in this document, so visit 🔗JAVASCRIPT to find more.
When the document is successfully loaded, the script will automatically detect classes or properties including and converts them to components of PIP Buttons.
A receiver’s address that is compatible with a selected blockchain
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 the token 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
The text that is included in the transaction.
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 |
---|---|---|
data-receiver
true
string
null
data-amount
true
string
null
data-currency
true
string
‘USDC’
data-chainNetwork
false
string
‘SOLANA’
data-label
false
string
‘PAY’
data-useLabel
false
boolean
true
data-buttonColor
false
string
‘#1149FF’
data-buttonTextColor
false
string
‘#FFFFFF’
data-load
false
string
null
data-payment
false
string
null
data-error
false
string
null
data-memo
false
string
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