Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong implementation of stk push function #30

Open
AustineGwa opened this issue Nov 3, 2018 · 7 comments
Open

Wrong implementation of stk push function #30

AustineGwa opened this issue Nov 3, 2018 · 7 comments

Comments

@AustineGwa
Copy link

The implementation of stk push function does not match the documentation in the developer portal
Timestamp parameter is missing and there is an added remarks parameter that does not exist in the documentation

this is what the documentation says:
<?php

$curl_post_data = array(
//Fill in the request parameters with valid values
'BusinessShortCode' => ' ',
'Password' => ' ',
'Timestamp' => ' ',
'TransactionType' => 'CustomerPayBillOnline',
'Amount"' => ' ',
'PartyA' => ' ',
'PartyB' => ' ',
'PhoneNumber' => ' ',
'CallBackURL' => 'https://ip_address:port/callback',
'AccountReference' => ' ',
'TransactionDesc' => ' '
);

$data_string = json_encode($curl_post_data);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);

$curl_response = curl_exec($curl);
print_r($curl_response);

echo $curl_response;
?>

@kyien
Copy link

kyien commented Sep 12, 2019

true it keeps throwing error when you add the remarks field

@jaymoh
Copy link

jaymoh commented Oct 6, 2019

Was this one fixed?

Also, still on the function STKPushSimulation while the TransactionDesc is set in the function parameters, It's not being sent to the server, what is the point? But this line can easily be changed by developers. 'TransactionDesc' => $TransactionType

Another thing I don't understand is the timestamp generation: why the concatenation?
$timestamp='20'.date( "ymdhis");

@StanleyMasinde
Copy link

@AustineGwa was it fixed?

@mossey
Copy link
Contributor

mossey commented Jan 6, 2021

@AustineGwa @StanleyMasinde @kyien
Let me have a look into this and will update on the progress in a day.

1 similar comment
@mossey
Copy link
Contributor

mossey commented Jan 6, 2021

@AustineGwa @StanleyMasinde @kyien
Let me have a look into this and will update on the progress in a day.

@mossey
Copy link
Contributor

mossey commented Jan 6, 2021

@jaymoh ,
This concatenation is to generate time in the form of YYYYMMDDHHmmss

@StanleyMasinde
Copy link

That's great @mossey. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants