Crypto API Documentation
How to integrate Crypto API
This is Crypto Page API documentation. In this API, User details will be sent to Charge Money Server with curl request, where as card details will be loaded to Charge Money server. Follow the below steps to integrate hosted page API with Charge Money.
Using curl request
The following parameters should be sent to the hosted page.
Paramters | Required | Data Type | Description |
---|---|---|---|
api_key | Yes | String | API key from your account. |
first_name | Yes | String | First Name |
last_name | Yes | String | Last Name |
address | Yes | String | Full Address of User |
country | Yes | String | 2 letter Country, eg US |
state | Yes | String | State Name, 2 letter for US states, eg CA |
city | Yes | String | Valid City name |
zip | Yes | String | Valid Zip Code |
ip_address | Yes | String | IP address of user device, eg 56.85.205.246 |
Yes | String | Valid Email address of User | |
phone_no | Yes | String | Valid Phone Number of User |
amount | Yes | Decimal | Amount Value |
currency | Yes | String | 3 Digit format, eg USD |
customer_order_id | No | String | Customer order id generated from user side. |
response_url | Yes | String | Response URL where we redirect after transaction process completed. |
webhook_url | No | String | POST URL where we send webhook notification. |
https://dashboard.charge.money/api/test-crypto-transaction
URL -
https://dashboard.charge.money/api/crypto-transaction
Send a Curl request with all the parameters provided to the URL below. We encourage all users to please provide all the necessary fields. All credit card fields in the request parameters must be provided and must be the same information indicated in the cardholder's credit card/billing information.
Response
After you redirect to url payment_redirect_url, a form will be loaded over Charge Money payment page. You will need to fill credit card details if asked
Validation Errors
If in case there will be validation errors in the request, the response will be similar to the following:
{ "status": "fail", "message": "Some parameters are missing or invalid request data, please check 'errors' parameter for more details.", "errors": { "first_name": [ "The first name field is required." ] }, "data": { "order_id": null, "amount": "5", "currency": "USD", "email": "example@mail.com", "customer_order_id": null } }
Successful Response
After a successful request, the response will be returned in JSON format.
{ "status": "3d_redirect", "message": "3DS link generated successfully, please redirect to 'redirect_3ds_url'.", "redirect_3ds_url": "https://dashboard.charge.money/hosted-pay/input-card/8JL81624975054", "customer_order_id": null, "api_key": "your_api_key" }
If the request data contains a valid format, then the above response will be returned. You will need to redirect to “payment_redirect_url” for payment page before “valid_till”.
Response from Charge Money
After Credit card form is completely filled up, the user must press the Pay button. This request will take some time, if user card has 3D secure feature enabled, it will also redirect the process to a 3D secure page, where user will be asked to input PIN or OTP if asked. After the entire process is complete, user will be redirected to the merchant website and will reflect the transaction status.
https://dashboard.charge.money/success?status=success&message=Your%20transaction%20was%20success&order_id=20190000458521&customer_order_id=456789521365If the transaction fails, the user will redirect as well to “response_url” with the response query string similar to the one below:
https://dashboard.charge.money/fail?status=fail&message=Activity%20limit%20exceeded.&order_id=20190000458521&customer_order_id=456789521365
Webhooks
Webhooks events are transaction callbacks that sends notifications of transaction to the merchant server. If you want to receive webhooks, then send "webhook_url" parameter with initial request(See above request example).
Here are the simple explanation of each parameter:
1.) order_id : Transaction reference number of our system. 2.) customer_order_id: Merchant transaction reference. 3.) transaction_status: "success" / "fail". 4.) reason: Response from the bank about transaction status. 5.) currency: Currency of the transaction. 6.) amount: Amount of the transaction. 7.) email: Email of the transaction. 8.) transaction_date: Date of the transaction.
Here are the example of webhook notification request:
{ "order_id": "16249643005FIFA4ARBU", "customer_order_id": "GH56HJ86285CVP", "transaction_status": "success", "reason": "Your transaction has been processed successfully.", "currency": "USD", "amount": "20", "transaction_date": "2021-06-23 04:38:51" }