Open the hosted payment form (Sale)
/opto/card.phpRedirect the shopper's browser to this URL to take a card payment on Datman's hosted payment form. Build the URL on your server: encrypt a HostedPaymentPayload (the order, the shopper and your redirect and webhook URLs) with your secret key, and pass it as data together with your pub_key. There is no API key header.
After the payment the shopper is sent to redirect_url (success) or cancel_url (cancelled). Always take the final status from the payment status webhook sent to webhook_url, not from the redirect. See the Hosted payment guide for the encryption code.
Endpoint destination URL
https://sandbox-payments.datmanpay.com/opto/card.phpRequest Parameters
data*stringYour HostedPaymentPayload as JSON, encrypted with AES-256-CBC using your secret key, then base64-encoded twice (see the guide). URL-encode it when you build the URL.
pub_key*stringYour public key, issued by Datman together with your secret key. Datman uses it to find the secret that decrypts data.
Payload fields
The JSON you encrypt into data. The guide shows how to encrypt it.
hoststringrequired
Your website's host, without http:// or https://.
merchant_idintegerrequired
The Datman merchant the payment is for.
order_idstring | integerrequired
Your unique order identifier.
customer_idstring | integerrequired
Your identifier for the shopper. Saved cards are linked to it and can be reused for the same shopper later.
emailstringrequired
The shopper's email address.
Format: email
providerstringrequired
The provider value Datman gave you.
phone_numberstringrequired
The shopper's phone number, in international format.
namestring
The merchant's business name.
amountstringrequired
The amount to charge, in major units, as a string.
avs_house_numberstring
House number, for address verification.
avs_postcodestring
Postcode, for address verification.
merchant_referencestring
Your own reference for the payment.
redirect_urlstringrequired
Where the shopper goes after a successful payment. Use HTTPS.
Format: uri
cancel_urlstringrequired
Where the shopper goes if they cancel. Use HTTPS.
Format: uri
webhook_urlstringrequired
Where Datman sends the payment status webhook. Use HTTPS. Treat the webhook, not the redirect, as the final status.
Format: uri
back_urlstringrequired
Where the shopper goes if they choose to go back to your site.
Format: uri
first_namestringrequired
The shopper's first name.
last_namestringrequired
The shopper's last name.
flatstring
Flat or apartment number.
address1string
Address line 1.
address2string
Address line 2.
statement_descriptorstring
Text on the shopper's card statement. Unsupported characters are removed and it's cut to 22 characters.
Max 22 characters
statement_descriptor_addressstring
Second statement line, such as a town. Unsupported characters are removed and it's cut to 20 characters.
Max 20 characters
split_feearray<HostedSplitFee>
Pay part of the amount to other Datman merchants, for example a delivery fee to the delivery partner.
split_fee[].partner_merchant_idstring | integerrequired
The merchant_id that receives this part of the payment.
split_fee[].type_idstring | integerrequired
Commission type: 1 Food/Goods, 2 Marketplace Fee, 3 Delivery Fee, 4 Delivery Tip, 5 Restaurant Tip, 6 Service Charge.
split_fee[].valuestring | numberrequired
The amount, or the percentage when value_type is percentage.
split_fee[].value_typestringrequired
One of: amount, percentage
Response parameters & Errors
An HTML page that sends the shopper's browser straight on to the payment form. If the request can't be processed, the page shows an error message instead, for example "Unable to process this request!" (a required key is missing, or data doesn't decrypt with your secret) or "Online payment not available for this merchant account!".
response?stringtext/html
