PayLink Reference
Constructor
A new instance of the PaymentLink class is available after integrating the Payment Link script into your HTML document and can be referenced using window.PayLink
.
//Automatically available upon Payment Link integration. See the Payment Link Integration Guide for instructions.
Example
Properties
Property table for PayLink
Property | Description | Required | Schema |
---|---|---|---|
iframe | Gets (returns) the Payment Link Iframe object. | No | { "title": "window.PayLink.iframe", "type": "object", "description": "Gets (returns) the Payment Link Iframe object.", "examples": [ { "adAuctionHeaders": false, "align": "", "allow": "clipboard-read; clipboard-write", "allowFullscreen": false, "allowPaymentRequest": false, "attributeStyleMap": { "size": 20 }, "attributes": {}, "autocapitalize": "", "autofocus": false, "baseURI": "https://connectfi-payment-link-sandbox.payge ars.net/", "browsingTopics": false, "childElementCount": 0, "childNodes": [], "children": [], "classList": [], "className": "", "clientHeight": 842, "clientLeft": 0, "clientTop": 0, "clientWidth": 418, "contentEditable": "inherit", "contentWindow": {}, "credentialless": false, "csp": "", "dataset": {}, "dir": "", "draggable": false, "elementTiming": "", "enterKeyHint": "", "featurePolicy": {}, "frameBorder": "", "height": "", "hidden": false, "id": "", "inert": false, "innerHTML": "", "innerText": "", "inputMode": "", "isConnected": true, "isContentEditable": false, "lang": "", "loading": "auto", "localName": "iframe", "longDesc": "", "marginHeight": "", "marginWidth": "", "name": "", "namespaceURI": "http://www.w3.org/1999/xhtml", "nodeName": "IFRAME", "nodeType": 1, "nonce": "", "offsetHeight": 842, "offsetLeft": 240, "offsetParent": {}, "offsetTop": 143, "offsetWidth": 418, "outerHTML": " |
Methods
Method Name | Parameter Descriptions | Description | Example |
---|---|---|---|
CreatePayment | [ |
Initializes the Payment Link Iframe and posts a message to the iframe request base URL (window.PayLink.home) containing the following object: { type: 'pl-create-payment', origin: window.PayLink.origin, containerId: 'containerId123', token: 'Very1Long2Token3String4Merchant' }. The Payment Link Iframe is initialized with a src value of ${window.PayLink.home}/merchant . This method is public and is intended to be used in the merchant portal. |
window.PayLink.CreatePayment({); |
StartPayment | [ |
Initializes the Payment Link Iframe and posts a message to the iframe request base URL (window.PayLink.home) containing the following object: { type: 'pl-start-payment', origin: window.PayLink.origin, containerId: 'containerId123', token: 'Very1Long2Token3String4Merchant' }. The Payment Link Iframe is initialized with a src value of ${window.PayLink.home}/payment . This method is public and is intended to be used in the customer payment window. |
window.PayLink.StartPayment({); |
updateCreatePaymentToken | [ |
Will update the merchant token sent in /public/merchant requests using the specified token parameter. This method is public. | window.PayLink.updateCreatePaymentToken("Very1Long2Token3String4Merchant"); |
on | [ |
A window.PayLink.on('event-name', callback) call will add the specified event listener to the events object (if it does not already exist) and then add the given callback to the event listener. | window.PayLink.on("loaded",() => { //do something }); |
off | [ |
A window.PayLink.off('event-name', callback) call will remove the given callback from the specified event listener. | window.PayLink.off("loaded",() => { //do something }); |