Data Object

For this implementation, an object containing required properties as defined below is passed to the modal.

On triggering the modal, a booking is placed using data from the object and the user is prompted for their credit card details in order to complete the transaction.

If any of the required data is not present, an error is output detaling the data that is not present.

If transaction fails for some reason, the user is given a further two attempts to make payment before the transaction is failed permanently.

On successful transaction, the user is shown the success dialog.

Required Data

Key Description
booking_auth The hashed and salted authorisation string for the transaction
booking_id Set this to 0 to create a new booking
channels Set this to the ID of the channel you created
country The ISO 3166-1 alpha-2 value of the country the booking takes place in
firstname The firstname of the lead traveller
surname The surname of the lead traveller
email The email address of the lead traveller
payee_name The name of the person making payment as it appears on their credit/debit card
payee_email The email of the person making payment
payee_country The ISO 3166-1 alpha-2 value of the country of the person making payment
date The end date of travel in YYYY-MM-DD format
currencies The ISO 4217 value for the currency the travel item is being sold in (must match the currency of the channel in use)
total The total being billed in the currency shown as a cent value (e.g. $10.00 = 1000)

Address Data

If your account is NOT enabled for Cardholder Present (all accounts are disabled for Cardholder Present by default) then you will need to supply the fields shown in the address data table.

Key Description
payee_address The adress of the person making payment
payee_city The city of the person making payment
payee_postcode The postcode/zip of the person making payment

Optional Data

Key Description
reference Your own reference
description A description of the product being sold
pax The amount of people the product is for

Data Object Example

<button id="trigger-modal" class='btn btn-primary'>Trigger Payment Modal</button>

    window.tmtPaymentModalReady = function () {

        const data = {
            // Booking Data
            booking_id: '0',
            channels: '2',
            country: 'GB',
            date: '2020-05-12',
            currencies: 'GBP',
            total: '9999',
            reference: 'test reference', // optional
            description: 'Some holiday', // optional
            pax: '3', // optional,
            // Authentication
            booking_auth: hashed_salted_auth_string,
            // Lead Traveller
            firstname: 'John',
            surname: 'Smith',
            email: '',
            // Payment details
            payee_name: 'Jane Smith',
            payee_email: '',
            payee_address: '123 test addres',
            payee_city: 'Test city',
            payee_country: 'GB',
            payee_postcode: '1234',

        const button = document.getElementById('trigger-modal')
        button.addEventListener('click', function () {

            var tmtPaymentModal = new window.tmtPaymentModalSdk({
                path: 'test-site',
                data: data

results matching ""

    No results matching ""