Credit card collections

Accept Credit Card Payments on your website, App or Blog.

To accept card Payments (VISA, Master Card, American Express) from our API, Create A silicon Pay Account. Visit: https://silicon-pay.com/ to create the account.

Request Type

To For Card Collections collections always pass "req" as card_payment. "req"=>"card_payment". Pass req as mobile_money

General Payload


  // Sample PHP pay Load
  $data_req = [
    "req"=>"card_payment",
    "currency"=>"XXXX",
    "fname"=>"e.g james",
    "lname"=>"e.g Bond",
    "encryption_key"=>"Paste Encryption Key",
    "amount"=>"XXXX",
    "emailAddress"=>"test@gmail.com",
    'call_back'=>"your-call-back-url",
    "success_url"=>"your-success-url",
    "failure_url"=>"your-failure-url",
    "phone"=>"XXXXX",
    ,"description"=>"E.g Collections",
    "txRef"=> "unique tx_ref"
];

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://silicon-pay.com/process_payments',
  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 => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Credit Card Collections

For Credit Card collections, Pass req as card_payment and currency as USD


"req"=>"card_payment"
  "currency"=>"USD"

Parameter Description

# Parameter Description
1 encryption_key Your-Account-Encryption-key". Found on top of your dashboard
2 Amount Amount you are charging the user
3 emailAddress Email Address of the person paying
4 phone MSISDN Phone number of the person paying
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 charging the customer
8 success_url This is a a url on your server where we shall redirect the customer after a successful transaction

Response

When all the payload parameters are correct, Send back a response with a link, You are required to load that link to complete the payment.


{
"status":"200",
"message":"successful",
"link":"https://silicon-pay.com/DirectOrder/56355Erqtt"
}

Success Call Back Notification.

Sample response that shall be triggered and sent to the call back url when the trasanction is successful


  
  {
    "status":"successful",
    "amount":"XXXXX",
    "txRef":"XXXXX",
    "secure_hash"=>"XXXXX"
    }

Recieve 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.
  }