All requests to the 바로딜 API are sent via the HTTP POST method to one of our API endpoint URLs.
Register as a merchant in our system. In your merchant dashboard you will find the option for API access key.
Example access key : 51a4bd18-5bc1-4eaa-97b0-c09323398883
The following example code enables you to initiate a payment,depending on how you structure it. The perameter details are also below.
Param Name | Param Type | 설명 |
---|---|---|
custom | string | Identification of your end 필수항목 |
amount | decimal | The amount you want to transaction 필수항목 |
details | string | Purchase details 필수항목 |
web_hook | string | Instant payment notification url 필수항목 |
cancel_url | string | Payment cancel return url 필수항목 |
success_url | string | Payment success return url 필수항목 |
customer_email | string | Customer email address 필수항목 |
access_key | string | Send access_key as bearer token with header 필수항목 |
<?php
$parameters = [
'custom' => 'DFU80XZIKS',
'currency_code' => 'USD',
'amount' => 280.00,
'details' => 'Digital Product',
'web_hook' => 'http://yoursite.com/web_hook.php',
'cancel_url' => 'http://yoursite.com/cancel_url.php',
'success_url' => 'http://yoursite.com/success_url.php',
'customer_email' => 'customer@mail.com',
];
$url = 'http://yourwallet.com/payment/process';
$headers = [
"Accept: application/json",
"Authorization: Bearer access_key",
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($parameters));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
?>
//Success Response.
{
"code": 200,
"status": "ok",
"payment_id": "AIYmQIOAz0GlmsjfhgiOeu304",
"message": "Your payment has been processed. Please follow the URL to complete the payment.",
"url":"http://vvip.newgensolution.com/process-checkout?payment_id=AIYmQIOAz0GlmsjfhgiOeu304"
}
//Error Response.
{
"code": 401,
"status": "error",
"message": "Invalid API credentials."
}
//Success Response.
{
"code": 200,
"status": "ok",
"payment_id": "AIYmQIOAz0GlmsjfhgiOeu304",
"transaction": "AIYmQIOAz0G",
"amount": 100.00,
"charge": 5.00,
"currency": "USD",
"custom": "BVSUZ545XCS",
"date" : "22-05-2022"
}
You can verify the payment whether it is valid or not. After successful payment transaction you will have the response where you find the Payment ID. With this payment id and your access key you need make a request to our server for verify the payment. Example code is below.
Payment verify end point : http://vvip.newgensolution.com/payment/check-validity
<?php
$parameters = [
'payment_id' => 'AIYmQIOAz0GlmsjfhgiOeu304',
]
$url = 'http://vvip.newgensolution.com/payment/check-validity';
$headers = [
"Accept: application/json",
"Authorization: Bearer access_key",
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
?>
//Success Response.
{
"code": 200,
"status": "ok",
"message": "Transaction is valid",
}
//Error Response.
{
"code": 401,
"status": "error",
"message": "Invalid API credentials."
}
//or
{
"code": 404,
"status": "error",
"message": "Transaction not found"
}
Following currencies are currently supported in our system. It may update furthur.
Currency Name | Currency Symbol | Currency Code |
---|---|---|
United State Dollar | $ | USD |
European Currency | € | EUR |
Bitcoin | ₿ | BTC |
Japanese Yen | ¥ | JPY |
KOREA WON | ₩ | WON |