Hosted Forms
For clients who are not PCI-DSS certified we offer a Hosted forms solution which allows customer card details to be sent directly to our API via an iFrame integration.
This multi-step process is outlined in the diagram below:
;
After authentication, an API call is made to the Gateway API. This request includes most of the necessary details for processing the payment, except for the payment method. In response, the Gateway API provides a hosted form URL, which you can embed as an iframe within your payment page. This iframe collects the sensitive card details and, once submitted, securely passes them to our API to complete the payment process.
If a URL is provided in the urls.hosted_forms.success property then we will return your payer to this URL once the card details are collected. You MUST redirect the payer on to the authorize URL to complete the payment flow.
If the urls.hosted_forms.success property is not included in the request we will redirect the payer onto the authorize URL automatically.
Notifications are sent via webhooks to the URL specified in the request payload.
Storing card details
A Hosted Forms payment can be the initial customer-initiated transaction in a credential-on-file series, and can store the card details the payer enters in our Vault.
To do this, send a method object with create_vault_instrument set to true and no type, and include:
- the
credential_on_fileobject, withinitiatorset tocustomerandstageset toinitial - a
urls.vault.webhookURL - the
urls.hosted_formsURLs
Once the payment is captured, the card details are stored and an instrument_created webhook is sent to urls.vault.webhook, as described in When processing a payment. Nothing is stored if the payment is not captured.
Until the payer submits their card details, method is returned as null when retrieving the payment, and the hosted_forms link is included in _links.
{
...
"method": {
"create_vault_instrument": true
},
"credential_on_file": {
"initiator": "customer",
"intent": "unscheduled",
"stage": "initial"
},
...
"urls": {
"hosted_forms": {
"success": "https://success.com",
"failure": "https://failure.com"
},
"vault": {
"webhook": "https://example.com/paytently/webhooks"
},
...
}
...
}
A Hosted Forms payment can only be the initial payment in a credential-on-file series. Setting credential_on_file.stage to subsequent is rejected with stage_invalid. Make subsequent payments with the stored vault instrument, as described in Payments using our Vault.