Troubleshooting
If you are having difficultly integrating the Payment Modal, please read through the troubleshooting guides below.
Form Implementation
- Nothing Happens
- Form Submits
- Can't Initialise Modal
- Required Field Errors
- Token is Invalid
- Token is Expired
- Allocation Errors
Nothing Happens
You are confident you have completed the integration, you visit your test payment page, click to pay, and nothing happens!
Please check the following:
- That you have an input with the class
tmt_payee_name
and a value - That you have an input with the class
tmt_payee_email
and a value
Note that if either or both of these inputs are visible, then a style attribute would be attached to them in the event of no value being supplied. E.g.
<input name="payee_name" type="text" class="form-control tmt_payee_name" style="background: yellow;">
If you have set either or both of these inputs to hidden, then its not immediately obvious if no values are present. It is recommended that you enable Debug mode if this is the case. You should then see output to this effect.
Form Submits
You are confident you have completed the integration, you visit your test payment page, click to pay, and the payment form submits without triggering the modal
Please check the following
- That you have correctly included the Payment Modal scripts
- That no other javascript included on your payment page is triggering errors in console
Init Errors
If you do not init the modal with the mandatory options for the implementation you require, then the modal will be triggered as per the screenshot below informing you which mandatory fields are missing.
This error would be resolved by passing a formId and path to the modal init call, for example:
var tmtPaymentModal = new window.tmtPaymentModalSdk({
path: "tmt-test",
formId: "tmt-payment-form"
})
Required Field Errors
To successfully trigger the Payment Modal, required data must be present and correctly referenced depending on the implementation you are using:
If you do not include all the required fields, the modal will trigger with a error output to indicate the missing fields similar to the below. If you have debug mode enabled, the missing fields will also be output to console.
Invalid Token
To identify yourself to the modal, you need to pass it a valid authstring. Failure to do this will result in output as per the screenshot below.
Should you receive this error, please check the following:
- Are you concatenating the fields in alphabetical order as shown in the examples?
- Are you using the same channel ID as that passed in the form or data object?
- Are you using the base currency for the channel with the ID passed in the form or data object?
- Are you salting the authstring with the channel secret for the channel with the ID passed in the form or data object?
- Have you used the same timestamp in the authstring as the timestamp which is appended to it?
- If you are using additional fields in the authstring, have you declared them in the Verify Option?
Expired Token
To prevent reuse of tokens, they are only valid for 15 minutes. In order to prevent reuse of expired tokens, a timestamp is added to the authstring and then appended to it so that a duplicate authstring can be built API side for comparison. If you fail to append the timestamp, or if it is older than 15 minutes, you will receive output as per the screenshot below:
Should you receive this error, please check the followung:
- Are you using and appending the same timestamp?
- Are you generating a timestamp in GMT?
- Are you ouputting your timestamp in the format YYYYDDMMHIS?
Allocation Errors
If you are using the Data Object Implementation and including Allocations, you may receive output as per the screenshot below after having successfully triggered the modal and entered credit card details:
Should you receive this error, please ensure that the channel that is incurring charges has sufficient funds to meet those charges.
For example, consider a channel with ID = 23, which has a per transaction fee of USD 0.50 and has a credit card percentage of 3.5% applied. The two examples below would result in too little being available to meet those charges:
Example One: Channel 23 receives allocation and incurs charges
- USD 2 is allocated to Channel 23
- Channel 23 is nominated as
charge_channel
- Charges levied against Channel 23 would be USD 4 (3.5% of USD 100 = USD 3.50 + USD 0.50 per transaction fee)
- USD 2 is not sufficient to cover charges of USD 4, error is returned.
{
booking_id: '0',
channels: 2,
currencies: 'USD',
total: '10000',
...
allocations: [{
channels: 23,
currencies: 'USD',
total: 200,
operator: 'flat'
}],
charge_channel: 23
}
Example Two: Channel 23 is master channel and incurs charges
- USD 98 is allocated to Channel 2
- No
charge_channel
defined, so defaults to main channel, which is 23. - Charges levied against Channel 23 would be USD 4 (3.5% of USD 100 = USD 3.50 + USD 0.50 per transaction fee)
- USD 2 remaining after allocating USD 98 to channel 2 is not sufficient to cover charges of USD 4, error is returned.
{
booking_id: '0',
channels: 23,
currencies: 'USD',
total: '10000',
...
allocations: [{
channels: 2,
currencies: 'USD',
total: 9800,
operator: 'flat'
}]
}