Paynow Developer Hub
  • DOCUMENTATION
  • ABOUT
  • HELP
  • FORUMS
  • SIGN UP / SIGN IN

›Library Source Docs

Getting Started

  • Getting started
  • Generating Integration Keys
  • Test Mode
  • Artwork and Buttons
  • PHP
  • .NET
  • Node.JS
  • Python
  • Java
  • WooCommerce
  • Gravity Forms
  • Easy Digital Downloads
  • Shopify
  • Camptix
  • Magento
  • Spring Boot

Links & Buttons

  • Simple Payment Request Button
  • Advanced Payment Request Button
  • Notification, Success & Cancel URLs
  • URL Safe Base 64 Encoding

API Reference

  • System Layout
  • Initiate a transaction
  • Express Checkout Transactions
  • Complete a Transaction
  • Status Update
  • Polling for a Status Update
  • Generating Hash
  • Validating Hash
  • Initiate a Passenger Ticket Transaction

Library Source Docs

  • PHP
  • .NET
  • Node.JS
  • Java

Source Docs for Java Library

Class: webdev.core.CanFail

  • java.lang.Object
    • webdev.core.CanFail
  • Direct Known Subclasses:
    InitResponse, StatusResponse


    public abstract class CanFail
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      private java.util.ArrayList<java.lang.String> _errors
      The list of errors
    • Constructor Summary

      Constructors 
      Constructor and Description
      CanFail() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String Errors()
      Get the errors sent by Paynow
      java.lang.String Errors(char separator)
      Get the errors sent by payment
      void Fail(java.lang.String error)
      Throws an exception for critical errors and stores other non-critical errors
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _errors

        private final java.util.ArrayList<java.lang.String> _errors
        The list of errors
    • Constructor Detail

      • CanFail

        public CanFail()
    • Method Detail

      • Fail

        public final void Fail(java.lang.String error)
        Throws an exception for critical errors and stores other non-critical errors
        Parameters:
        error -
        Throws:
        InvalidIntegrationException
      • Errors

        public final java.lang.String Errors()
        Get the errors sent by Paynow
        Returns:
      • Errors

        public final java.lang.String Errors(char separator)
        Get the errors sent by payment
        Parameters:
        separator -
        Returns:
        The errors from paynow

Class: webdev.core.Constants

  • java.lang.Object
    • webdev.core.Constants


  • public final class Constants
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String MobileMoneyMethodEcocash 
      static java.lang.String ResponseError 
      static java.lang.String ResponseInvalidId 
      static java.lang.String ResponseOk 
      static java.lang.String ResponsePaid 
      static java.lang.String UrlInitiateMobileTransaction 
      static java.lang.String UrlInitiateTransaction 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Constants() 
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ResponseOk

        public static final java.lang.String ResponseOk
        See Also:
        Constant Field Values
      • ResponsePaid

        public static final java.lang.String ResponsePaid
        See Also:
        Constant Field Values
      • ResponseError

        public static final java.lang.String ResponseError
        See Also:
        Constant Field Values
      • ResponseInvalidId

        public static final java.lang.String ResponseInvalidId
        See Also:
        Constant Field Values
      • UrlInitiateTransaction

        public static final java.lang.String UrlInitiateTransaction
        See Also:
        Constant Field Values
      • UrlInitiateMobileTransaction

        public static final java.lang.String UrlInitiateMobileTransaction
        See Also:
        Constant Field Values
      • MobileMoneyMethodEcocash

        public static final java.lang.String MobileMoneyMethodEcocash
        See Also:
        Constant Field Values
    • Constructor Detail

      • Constants

        public Constants()

Class: webdev.core.IResponse

  • All Known Implementing Classes:
    StatusResponse


    public interface IResponse
    Base interface for all response-type classes
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      boolean Success() 
    • Method Detail

      • Success

        boolean Success()

Class: webdev.core.InitResponse

  • java.lang.Object
    • webdev.core.CanFail
      • webdev.core.InitResponse


  • public class InitResponse
    extends CanFail
    This class is a wrapper around the response sent from Paynow when initiating a transaction
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      private java.util.Map<java.lang.String,java.lang.String> Data 
      private boolean HasRedirect 
      private boolean WasSuccessful 
    • Constructor Summary

      Constructors 
      Constructor and Description
      InitResponse(java.util.Map<java.lang.String,java.lang.String> response)
      InitResponse constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected java.util.Map<java.lang.String,java.lang.String> getData() 
      java.util.Map<java.lang.String,java.lang.String> GetData()
      Get the original data sent from Paynow
      protected boolean getHasRedirect() 
      protected boolean getWasSuccessful() 
      private void Load()
      Reads through the response data sent from Paynow
      java.lang.String PollUrl()
      Returns the poll URL sent from Paynow
      java.lang.String RedirectLink()
      Returns the url the user should be taken to so they can make a payment
      protected void setHasRedirect(boolean value) 
      protected void setWasSuccessful(boolean value) 
      boolean Success()
      Gets a boolean indicating whether a request succeeded or failed
      • Methods inherited from class webdev.core.CanFail

        Errors, Errors, Fail
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • Data

        private java.util.Map<java.lang.String,java.lang.String> Data
      • WasSuccessful

        private boolean WasSuccessful
      • HasRedirect

        private boolean HasRedirect
    • Constructor Detail

      • InitResponse

        public InitResponse(java.util.Map<java.lang.String,java.lang.String> response)
        InitResponse constructor.
        Parameters:
        response - Response data sent from Paynow
        Throws:
        InvalidIntegrationException - If the error returned from paynow is
    • Method Detail

      • getData

        protected final java.util.Map<java.lang.String,java.lang.String> getData()
      • getWasSuccessful

        protected final boolean getWasSuccessful()
      • setWasSuccessful

        protected final void setWasSuccessful(boolean value)
      • getHasRedirect

        protected final boolean getHasRedirect()
      • setHasRedirect

        protected final void setHasRedirect(boolean value)
      • Load

        private void Load()
        Reads through the response data sent from Paynow
      • PollUrl

        public final java.lang.String PollUrl()
        Returns the poll URL sent from Paynow
        Returns:
      • Success

        public final boolean Success()
        Gets a boolean indicating whether a request succeeded or failed
        Returns:
      • RedirectLink

        public final java.lang.String RedirectLink()
        Returns the url the user should be taken to so they can make a payment
        Returns:
      • GetData

        public final java.util.Map<java.lang.String,java.lang.String> GetData()
        Get the original data sent from Paynow
        Returns:

Class: webdev.core.StatusResponse

  • java.lang.Object
    • webdev.core.CanFail
      • webdev.core.StatusResponse
  • All Implemented Interfaces:
    IResponse


    public class StatusResponse
    extends CanFail
    implements IResponse
    This class is a wrapper around the status updates sent from Paynow
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      private java.math.BigDecimal Amount
      The total amount of the transaction
      private java.util.Map<java.lang.String,java.lang.String> Data
      The data returned from Paynow
      private java.lang.String Reference
      The unique reference of the transaction
      private boolean WasPaid
      Boolean value indicatiing whether a transaction was paid or not
      private boolean WasSuccessful
      Boolean indicating whether a transaction was successful or not
    • Constructor Summary

      Constructors 
      Constructor and Description
      StatusResponse(java.util.Map<java.lang.String,java.lang.String> response)
      InitResponse constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.math.BigDecimal getAmount() 
      protected java.util.Map<java.lang.String,java.lang.String> getData() 
      java.util.Map<java.lang.String,java.lang.String> GetData()
      Get the original data sent from Paynow
      java.lang.String getReference() 
      boolean getWasPaid() 
      protected boolean getWasSuccessful() 
      private void Load()
      Reads through the response data sent from Paynow
      boolean Paid() 
      java.lang.String PollUrl()
      Returns the poll URL sent from Paynow
      void setAmount(java.math.BigDecimal value) 
      void setReference(java.lang.String value) 
      void setWasPaid(boolean value) 
      protected void setWasSuccessful(boolean value) 
      boolean Success()
      Gets a boolean indicating whether a request succeeded or failed
      • Methods inherited from class webdev.core.CanFail

        Errors, Errors, Fail
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • Data

        private java.util.Map<java.lang.String,java.lang.String> Data
        The data returned from Paynow
      • WasSuccessful

        private boolean WasSuccessful
        Boolean indicating whether a transaction was successful or not
      • Reference

        private java.lang.String Reference
        The unique reference of the transaction
      • Amount

        private java.math.BigDecimal Amount
        The total amount of the transaction
      • WasPaid

        private boolean WasPaid
        Boolean value indicatiing whether a transaction was paid or not
    • Constructor Detail

      • StatusResponse

        public StatusResponse(java.util.Map<java.lang.String,java.lang.String> response)
        InitResponse constructor.
        Parameters:
        response - Response data sent from Paynow
        Throws:
        InvalidIntegrationException - If the error returned from paynow is
    • Method Detail

      • getData

        protected final java.util.Map<java.lang.String,java.lang.String> getData()
      • getWasSuccessful

        protected final boolean getWasSuccessful()
      • setWasSuccessful

        protected final void setWasSuccessful(boolean value)
      • getReference

        public final java.lang.String getReference()
      • setReference

        public final void setReference(java.lang.String value)
      • getAmount

        public final java.math.BigDecimal getAmount()
      • setAmount

        public final void setAmount(java.math.BigDecimal value)
      • getWasPaid

        public final boolean getWasPaid()
      • setWasPaid

        public final void setWasPaid(boolean value)
      • Success

        public final boolean Success()
        Gets a boolean indicating whether a request succeeded or failed
        Specified by:
        Success in interface IResponse
        Returns:
        Boolean value indicating whether a request succeeded
      • Load

        private void Load()
        Reads through the response data sent from Paynow
      • PollUrl

        public final java.lang.String PollUrl()
        Returns the poll URL sent from Paynow
        Returns:
        The poll URL sent from Paynow
      • Paid

        public final boolean Paid()
      • GetData

        public final java.util.Map<java.lang.String,java.lang.String> GetData()
        Get the original data sent from Paynow
        Returns:
        The original data sent from Paynow

Class: webdev.exceptions.EmptyCartException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • webdev.exceptions.EmptyCartException
  • All Implemented Interfaces:
    java.io.Serializable


    public class EmptyCartException
    extends java.lang.RuntimeException
    Exception is thrown when user attempts sending an empty transaction to Paynow
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      EmptyCartException() 
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EmptyCartException

        public EmptyCartException()

Class: webdev.exceptions.HashMismatchException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • webdev.exceptions.HashMismatchException
  • All Implemented Interfaces:
    java.io.Serializable


    public class HashMismatchException
    extends java.lang.RuntimeException
    Exception is thrown when the hash sent by Paynow is not equal to the hash generated locally
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      HashMismatchException() 
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HashMismatchException

        public HashMismatchException()

Class: webdev.exceptions.InvalidIntegrationException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • webdev.exceptions.InvalidIntegrationException
  • All Implemented Interfaces:
    java.io.Serializable


    public class InvalidIntegrationException
    extends java.lang.RuntimeException
    Exception is thrown when user attempts using invalid integration details
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      InvalidIntegrationException() 
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • InvalidIntegrationException

        public InvalidIntegrationException()

Class: webdev.exceptions.InvalidReferenceException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • webdev.exceptions.InvalidReferenceException
  • All Implemented Interfaces:
    java.io.Serializable


    public class InvalidReferenceException
    extends java.lang.RuntimeException
    Exception is thrown when user attempts sending an empty transaction reference to Paynow
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      InvalidReferenceException() 
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • InvalidReferenceException

        public InvalidReferenceException()

Class: webdev.helpers.Extensions

  • java.lang.Object
    • webdev.helpers.Extensions


  • public final class Extensions
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      Extensions() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.math.BigDecimal AddCollectionValues(java.util.HashMap<java.lang.String,java.math.BigDecimal> items) 
      static java.lang.String FlattenCollection(java.util.HashMap<java.lang.String,java.math.BigDecimal> items) 
      static java.lang.String GetString(MobileMoneyMethod method) 
      static java.util.HashMap<java.lang.String,java.lang.String> ParseQueryString(java.lang.String qs) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Extensions

        public Extensions()
    • Method Detail

      • FlattenCollection

        public static java.lang.String FlattenCollection(java.util.HashMap<java.lang.String,java.math.BigDecimal> items)
      • AddCollectionValues

        public static java.math.BigDecimal AddCollectionValues(java.util.HashMap<java.lang.String,java.math.BigDecimal> items)
      • ParseQueryString

        public static java.util.HashMap<java.lang.String,java.lang.String> ParseQueryString(java.lang.String qs)
      • GetString

        public static java.lang.String GetString(MobileMoneyMethod method)

Class: webdev.helpers.Hash

  • java.lang.Object
    • webdev.helpers.Hash


  • public final class Hash
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      Hash() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String GenerateHash(java.lang.String text) 
      private static byte[] GenerateSalt() 
      private static java.lang.String GetStringFromHash(byte[] hash) 
      static java.lang.String Make(java.util.Map<java.lang.String,java.lang.String> values, java.lang.String integrationKey)
      Hash the values in the given map
      static boolean Verify(java.util.Map<java.lang.String,java.lang.String> data, java.lang.String integrationKey)
      Verifies the given hash
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Hash

        public Hash()
    • Method Detail

      • Make

        public static java.lang.String Make(java.util.Map<java.lang.String,java.lang.String> values,
                                            java.lang.String integrationKey)
        Hash the values in the given map
        Parameters:
        values - Values to value
        integrationKey - Paynow integration key
        Returns:
      • GetStringFromHash

        private static java.lang.String GetStringFromHash(byte[] hash)
      • GenerateSalt

        private static byte[] GenerateSalt()
      • GenerateHash

        public static java.lang.String GenerateHash(java.lang.String text)
      • Verify

        public static boolean Verify(java.util.Map<java.lang.String,java.lang.String> data,
                                     java.lang.String integrationKey)
        Verifies the given hash

Class: webdev.http.Client

  • java.lang.Object
    • webdev.http.Client


  • public class Client
    extends java.lang.Object
    Http client
    • Constructor Summary

      Constructors 
      Constructor and Description
      Client() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String PostAsync(java.lang.String url) 
      java.lang.String PostAsync(java.lang.String url, java.util.HashMap<java.lang.String,java.lang.String> data) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Client

        public Client()
    • Method Detail

      • PostAsync

        public final java.lang.String PostAsync(java.lang.String url)
      • PostAsync

        public final java.lang.String PostAsync(java.lang.String url,
                                                java.util.HashMap<java.lang.String,java.lang.String> data)

Class: webdev.payments.MobileMoneyMethod

  • java.lang.Object
    • java.lang.Enum<MobileMoneyMethod>
      • webdev.payments.MobileMoneyMethod
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MobileMoneyMethod>


    public enum MobileMoneyMethod
    extends java.lang.Enum<MobileMoneyMethod>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      Ecocash 
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int SIZE 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static MobileMoneyMethod forValue(int value) 
      int getValue() 
      static MobileMoneyMethod valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MobileMoneyMethod[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • Ecocash

        public static final MobileMoneyMethod Ecocash
    • Field Detail

      • SIZE

        public static final int SIZE
        See Also:
        Constant Field Values
    • Method Detail

      • values

        public static MobileMoneyMethod[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MobileMoneyMethod c : MobileMoneyMethod.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MobileMoneyMethod valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public int getValue()
      • forValue

        public static MobileMoneyMethod forValue(int value)
← Node.JS
Documentation
Getting StartedAPI ReferenceFrequently Asked QuestionsArtwork & Buttons
Libraries & Plugins
PHP.NETNode.JSPythonJava
Plugins
WooCommerceGravity FormsEasy Digital DownloadsShopify
Community
Discussion ForumsBlogs & TutorialsGithubFacebookTwitter
Paynow Zimbabwe
Copyright © 2025 Paynow Zimbabwe