Token Sale
Hosted Payment Form (Token Sale)
Token sale
Form smoothly and securely. Please read carefully; keys and values are case-sensitive, and small errors can cause transaction failures.Prerequisites
Sale
docsSECRET_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
Sale
documentation, with a few additional keys.Please review the keys below — they represent only the additional parameters required.
Key | Description | Status | Example |
---|---|---|---|
token | The host URL (usually your website or callback origin) | Required | https://sandbox.example.com |
token_avs | Unique merchant identifier provided by Datman | Required | MID123456789 |
last4_digits | Last 4 digits of card | Required | 9876 |
customer_id | Unique customer identifier | Required | 98763455 or CUST98765 |
2. Encrypt Your Payload
Node.js Encryption Example:
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) |