1.4.3 Trigger STK(SIM ToolKit) Call

URL

https://apis.ipayafrica.com/payments/v2/transact/push/mpesa

The Request is an initiator for an STK push yet to be paid transaction i.e. it Triggers the wallet user's SIM ToolKit for authorization of payment on their handset.

This is only available for MPESA.

The parameters needed for this are as follows:

Parameter Name Data Type(Data Length) Description Channel(MPESA)
phone numeric string (15) The Phone Number of the registered mobile wallet User Y
sid alphanumeric (64) The sid from the initiator request responses Y
vid alphanumeric(12) The iPay Merchant vendor id Y
hash alphanumeric(64) A digital signature hash of the data for verification. Y

The hash is generated from a datastring which is a concatenation of the parameters: phone,sid and vid it is a HMAC with the sha256 hashing algorithm. Sample PHP script of the same is show below:


<?php
//your SECRET KEY 
$key "SECretKey";//use "demo" for testing where vid also is set to "demo"
$datastring $phone.$vid.$sid;
/*********************************************************************************************************/

$generated_hash hash_hmac('sha256',$datastring $key);
/**********************************************************************************************************/
?>

Response

The following is a sample response on Triggering this route.

{
          "header_status":"200", 
          "status":1,
          "text":"A Payment request has been sent to the MPESA number 2547XXXXXXXX"
        }