Skip to content

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

window.PayLink

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": "src=\"https://connectfi-payment-link-public.p\
aygears.net/merchant\"\
style=\"width:100%;height:841.84375px;min-hei\
ght:80vh;border:none;\"\
allow=\"clipboard-read;\
clipboard-write\">",
      "outerText": "",
      "ownerDocument": {},
      "parentElement":
"main#iframe-content.ant-layout-content.css-j
9bb5n",
      "parentNode":
"main#iframe-content.ant-layout-content.css-j
9bb5n",
      "part": [],
      "previousSibling": {},
      "privateToken": "",
      "referrerPolicy": "",
      "sandbox": [],
      "scrollHeight": 842,
      "scrollLeft": 0,
      "scrollTop": 0,
      "scrollWidth": 418,
      "scrolling": "",
      "sharedStorageWritable": false,
      "slot": "",
      "spellcheck": true,
      "src":
"https://connectfi-payment-link-public.paygea
rs.net/merchant",
      "srcdoc": "",
      "style": {},
      "tabIndex": 0,
      "tagName": "IFRAME",
      "textContent": "",
      "title": "",
      "translate": true,
      "virtualKeyboardPolicy": "",
      "width": "",
      "writingSuggestions": "true"
    }
  ]
}

Methods

Method Name Parameter Descriptions Description Example
CreatePayment
[
{
"title": "params",
"type": "object",
"nullable": false,
"example": {
"containerId":
"containerId123",
"token":
"Very1Long2Token3String4Mercha
nt"
}
}
]
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(
  {
   "containerId": "containerId123",
   "token": "Very1Long2Token3String4Merchant"
  }
);
StartPayment
[
{
"title": "params",
"type": "object",
"nullable": false,
"example": {
"containerId":
"containerId123",
"token":
"Very1Long2Token3String4Mercha
nt"
}
}
]
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(
  {
   "containerId": "containerId123",
   "token": "Very1Long2Token3String4Merchant"
  }
);
updateCreatePaymentToken
[
{
"title": "token",
"type": "string",
"nullable": false,
"example":
"Very1Long2Token3String4Mercha
nt"
}
]
Will update the merchant token sent in /public/merchant requests using the specified token parameter. This method is public. window.PayLink.updateCreatePaymentToken("Very1Long2Token3String4Merchant");
on
[
{
"title": "event",
"type": "string",
"nullable": false,
"example": "loaded"
},
{
"title": "callback",
"type": "function",
"nullable": false,
"example": "() => {
//do something
}"
}
]
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
[
{
"title": "event",
"type": "string",
"nullable": false,
"example": "loaded"
},
{
"title": "callback",
"type": "function",
"nullable": false,
"example": "() => {
//do something
}"
}
]
A window.PayLink.off('event-name', callback) call will remove the given callback from the specified event listener. window.PayLink.off("loaded",() => {
        //do something
    });