The VirtualTerminal UI component lets you embed a payment terminal inside your website or application.

Usage

This component lets you add a robust virtual terminal tool to your pages or apps.

See Library URLs for important information about embedded components library URLs.

Step 1: Include the Payabli component

Add the script to the <body> element of your HTML.

Sandbox
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
</head>
<body>
    <script src="https://embedded-component-sandbox.payabli.com/component.js" data-test></script>
</body>
</html>

You need to include <meta charset="UTF-8"> in the <head> element of your HTML to prevent problems with special characters such as ‘á’ or ‘ñ’.

Step 2: Define the component container

Add the container to your HTML. This <div> tag is where the page renders the component. The ID is the identifier for rootContainer in your component configuration.

Sandbox
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
</head>
<body>
    <div id="pay-component-2"></div>
    <script src="https://embedded-component-sandbox.payabli.com/component.js" data-test></script>
</body>
</html>

Step 3: Configure the component

Define the component configuration in a script block immediately after component.js and create an instance of the component. See the Configuration section for a full reference of options.

Response examples

In the response, the referenceId is the transaction ID you can use for other operations.

Configuration reference

These are the configuration parameters available for the VirtualTerminal component.

The component accepts only the data below. If you need to pass more data than what’s supported, consider using the temporary token flow.

type
string
required

For the VirtualTerminal UI, this value is vterminal.

rootContainer
string
required

Container ID used for the component.

defaultOpen
string

Sets the default payment method that’s shown. Accepted values are: card or ach.

buttonLabelInModal
string

Text label for the action button.

hideComponent
boolean
default:
"false"

When true the component is hidden when it’s instanced.

token
string
required

API token for authentication.

customCssUrl
string

Complete URL of a custom CSS stylesheet to use with the component.

recurringPayment
boolean

When true, enables the recurring payment option in terminal.

oneTimePayment
boolean

When true, enables the one-time payment option in terminal.

lineItems
array of objects

lineItem objects with data related to the line items for the transaction. See lineItem object model for a full reference.

card
object
required

cardService object used to configure accepted card types.

ach
object
required

achService object used to configure accepted ACH types.

paymentMethod
object
required

paymentMethod object with data related to the payment method. Required when saving a payment method or executing a payment. Can be passed to the component via payabliExec method. See paymentMethod Object for a full reference.

customerData
object
required

Customer Object with data related to customer. Can be passed to the component via payabliExec method. Required when saving a payment method. Which fields are required depends on whether the paypoint has custom identifiers. If you aren’t using custom identifiers, then you must include at least one of these values: firstname and lastname, email, or customerId. See customerData (payorData) Object for a full reference.

paymentDetails
object
required

paymentDetails object with data related to the payment. Required when running a payment. Can be passed to the component via payabliExec method. See paymentDetails Object for a full reference.

fallbackAuth
boolean | null
default:
"false"

When true, if tokenization fails, Payabli will attempt an authorization transaction to request a permanent token for the card. If the authorization is successful, the card will be tokenized and the authorization will be voided automatically.

fallbackAuthAmount
number | null
default:
"1.00"

The amount for the fallbackAuth transaction. Defaults to one dollar.

functionCallBackSuccess
function

The callback function called when the component executes successfully.

functionCallBackError
function

The callback function called when the component receives an error. See functionCallBackError response in the next section for a complete reference.

Response object

The Response object received via callback Success function has the following structure:

responseText
string

“Success” or “Declined”

responseData
object

Container for response details.