Initiating transaction with paynow


Hello all,

I am trying to integrate paynow to our platform and I have some questions.
I want to show user an input to enter the amount he wants to deposit and we will have his phone number.
In the documentation I found the form of request ( that should be sent and it doesn’t have any information about user phone number?
How do you find out who is the user whom you should do the transaction?

This is the form of data I am sending to you:
request.put(“id”, integrationId);
request.put(“reference”, depositInit.getId());
request.put(“amount”, depositInit.getAmount());
request.put(“returnurl”, getClientConfiguration().getReturnUrl());
request.put(“resulturl”, getClientConfiguration().getResultUrl());
request.put(“status”, “Message”);

String hash = generateHash(request);
request.put(“hash”, hash);

and I am sending this with post to “

Can someone help me please ?


Hi @betpawa. You can pass data as GET in the return url and result url. This way, when the user is redirected from paynow and when paynow responds, you have enough information to identify the transaction.

Paynow paynow = new Paynow("INTEGRATION_ID", "INTEGRATION_KEY");

String returnUrl = "";
String resultUrl = "";



But we don’t want user to be redirected to paynow website. We want to show user an input for amount of money he/she wants to deposit in our website and rest queries to server to server. Is it possible to do it at all?

Do you have any newer documentation if possible please?


Guys I started using Payment api and now I am using sendMobile() method. But I am getting an exception:
Auth email is required for mobile transactions. Please pass a valid email address to the createPayment method

I am using Java SDK.

Can someone help please. In the documentation authemail is said to be optional.

And one more thing is that in documentation it is written like that:

NOTE: The integration ID being used for a mobile money transaction cannot be in test mode. The integration ID must also have an Ecocash payment method selected for use in the Paynow setup area.

How can we test the integration if we can’t use integration in test mode?


hi @betpawa, here is a working example for mobile payments:
Note, you can only use designated numbers for testing mobile payments found here.

import webdev.core.*;
import webdev.payments.Paynow;
import webdev.payments.Payment;

public class MobilePayment {
    public static void main(String[] args) {
        Paynow paynow = new Paynow(SomeClass.INTEGRATION_ID, SomeClass.INTEGRATION_KEY);

        // Create a mobile payment
        Payment payment = paynow.createPayment("Invoice 32", "[email protected]");

        // Add items to the payment
        payment.add("Bananas", 6);
        // payment.add("Apples", 3.4);

        InitResponse response = paynow.sendMobile(payment, "0771111111", "ecocash");

            // Get the poll url of the transaction so you can check if the payment has been made
            String pollUrl = response.pollUrl();

            System.out.println("Use this to check if paid: " + pollUrl);
        } else {
            System.out.println("There was an error somewhere");


Further to the above, if you are not collecting an email address from your customer and only have their mobile number, please submit [email protected] (eg [email protected]) in place of customer email address and enture that you null route/ black hole the emails on your server. For avoidance of doubt, you should NOT submit the the same email address for all customers/transactions and your mailserver must NOT respond with a bounce (address does not exist) message.