Transfers and Payouts to Mobile Money Wallets
You can withdraw your earning via or our dashboard or using our withdraw API.
Dashboard withdraws
To transfer from the dashboard, Click on Finance->Make a Transfer. Enter the details required; Enter the details and complete you transfer.
Withdraw API
Alternatively, u can make payouts using our Withdraw API. Send the Withdraw load to https://silicon-pay.com/api_withdraw Request ($req). To withdraw money to a user mobile money number, pass this as 'mm' req"=>"mm"
Generate an Authorization Token.
$encryption_key = "Your account Encryption Key";
$secrete_key = "Your Account Secrete key";
$secrete_hash = hash('sha512',$secrete_key);
$headers = [
'encryption_key: '.$encryption_key,
'secrete_hash: '.$secrete_hash,
'Content-Type: application/json'
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://silicon-pay.com/generate_token',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => .$headers,
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Sample "getToken" response
When all the parameters are correct, You shall get a JSON response with a token code. Use thhis token to authenticate your payload when completing a transfer,
{
"code":200,
"status":"successful",
"token":"6dbab67ce7a2a56ad45dff74262aee89f3b17c7f"
}
Make Transfer/ Withdraw to mobile money
This end point is used to send transfer money from your silicon pay wallet to a mobile money account number
// Sample PHP pay Load
$data_req = [
"req"=>"mm",
"currency"=>"transfer-currency",
"txRef"=>"unique tx_ref",
"encryption_key"=>" Your Account Encryption Key",
"amount"=>"transfer Amount",
"emailAddress"=>"user-email-address",
"call_back"=>"your-call-back-url",
"phone"=>"recipient MSISDN number",
"reason"=>"reason for transfer","
debit_wallet"=>"Wallet to debit from"
];
$token = 'Enter token generated from "https://silicon-pay.com/generate_token" end point';
// Now Create a Signature that you shall pass in the header of your request.
$secrete_key ="XXXX";
$encryption_key = "XXXXX";
$phone_number = "XXXX";
$msg = hash('sha256',$encryption_key).$phone_number;
$signature = hash_hmac('sha256',$msg, $secrete_key);
$headers = [
'Authorization: Bearer '.$token,
"signature:". $signature,
'Content-Type: application/json'
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://silicon-pay.com/api_withdraw',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>json_encode($data_req),
CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Parameter Description
# | Parameter | Description |
---|---|---|
1 | encryption_key | Your-Account-Encryption-key". Found on top of your dashboard |
2 | Amount | Amount that you are transfering |
3 | emailAddress | Email Address of the recipient |
4 | phone | MSISDN Phone number of the recipient |
5 | txRef | Unique Transaction Reference | 6 | call_back | Call Back url where we shall push a success notification |
7 | currency | This is the currency in which you are transacting in |
8 | debit_wallet | The wallet that you are debiting this transfer from |
9 | secrete_key | This is the secrete key that you recieved when you had created the account. Keep it safe |
Response
When all the payload parameters are correct, Send back a json response and process your transfer.
{
"status":"successful",
"amount":10000,
"currency":"UGX",
"txRef":"XSD90",
"message":"Transfer accepted",
"account_number":"256704526090",
};
Success Call Back Notification.
Sample response that shall be triggered and sent to the call back url when the transfer is successful
{
"status":"successful",
"amount":"XXXXX",
"currency":"XXXX",
"txRef":"XXXXX",
"message":"Transfer recieved",
"account_number":"XXXXX",
"charge":"XXXX",
"secure_hash":"XXXXX"
};
Failure Call Back Notification.
Sample response that shall be triggered and sent to the call back url when the transfer is has failed
{
"status":"failed",
"amount":"XXXXX",
"currency":"XXXX",
'reason','reason for failure',
"txRef":"XXXXX",
"message":"Transfer failed",
"account_number":"XXXXX",
"secure_hash":"XXXXX"
};
Process IPN/Call Back
A secure hash is sent with the call back data. This is to help you confirm that the call back came from us.
// Recieve IPN.
$body = file_get_contents("php://input");
$dataObject = json_decode($body);
$reference = $dataObject->txRef;
$secure_hash = $dataObject->secure_hash;
$secrete_key ="Enter your account Secrete key";
// Generate a secure hash on your end.
$cipher = 'aes-256-ecb';
$generated_hash = openssl_encrypt($reference, $cipher, $secrete_key);
if($generated_hash == $secure_hash){
// The call back came from us.
// Give value to your customers.
}
Check Transfer Status.
It is good practice to check the tranfer status on our end before giving value to your cuatomers.
// Sample Pay Load
$payload = ["encryption_key"=>"XXXXX"];
//parameters
$transaction_reference = "XXXXX";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://silicon-pay.com/tranfer_status/'.$transaction_reference,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>json_encode($payload),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Sample Check Transfer status Response
Sample response for a successful check transfer status
{"code":200,"status":"SUCCESSFUL","amount":"270800","currency":"UGX"}