1. Get Payment URL

Production
Sandbox
Production
https://checkoutapi.oneglobal.com/MasterV1/
Sandbox
https://checkoutstage.oneglobal.com/MasterV1/

API Endpoints

Production Endpoint
Sandbox Endpoint
Production Endpoint
https://checkoutapi.oneglobal.com/MasterV1/api/GenToken/Validate
Sandbox Endpoint
https://checkoutstage.oneglobal.com/MasterV1/api/GenToken/Validate

Sample Request & Response

Use the below parameters and hashing function for order creation. The request should contain the following inputs to make sure inputs should be encrypted using our hashing function show in the following example to prevent exposure. For parameters description please refer here

Sample Request
Sample Response
Sample Request
"ValidatePaymentRequest" : {
"merchantCode": "xxxxx"
"authKey": "xxxxxxxxx",
"currency": "KWD",
"pc": "KWKFHMPGSCCKWD",
"tunnel": "",
"amount": 1 ,
"doConvert": "N",
"sourceCurrency":"conditional",
"description": "optional",
"referenceID": "(15 digit random number)",
"timeStamp": "yyyy/MM/dd HH:mm:ss tt",
"language": "en",
"callbackURL": "Your website URL",
"hash": "ComputedHash",
"userReference": 0,
"billingDetails":
{
"fName": "First Name",
"lName": "last Name",
"mobile": "mobile",
"email": "email",
"city": "city",
"pincode": "pincode",
"state": "state",
"address1": "address1",
"address2": "address2"
}
}
Sample Response
{
"errorCode": 0,
"errorMessgae": "string",
"result":
{
"redirectURL": "string",
"tokenID": "string",
"orderAmount": 0,
"paidAmount": 0,
"serviceAmount": 0,
"commissionAmount": 0,
"originalAmount": "string"
}
}

Sample Code to post data

C#
VB.Net
PHP
TypeScript
C#
public async Task> ValidatePayment(ValidatePaymentRequest obj)
{
Output dto = new Output();
var url = {Provided End Point};
var client = new HttpClient();
client.BaseAddress = new Uri(url);
try
{
obj.hash = ComputeHash(obj);
var resultser = JsonConvert.SerializeObject(obj);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
var response = client.PostAsJsonAsync(url, obj).Result;
if (response.IsSuccessStatusCode)
{
var ss = response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject>(ss.Result);
dto = result;
}
else
{
var ss = response.Content.ReadAsStringAsync();
var resps = ss.Result.ToString();
}
}
catch (HttpRequestException ex)
{
}
return dto;
}
VB.Net
Class SurroundingClass
Public Task As async
Private Sub New(ByVal obj As ValidatePaymentRequest)
Dim dto As Output = New Output()
Dim url = {Provided End Point};
Dim client = New HttpClient()
client.BaseAddress = New Uri(url)
Try
obj.hash = ComputeHash(obj)
Dim resultser = JsonConvert.SerializeObject(obj)
client.DefaultRequestHeaders.Accept.Add(New System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"))
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8")
Dim response = client.PostAsJsonAsync(url, obj).Result
If response.IsSuccessStatusCode Then
Dim ss = response.Content.ReadAsStringAsync()
Dim result = JsonConvert.DeserializeObject > (ss.Result)
dto = result
Else
Dim ss = response.Content.ReadAsStringAsync()
Dim resps = ss.Result
Dim resultse = JsonConvert.SerializeObject(resps.ToString())
End If
Catch ex As HttpRequestException
End Try
Return dto
End Sub
End Class
PHP
ValidatePayment(ValidatePaymentRequest obj)
{
Output dto = new Output();
var url = \{Provided End Point};
var client = new HttpClient();
client.BaseAddress = new Uri(url);
try
{
obj.hash = ComputeHash(obj);
var resultser = JsonConvert.SerializeObject(obj);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue(\"application/json\"));
client.DefaultRequestHeaders.TryAddWithoutValidation(\"Content-Type\", \"application/json; charset=utf-8\");
var response = client.PostAsJsonAsync(url, obj).Result;
if (response.IsSuccessStatusCode)
{
var ss = response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject>(ss.Result);
dto = result;
}
else
{
var ss = response.Content.ReadAsStringAsync();
var resps = ss.Result;
var resultse = JsonConvert.SerializeObject(resps.ToString());
}
}
catch (HttpRequestException ex)
{
}
return dto;
}\n";
echo "$pagecode";
?>
TypeScript
pagecode:` public async Task> ValidatePayment(ValidatePaymentRequest obj)
{
Output dto = new Output();
var url = {Provided End Point};
var client = new HttpClient();
client.BaseAddress = new Uri(url);
try
{
obj.hash = ComputeHash(obj);
var resultser = JsonConvert.SerializeObject(obj);
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
var response = client.PostAsJsonAsync(url, obj).Result;
if (response.IsSuccessStatusCode)
{
var ss = response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject>(ss.Result);
dto = result;
}
else
{
var ss = response.Content.ReadAsStringAsync();
var resps = ss.Result;
var resultse = JsonConvert.SerializeObject(resps.ToString());
}
}
catch (HttpRequestException ex)
{
}
return dto;
}`;