Sale
Hosted Payment Form (Sale)
Prerequisites
SECRET_KEY
, WEBHOOK_SECRET_KEY
provided by Datman.Process Flow Diagram
Environments
Environment | Base URL |
---|---|
Sandbox | https://ws2-payments.datmanpay.com |
Production | http://payments.datmanpay.com |
Step-by-Step Integration Guide
1. Prepare Your Payload
Key | Description | Required / Optional | Example |
---|---|---|---|
host | The host URL (usually your website or callback origin) | Required | sandbox.example.com |
merchant_id | Unique merchant identifier provided by Datman | Required | 63155480 |
order_id | Unique order identifier for the transaction | Required | 987654321 or '3555f1ab-6e0d-48c3-b9e9' |
customer_id | Unique customer identifier | Optional | 98763455 or CUST98765 |
Customer's email address | Required | john.doe@example.com | |
phone_number | Customer's phone number in international format | Required | +447911123456 |
name | Merchant's Business name | Optional | Adam's Kitchen |
amount | Transaction amount (as string) | Required | 150.75 |
avs_house_number | House number for address verification | Optional | 221B |
avs_postcode | Postal code for address verification | Optional | NW16XE |
merchant_reference | Reference string for merchant tracking | Optional | REF123456 |
redirect_url | URL where the user will be redirected after successful payment | Required | https://example.com/success |
cancel_url | URL where the user will be redirected if they cancel the payment | Required | https://example.com/cancel |
webhook_url | URL for webhook callback after payment completion | Required | https://example.com/webhook |
back_url | URL to return the user back to your application if needed | Optional | https://example.com/back |
first_name | Customer's first name | Required | John |
last_name | Customer's last name | Required | Doe |
flat | Flat or apartment number | Optional | 12A |
address1 | Address line 1 | Optional | London |
address2 | Address line 2 | Optional | Baker Street |
split_fee | Array of partner splits with partner_merchant_id, type_id, value, and value_type | Optional (if revenue split needed) | [ { "partner_merchant_id": "MID_001", "type_id": "2", "value": "10.50", "value_type": "amount" } ] |
2. Encrypt Your Payload
3. Construct the Hosted Payment URL
https://<BASE_URL>/opto/card.php?data=<ENCRYPTED_DATA>
Example:
https://ws2-payments.datmanpay.com/opto/card.php?data=U2FtcGxlRW5jcnlwdGVkRGF0YQ==
4. Redirect the User
After payment completion:
redirect_url
cancel_url
Error Handling
Error Code | Reason | Suggested Action |
---|---|---|
Unable to process this request! | Missing required key | Verify that all required keys are present |
Invalid secret | Invalid encryption or secret mismatch | Check your secret key length and initialization vector (IV) |