Just request to that endpoint with all parameter listed below:
Parameter | Details |
---|---|
amount | Your Amount , Must be rounded at 2 precision. |
currency | Currency Code, Must be in Upper Case. Supported Currency : EUR INR USD
|
details | Details of the Transaction. string not more than 100 char. |
custom | Custom Code/Transaction Number for Identify at your end. string not more than 16 char. |
ipn_url | URL of your IPN Listener |
success_url | Redirect url after successful Payment |
cancel_url | Redirect url after Cancel the Payment |
public_key | Your API Public Key |
name | Name of the Client. string not more than 100 char. |
Email of the Client. string not more than 100 char. |
** All Parameters are required!
// create array With Parameters $parameters = array( 'amount' => '10.33', 'currency' => 'USD', 'details' => 'Purchase Software', 'custom' => 'ABCD1234', 'ipn_url' => 'http://www.abc.com/ipn.php', 'success_url' => 'http://www.abc.com/success.php', 'cancel_url' => 'http://www.abc.com/cancelled.php', 'public_key' => 'ABCDEFGH123456789', 'name' => 'Mr. ABC XYZ', 'email' => '[email protected]' ); // Generate The Url (LIVE) $endpoint = 'http://blast.thesoftking.com/premium/truewallet/express/initiate'; $call = $endpoint . "?" . http_build_query($parameters); // Generate The Url (TEST) $endpoint = 'http://blast.thesoftking.com/premium/truewallet/express/sandbox/initiate'; $call = $endpoint . "?" . http_build_query($parameters); // Send Request $ch = curl_init(); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $add); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); $response = curl_exec($ch); curl_close($ch); // $response contain the response from server
{ "error": "error", "message": { "amount": [ "The amount format is invalid." ], "details": [ "The details field is required." ] } }
{ "error": "ok", "message": "Payment Initiated. Redirect to url", "url": "http://blast.thesoftking.com/premium/truewallet/express/payment/UNIQUE_CODE" }
After Successful response from last step, Redirect the User to the URL you get as response. User can transact over our system and we will notify on your IPN after Successful payment. Remember, we send response to IPN only once per successful Transaction.
You will get below parameter on your IPN:
Parameter | Details |
---|---|
amount | Your Requested Amount |
currency | Currency Code, as You passed on first step. |
custom | Custom String for Identify the payment, as You passed on first step. |
trx_num | Transaction Number on our platform. |
signature | A Hash to Verify the Payment. See code on right side to get more on it. |
$amount = $_POST['amount']; $currency = $_POST['currency']; $custom = $_POST['custom']; $trx_num = $_POST['trx_num']; $sentSign = $_POST['signature']; // with the 'custom' you can find your original amount and currency. just cross check yourself. if that check is pass, proceed to next step. // Generate your signature $string = $amount.$currency.$custom.$trx_num; $secret = 'YOUR_SECRET_KEY'; $mySign = strtoupper(hash_hmac('sha256', $string , $secret)); if($sentSign == $mySign){ // if sentSign and your generated signature match, The Payment is verified. Never Share 'SECRET KEY' with anyone else. }