SPL - Secure Pay By Link

SPL - Secure Pay By Link

Secure Pay By Link

Secure Pay By Link (SPL) is a new offering from PayFacto that allows a merchant to defer a SHC session to another time. It does that by creating a link that the cardholder can follow to a hosted page. When the cardholder navigates to the hosted page a SHC session is started. The cardholder can then enter their card information and the payment can be processed.



A link is created by calling the /secure-hosted-checkout/v1/links endpoint. The endpoint is RESTful and will accept a JSON object with the following properties:

  • amount

    • When set to true an amount field will be displayed. The default is false

  • avs

    • Display the address and postal code fields.

    • Valid values are address, postal, and both. The default is none.

  • description

    • A short description of the purpose of the link.

    • Maximum number of characters is 60.

  • email

    • When set to true an e-mail field will be displayed.

    • The default value is false.

  • expires

    • The date and time the link is set to expire in ISO-8601 format (i.e. YYYY-MM-DDTHH:MM:SS.000Z).

    • The default value is 5 minutes into the future.

  • invoiceNumber

    • an invoice number, maximum 25 characters long.

  • language

    • The language to display the default labels and button in.

    • Valid values are en for English and fr for French.

    • The default is en.

  • purchaseAmount

    • If the transaction is a purchase or a preauthorization then the purchase amount is mandatory.

    • The amount given must be in lowest ordinal format (i.e. one dollar is passed in as 100.)

  • transactionType

    • The type of transaction to be performed.

    • Valid values are PREAUTHORIZATION, PURCHASE, and VERIFY.

    • This field is mandatory.

  • uses

    • The number of times a link can be used.

    • The default is 1.


Example

javascript
javascript
const endpoint = 'https://shc.titan.uat.ca.payfacto.cloud/secure-hosted-checkout/v1/links';
const payload = {
  method: 'POST',
  headers: {
    Authorization: 'Basic key_provided_by_payfato',
    'Content-Type': 'application/json; charset=utf-8',
    Accept: 'application/json'
  },
  body: JSON.stringify({
    transactionType: 'PURCHASE',
    purchaseAmount: 1025
  })
};
fetch(endpoint, payload)
  .then(response => {console.log(response.status); return response.json()})
  .then(data => console.log(data))
  .catch(error => console.error(error));

 The response will look something like:
javascript
javascript
{
  "id": "59e36fcb-ff9d-48be-972e-8960a4c8d4ac",
  "username": "v1fr7HMWgDRciXFknRtMtdlw",
  "description": null,
  "expires": "2024-11-04T14:34:14.667Z",
  "uses": "1",
  "usesUsed": "0",
  "purchaseAmount": 1025,
  "transactionType": "PURCHASE",
  "linkUrl": "https://shc.titan.uat.ca.payfacto.cloud/secure-hosted-checkout/secure-hosted-checkout/v1/browser/hosted-pages?link=59e36fcb-ff9d-48be-972e-8960a4c8d4ac"
}
 The properties passed in the request will be echoed back in the response. In addition, there are two additional properties:
  1. usesUsed
    1. gives a count of the number of times the link has been used
  2. linkUrl
    1. contains a link to the hosted page that will service the created link.
The contents of linkUrl can be embedded into any another media, such as an e-mail.
If the user selects that link then will be brought to a hosted page where they can enter their cardholder information in a SHC iframe.

Helper Endpoints


SPL provides several additional endpoints to assist in the care and management of a link. These are:

  • /links/{linkId}

    • Use HTTP GET to retrieve a copy of an existing link.

    • The properties returned are the same as those for link creation.

  • /links/{linkId}/cancel

    • Use HTTP POST to expire a link.

    • No body is required.

  • /browser/links/{linkId}/url

    • Use HTTP GET to retrieve the link to the hosted page as a URL.

    • This URL can be embedded into an HTML page or a browser

  • /browser/links/{linkId}/qrcode

    • Use HTTP GET to retrieve the link to the hosted page as a QR Code.

    • This URL can be embedded into an HTML page or a browser

 

    • Related Articles

    • Apple Pay™ In-App

      Apple Pay™ In-App is integrated to applications in order to facilitate the checkout process by using a mobile device access code or other physical recognition system during an online payment with Apple Pay™. Edit Advantages The main advantages of the ...
    • Google Pay™ Android

      Google PayTM Android offers an easier, more secure way to pay and facilitate the checkout process by using a mobile device access code or other physical recognition system during an online payment. Android Process In order to start accepting Google ...
    • SHP - Secure Hosted Pages

      Secure Hosted Pages Migrating from Legacy Hosted Pages In an effort to simplify redirect, The new Secure Hosted Pages (SHP) is very different from the old version. The new SHP mirrors Secure Hosted Checkout (SHC) fairly closely, making it easier to ...
    • SHC - Secure Hosted Checkout

      Secure Hosted Checkout What is Secure Hosted Checkout? Secure Hosted Checkout (SHC) is a JavaScript library that allows merchants to collect and send cardholder information to PayFacto for authorization (pre-authorization), purchase, or verification ...
    • API v1.0 - SHC - Secure Hosted Checkout

      About SHC What is Secure Hosted Checkout? Secure Hosted Checkout (SHC) is a JavaScript library that allows merchants to collect and send cardholder information to PayFacto for verification without needing to access that information directly. When ...