Java SDK for Zimbabwe's leading payments gateway, Paynow
# Java SDK for Paynow API
## Sign in to Paynow and get integration details
> Before you can start making requests to Paynow's API, you need to get an integration ID and integration Key from Paynow. Details about how you can retrieve the ID and key are explained in detail on this page
## Prerequisites
In order to make use of this project, the following prerequisites must be met for it to work.
1. Java JDK 7 or higher
## Installation
To use the Java Paynow SDK, you need to add the latest release as a dependency to your project. The latest release will be in the Maven Central Repository.
#### Gradle
```gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'zw.co.paynow:java-sdk:1.1.2'
}
```
#### Maven
```xml
zw.co.paynow
java-sdk
1.1.2
```
## Getting started
Create an instance of `Paynow` associated with your integration ID and integration key as supplied by Paynow.
```java
Paynow paynow = new Paynow("INTEGRATION_ID", "INTEGRATION_KEY");
```
## Initiating a web based transaction
A web based transaction is made over the web, via the Paynow website.
You can optionally set the result and return URLs.
* Result URL is the URL on the merchant website where Paynow will post transaction results to.
* Return URL is the URL where the customer will be redirected to after the transaction has been processed. If you do not specify a return URL, you will have to rely solely on polling status updates to determine if the transaction has been paid.
```java
paynow.setResultUrl("
example.com");
paynow.setReturnUrl("
example.com");
```
Create a new payment using any of the `createPayment(...)` methods, ensuring you pass your own unique reference for that payment (e.g invoice id). If you also pass in the email address, Paynow will attempt to auto login the customer at the Paynow website using this email address if it is associated with a registered account.
```java
Payment paymen …