Error try the mobile.php example


#1

Hie im trying the mobile example you have and i get this error

An error occured while communicating with Paynow

Notice : Undefined property: Paynow\Core\InitResponse::$error in C:\xampp\htdocs\Paynow\examples\mobile.php on line 36


#2

Hi @naim. In order for you to get a successful result with your test ensure the following:

  1. The email address you use on $payment = $paynow->createPayment(‘REF’, ‘email@example.com’) is the same with the account you are using to test.
  2. Use the phone numbers provided here to test the api on $response = $paynow->;sendMobile($payment, ‘0771111111’, ‘ecocash’);.

If all these are in order and you still get an error, kindly do a var_dump() on the $response object and let me know the specific error you get under “Error”.


#3

Hie adrian

I still getting the same error

An error occured while communicating with Paynow

Notice : Undefined property: Paynow\Core\InitResponse::$error in C:\xampp\htdocs\Paynow\examples\mobile.php on line 36


#4

Hi @naim, assuming that you are working with the file mobile.php in the examples folder of the sdk, add the the line below in line 27:

  • var_dump($response);

What output do you get?


#5

// Initiate a Payment
$response = $paynow->sendMobile($payment, ‘0785293579’, ‘ecocash’);
var_dump($response);

?>

Im trying a different no 0785293579

I get

object(Paynow\Core\InitResponse)#6 (4) { [“data”:“Paynow\Core\InitResponse”:private]=> array(2) { [“status”]=> string(5) “Error” [“error”]=> string(135) “The integration ID specified is currently in test mode. The authemail used must belong to the company in control of the integration ID.” } [“success”]=> bool(false) [“status”]=> string(5) “error” [“errors”:“Paynow\Core\InitResponse”:private]=> array(1) { [0]=> string(135) “the integration id specified is currently in test mode. the authemail used must belong to the company in control of the integration id.” } }

An error occured while communicating with Paynow

Notice : Undefined property: Paynow\Core\InitResponse::$error in C:\xampp\htdocs\Paynow\examples\mobile.php on line 36


#6

The error you get indicates that the email address you are using on line 13 does not correspond with the one you got your integration ID from. Please check for any typos. You can only use that email address with your Intergration ID.

Please note that you need to have an account with paynow.

You can only use the following numbers while in test mode for different test case scenarios:

  • 0771111111 - success
  • 0772222222 - delayed success
  • 0773333333 - user cancelled
  • 0774444444 - Insufficient Balance

#7

@naim This integration is still in ‘test mode’. Test Mode allows you to do your integration testing without having to move actual funds through the gateway. Once you have performed a successful test transaction, you can request that test mode be disabled and you can then perform transactions with real funds.
When an integration is in Test Mode, only use the email address registered on the merchant account will be able to perform a test transaction.
Further to that, if you are using Mobile checkout then the transaction is not actually being passed to the MFS provider (Ecocash) but is instead being simulated. Different mobile numbers are listed so you can simulate each of the potential responses from Paynow.

So in summary, the reason why you are getting the error is because the integration is still in test mode and you are not using the merchant email address (as the customer) when you create the transaction and you are also using a number not catered for by the Ecocash simulator.