1.4.4 Recurring Billing

The endpoint is:
https://apis.ipayafrica.com/payments/v2/transact/cc/recurring

The parameters needed for this are as follows:

Parameter Name Data Type(Data Length) Description Channel(MPESA)
sid alphanumeric (64) The sid from the initiator request responses Y
vid alphanumeric(12) The iPay Merchant vendor id Y
email alphanumeric(30) Customer Email Address Y
cardid alphanumeric(64) The tokenized card Y
phone alphanumeric(15) Customer Telephone number. if no phone number is used.PAD a default number 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: sid, vid, email, cardid and phone it is a HMAC with the sha256 hashing algorithm. Sample PHP script of the same is show below:


<?php
//your SECRET KEY 
$key "SECretKey";
$datastring $sid.$vid.$email.$cardid.$phone;
/*********************************************************************************************************/

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

Response

Expected Response on Successfull card transaction.


{"txncd":"1111111122","qwh":"1000988633","afd":"827071654","poi":"1211883119","uyt":"1431931896",
"ifd":"548464895","agt":"","id":"oid","status":"bdi6p2yy76etrs","ivm":"oid","mc":"100",
"p1":"","p2":"","p3":"","p4":"","msisdn_id":"John Doe","msisdn_idnum":"123456",
"msisdn_custnum":"123456","channel":"Credit_Card"}