Error Hashes not matching. Testing


#1

I keep getting the error on mobile payments," Hashes not matching (code provided below)"
I have used the same cod exactly as in the docs
I am running version 1,0.9
I have tried new keys, new intergration to no avail.

indent preformatted text by 4 spaces

const { Paynow } = require(“paynow”);
let paynow = new Paynow(
process.env.INTEGRATION_ID,
process.env.INTEGRATION_KEY
);

const processPayment = (ecocashNumber, product, productPrice) => {
let payment = paynow.createPayment(“Invoice 1”, process.env.AUTH_EMAIL);
payment.add(“Bananas”, 2.5);
payment.add(“Apples”, 1.0);

paynow
.sendMobile(payment, 0777111111, “ecocash”)
.then(function (response) {
if (response.success) {

    let instructions = response.instructions; 
    let pollUrl = response.pollUrl;

    console.log(instructions);
  } else {
    console.log(response.error);
  }
})
.catch((ex) => {
  // Ahhhhhhhhhhhhhhh
  // *freak out*
  console.log("Your application has broken an axle", ex);
});

}
KINDLY ASSIST


#2

on your auth email , make sure you are putting the email you used for signing up or for logging in , not any email. that would solve your issue


#3

I am only using the same email,
Its still not working


#4

ok , can you post your full code here so that i can have a closer look at it . maybe i will also send how i did it so that you can have a look at it


#5

Hi
I was now using a button for the payments but the clients are not welcoming the redirect.

So quick update
When i use the paynow.send method , the test works but when using the sendMobile there is no joy;

 this is the 
    let paynow = new Paynow(process.env.PAYNOW_ID, process.env.PAYNOW_KEY);

  //for email iused the email related to my paynow acc
    let payment = paynow.createPayment("Invoice 35", "email used to register acc");
   
    payment.add("Bananas", 2.5);
    payment.add("Apples", 3.4);

   
    paynow.sendMobile(payment, "0775231426", "Ecocash").then(async (response) => {
        console.log("paymeent processing")
        console.log(response)
        // Check if request was successful
        if (response.success) {
            console.log(response.success)
            //do stuff
           // let instructions = response.instructions
           
        }

    });

#6

I have just had a successful test using 0771111111 as test number


#7

Hi mkawara. This also worked for me, but how do I then make it work with any number?