Error when testing ecocash payments on integration


#1

I’m getting this error whenever I try to make a payment through ecocash: transactor’s number should be numeric. I have tried several times with other phone numbers but it seems there’s a problem with my integration


#2

Hello there, please specify which SDK you are using and also provide a code snippet. Paste your output as well if possible, that would make it easy for someone to assist you


#4
<?php $id = "****"; $reference= $_POST['reference']; $amount= $_POST['amount']; $additionalinfo="None"; $returnurl= "https://thehousinghub.ml/****"; $resulturl="https://thehousinghub.ml/****"; $status="Pending"; $IntegrationKey = "4c4***************************"; $values = $id.$reference.$amount.$additionalinfo.$returnurl.$resulturl.$status.$IntegrationKey; $hash = hash("sha512", $values); $hash = strtoupper($hash); $data = array( 'id' => $id, 'reference' => $reference, 'amount' => $amount, 'additionalinfo' => $additionalinfo, 'returnurl' => $returnurl, 'resulturl' => $resulturl, 'status' => $status, 'hash' => $hash ); # Create a connection $url = 'https://www.paynow.co.zw/interface/initiatetransaction'; $ch = curl_init($url); # Form data string $postString = http_build_query($data, '', '&'); # Setting our options curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postString); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); # Get the response $response = curl_exec($ch); $response = urldecode($response); parse_str($response, $output); echo $output['browserurl']; curl_close($ch); ?>`Preformatted text`

#5

@Takue your code doesn’t not have a “phone” field , you are not sending a phone number to request an Ecocash transaction. It doesn’t seem like you are using our PHP SDK give it a try it can be found here https://developers.paynow.co.zw/docs/php_quickstart.html


#6

Hello Harvey. I’m sending the payment request to accept vpayments, ecocacash, telecach etc. I changed my code and used the php sdk as you suggested, but still I get the “transactor’s” mobile number should be numeric error. I do not think this is a problem with my code, but maybe an integration error. The payment link is being received successfully, opening and leading to the paynow payments page just fine, and the issue is coming after entering the mobile number when the prompt leads to the aforementioned error after keying in the pin. Thank you for taking the time to assist me. Here is my php code snippet

<?php ini_set('display_errors', 1); require_once 'autoloader.php'; $paynow = new Paynow\Payments\Paynow( '****', '4c425b44-b82b-49***********', 'https:thehousinghub.co.zw......', 'https:thehousinghub.co.zw.......' ); $payment = $paynow->createPayment('Invoice 35', 'mctaruk@gmail.com'); $payment->add('Booking Fee', 10); $response = $paynow->send($payment); if($response->success()) { // Or if you prefer more control, get the link to redirect the user to, then use it as you see fit $link = $response->redirectUrl(); echo $link; $pollUrl = $response->pollUrl(); } ?>

#7

@Takue did you manage to resolve your error?