Step 3: Invoke the JS Library
Any clickable function can be used to invoke the PayNearMe JS library and pass in the configured parameters of PMN.init
. PayNearMe’s code can connect to click handler functions on your page once the ID of the clickable element is set to the name of the action defined in the PMN.init
script. The following code snippet displays these configurable named actions (i.e., Pay
, Disburse
, Add_Card
, and Add_Bank_Account
):
"actions": {
"Pay": {
"action": "pay",
"debit": true,
"credit": true,
"ach": true,
"apple_pay": true,
"google_pay": true,
"paypal": true,
"venmo": true,
"cash": true
},
"Disburse": {
"action": "withdrawal",
"debit": true
},
"Add_Card": {
"action": "tokenize",
"debit": true,
"credit": true
},
"Add_Bank_Account": {
"action": "tokenize",
"ach": true
}
}
Alternatively, you can manually call PNM.launch('name')
where ‘name’ is the name of the action defined in PMN.init
(e.g., PNM.launch(‘Pay’)
).
Updated 6 months ago