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 Node.js Library

Class: InitResponse

constructor(data: *)

Default constructor

success: boolean

Boolean indicating whether initiate request was successful or not

hasRedirect: boolean

Boolean indicating whether the response contains a url to redirect to

redirectUrl: String

The url the user should be taken to so they can make a payment

error: String

The error message from Paynow, if any

pollUrl: String

The poll URL sent from Paynow

instructions: String

The instructions for USSD push for customers to dial incase of mobile money payments

status: String

The status from paynow

Class: Payment

constructor(reference: String, authEmail: String)

Payment constructor

reference: string

Unique identifier for transaction

items: Array

Items being paid from by client

authemail: String

Email address from client

authEmail: *

add(title: String, amount: Number): Payment

Adds an item to the 'shopping cart'

NameTypeAttributeDescription
titleString
amountNumber

info(): String

Generates the description for the payment

NameTypeAttributeDescription

total(): *|Number

Get the total of the items in the cart

NameTypeAttributeDescription

Class: Paynow

constructor(integrationId: *, integrationKey: *, resultUrl: *, returnUrl: *)

Default constructor

integrationId: String

Merchant's integration id

integrationKey: String

Merchant's integration key

resultUrl: String

Url where where transaction status will be sent

returnUrl: String

Url to redirect the user after payment

send(payment: *): InitResponse

Send a payment to paynow

NameTypeAttributeDescription
payment*payment

sendMobile(payment: Payment, phone: String, method: String): InitResponse

Send a mobile money payment to paynow

NameTypeAttributeDescription
paymentPaymentThe payment to send to paynow
phoneStringThe phone number making payment
methodStringThe mobile money method to use (currently only ecocash is supported)

createPayment(reference: *, authEmail: String): Payment

Create a new Paynow payment

NameTypeAttributeDescription
reference*The unique reference for the transaction
authEmailStringThe payer's email address

fail(message: *): void

Throw an exception with the given message

NameTypeAttributeDescription
message*

init(payment: Payment): PromiseLike<InitResponse> | Promise<InitResponse>

Initialize a new transaction with PayNow

NameTypeAttributeDescription
paymentPayment

initMobile(payment: Payment, phone: String, method: String): PromiseLike<InitResponse> | Promise<InitResponse>

Initialize a new mobile transaction with PayNow

NameTypeAttributeDescription
paymentPaymentThe payment to send to paynow
phoneStringThe phone number making payment
methodStringThe mobile money method to use (currently only ecocash is supported)

parse(response: *): InitResponse

Parses the response from Paynow

NameTypeAttributeDescription
response*response

generateHash(values: Object, integrationKey: String): string

Creates a SHA512 hash of the transactions

NameTypeAttributeDescription
valuesObjectKey-value pair values to hash
integrationKeyStringThe integration key to use when hashing the items

verifyHash(values: *): Boolean

Verify hashes at all interactions with server

NameTypeAttributeDescription
values*The values to validate

urlEncode(str: String): String

URL encodes the given string

NameTypeAttributeDescription
strStringThe string to encode

urlDecode(str: String): String

URL decodes the given string

NameTypeAttributeDescription
strStringThe string to decode

parseQuery(queryString: String): Object

Parse responses from Paynow

NameTypeAttributeDescription
queryStringStringThe query string to parse

build(payment: Payment): {resulturl: String, returnurl: String, reference: String, amount: number, id: String, additionalinfo: String, authemail: String, status: String}

Build up a payment into the format required by Paynow

NameTypeAttributeDescription
paymentPaymentThe payment to format

buildMobile(payment: Payment, phone: String, method: String): {resulturl: String, returnurl: String, reference: String, amount: number, id: String, additionalinfo: String, authemail: String, status: String}

Build up a mobile payment into the format required by Paynow

NameTypeAttributeDescription
paymentPaymentThe payment to send to paynow
phoneStringThe phone number making payment
methodStringThe mobile money method to use (currently only ecocash is supported)

pollTransaction(url: String): PromiseLike<InitResponse> | Promise<InitResponse>

Check the status of a transaction

NameTypeAttributeDescription
urlString

parseStatusUpdate(response: String): StatusResponse

Parses the response from Paynow

NameTypeAttributeDescription
responseString

validate(payment: Payment): void

Validates an outgoing request before sending it to Paynow (data sanity checks)

NameTypeAttributeDescription
paymentPaymentThe payment to validate

Class: StatusResponse

constructor(data: *)

Default constructor

reference: String

Merchant Transaction Reference

amount: String

The original amount of the transaction

paynowreference: String

Paynow transaction reference

pollurl: String

The URL on Paynow the merchant site can poll to confirm the transaction’s current status.

status: String

Status returned from Paynow

error: String

The error message returned from Paynow

Global Functions

Function: isNullOrEmpty()

NameTypeAttributeDescription
← .NETJava →
  • Class: InitResponse
  • Class: Payment
  • Class: Paynow
  • Class: StatusResponse
  • Function: isNullOrEmpty()
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