-
Notifications
You must be signed in to change notification settings - Fork 13
STK Request
Mauko Maunde edited this page Jan 8, 2021
·
1 revision
Wrap your request in a try catch to ensure proper error handling
try {
return $res = C2B::stk($phone, $amount, $reference);
// Do something with $res, like save to DB with the $res["MerchantRequestID"] as key.
} catch (\Throwable $th) {
return $th;
}
OR
try {
return $res = STK::send($phone, $amount, $reference);
// Do something with $res, like save to DB with the $res["MerchantRequestID"] as key.
} catch (\Throwable $th) {
return $th;
}
© Osen Concepts Kenya 2020