diff --git a/.gitignore b/.gitignore index 3672be9..dab7d0f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ website/node_modules website/build website/i18n/* !website/i18n/en.json +website/.docusaurus diff --git a/docs/express_checkout_transactions.md b/docs/express_checkout_transactions.md deleted file mode 100644 index 16facb5..0000000 --- a/docs/express_checkout_transactions.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: express_checkout_transactions -title: Express Checkout Transactions -sidebar_label: Express Checkout Transactions ---- - -An express checkout transaction allows the integrator to capture the customers payment method and details inside their application and initiate payment without redirecting the user to Paynow. This is ideal for mobile applications; however, integrators should be aware of PCI DSS requirements for capturing Visa/Mastercard details within their applications. - -Express checkout transactions currently support EcoCash, OneMoney, InnBucks, PayGo and Visa/Mastercard payment methods. - -For EcoCash and OneMoney, the mobile subscriber specified in the initiate message will have a USSD session pushed to their handset prompting them to enter their mobile wallet PIN number to authorize the transaction (or to cancel the transaction). - -## Initiate an Express Checkout Transaction - -To initiate an express checkout transaction, an HTTP POST request should be made to the URL: - -[https://www.paynow.co.zw/interface/remotetransaction](https://www.paynow.co.zw/interface/remotetransaction) - -The fields below are required in addition to those specified in the [Initiate a Transaction](/docs/initiate_transaction.html) section - -| Required For | Field | Data Type | Description | -| --- | --- | --- | --- | -| All | method | String | ecocash = Ecocash mobile money **OR** onemoney = OneMoney mobile money **OR** vmc = Visa Mastercard **OR** innbucks = InnBucks **OR** paygo = PayGo | -| Mobile Money | phone | String | The subscriber number of the mobile money wallet to be debited | -| Visa/Mastercard | token | String | A token returned by a previous tokenized transaction. Used to carry out recurring payments without requiring further input from the card holder | -| Visa/Mastercard | merchanttrace | String | A unique merchanttrace is required for each request to ensure that no duplicate debits are processed in the event of a request timeout or network interruption | - -## Important Notes -### Integration - -The integration ID you use must be configured in Paynow to include the selected payment method e.g. if you use `method=ecocash` then the integration ID must be configured to include an EcoCash payment method - -### InnBucks -An express checkout request for InnBucks will return the following additional values: -- **authorizationcode** - the authorization code for the InnBucks transaction (display to customer) -- **authorizationexpires** - the date and time at which the given authorization code will expire, in the format d-MMM-yyyy HH:mm (display to customer) - -The authorization code can also be displayed as a QR code to be scanned by the InnBucks mobile app. See [https://developers.google.com/chart/infographics/docs/qr_codes](https://developers.google.com/chart/infographics/docs/qr_codes) for more details on generating a QR code - -You should also present the customer with a deep link [schinn.wbpycode://innbucks.co.zw?pymInnCode=xxxxxx](schinn.wbpycode://innbucks.co.zw?pymInnCode=xxxxxx) where `xxxxxx` is replaced with the authorization code, which can be used to initiate a transaction in the InnBucks mobile app - -### PayGo - -An express checkout request for PayGo will return the following additional values: -- **authorizationcode** - the authorization code for the PayGo transaction (display to customer) -- **authorizationqr** - a URL to the QR code for the PayGo transaction (display to customer) -- **authorizationexpires** - the date and time at which the authorization code will expire in the format d-MMM-yyyy HH:mm (display to customer) - -### Visa/Mastercard - -For Visa/Mastercard **token** transactions, the **merchanttrace** field is required. These transactions will be automatically re-tokenized during the payment and the new token returned in the status update callback message diff --git a/docs/sourcedocs_java.md b/docs/sourcedocs_java.md deleted file mode 100644 index f9024d9..0000000 --- a/docs/sourcedocs_java.md +++ /dev/null @@ -1,2469 +0,0 @@ ---- -id: sourcedocs_java -title: Source Docs for Java Library -sidebar_label: Java ---- - -
public abstract class CanFail
-extends java.lang.Object
- | Modifier and Type | -Field and Description | -
|---|---|
private java.util.ArrayList<java.lang.String> |
- _errors
- The list of errors
- |
-
| Constructor and Description | -
|---|
CanFail() |
-
| 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
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprivate final java.util.ArrayList<java.lang.String> _errors-
public final void Fail(java.lang.String error)-
error - InvalidIntegrationExceptionpublic final java.lang.String Errors()-
public final java.lang.String Errors(char separator)-
separator - public final class Constants
-extends java.lang.Object
- | 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 |
-
public static final java.lang.String ResponseOk-
public static final java.lang.String ResponsePaid-
public static final java.lang.String ResponseError-
public static final java.lang.String ResponseInvalidId-
public static final java.lang.String UrlInitiateTransaction-
public static final java.lang.String UrlInitiateMobileTransaction-
public static final java.lang.String MobileMoneyMethodEcocash-
public interface IResponse
- | Modifier and Type | -Method and Description | -
|---|---|
boolean |
- Success() |
-
public class InitResponse -extends CanFail-
| Modifier and Type | -Field and Description | -
|---|---|
private java.util.Map<java.lang.String,java.lang.String> |
- Data |
-
private boolean |
- HasRedirect |
-
private boolean |
- WasSuccessful |
-
| Constructor and Description | -
|---|
InitResponse(java.util.Map<java.lang.String,java.lang.String> response)
- InitResponse constructor.
- |
-
| 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
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprivate java.util.Map<java.lang.String,java.lang.String> Data-
private boolean WasSuccessful-
private boolean HasRedirect-
public InitResponse(java.util.Map<java.lang.String,java.lang.String> response)-
response - Response data sent from PaynowInvalidIntegrationException -
- If the error returned from paynow isprotected final java.util.Map<java.lang.String,java.lang.String> getData()-
protected final boolean getWasSuccessful()-
protected final void setWasSuccessful(boolean value)-
protected final boolean getHasRedirect()-
protected final void setHasRedirect(boolean value)-
private void Load()-
public final java.lang.String PollUrl()-
public final boolean Success()-
public final java.lang.String RedirectLink()-
public final java.util.Map<java.lang.String,java.lang.String> GetData()-
| 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 and Description | -
|---|
StatusResponse(java.util.Map<java.lang.String,java.lang.String> response)
- InitResponse constructor.
- |
-
| 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
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprivate java.util.Map<java.lang.String,java.lang.String> Data-
private boolean WasSuccessful-
private java.lang.String Reference-
private java.math.BigDecimal Amount-
private boolean WasPaid-
public StatusResponse(java.util.Map<java.lang.String,java.lang.String> response)-
response - Response data sent from PaynowInvalidIntegrationException -
- If the error returned from paynow isprotected final java.util.Map<java.lang.String,java.lang.String> getData()-
protected final boolean getWasSuccessful()-
protected final void setWasSuccessful(boolean value)-
public final java.lang.String getReference()-
public final void setReference(java.lang.String value)-
public final java.math.BigDecimal getAmount()-
public final void setAmount(java.math.BigDecimal value)-
public final boolean getWasPaid()-
public final void setWasPaid(boolean value)-
public final boolean Success()-
private void Load()-
public final java.lang.String PollUrl()-
public final boolean Paid()-
public final java.util.Map<java.lang.String,java.lang.String> GetData()-
public class EmptyCartException
-extends java.lang.RuntimeException
- | Constructor and Description | -
|---|
EmptyCartException() |
-
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic class HashMismatchException
-extends java.lang.RuntimeException
- | Constructor and Description | -
|---|
HashMismatchException() |
-
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic class InvalidIntegrationException
-extends java.lang.RuntimeException
- | Constructor and Description | -
|---|
InvalidIntegrationException() |
-
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic class InvalidReferenceException
-extends java.lang.RuntimeException
- | Constructor and Description | -
|---|
InvalidReferenceException() |
-
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic final class Extensions
-extends java.lang.Object
- | Constructor and Description | -
|---|
Extensions() |
-
| 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) |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static java.lang.String FlattenCollection(java.util.HashMap<java.lang.String,java.math.BigDecimal> items)-
public static java.math.BigDecimal AddCollectionValues(java.util.HashMap<java.lang.String,java.math.BigDecimal> items)-
public static java.util.HashMap<java.lang.String,java.lang.String> ParseQueryString(java.lang.String qs)-
public static java.lang.String GetString(MobileMoneyMethod method)-
public final class Hash
-extends java.lang.Object
- | 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
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- public static java.lang.String Make(java.util.Map<java.lang.String,java.lang.String> values, - java.lang.String integrationKey)-
values - Values to valueintegrationKey - Paynow integration keyprivate static java.lang.String GetStringFromHash(byte[] hash)-
private static byte[] GenerateSalt()-
public static java.lang.String GenerateHash(java.lang.String text)-
public static boolean Verify(java.util.Map<java.lang.String,java.lang.String> data, - java.lang.String integrationKey)-
public class Client
-extends java.lang.Object
- | 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) |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic enum MobileMoneyMethod -extends java.lang.Enum<MobileMoneyMethod>-
| Enum Constant and Description | -
|---|
Ecocash |
-
| Modifier and Type | -Field and Description | -
|---|---|
static int |
- SIZE |
-
| 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.
-
- |
-
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfgetClass, notify, notifyAll, wait, wait, waitpublic static final MobileMoneyMethod Ecocash-
public static final int SIZE-
public static MobileMoneyMethod[] values()-
-for (MobileMoneyMethod c : MobileMoneyMethod.values()) - System.out.println(c); --
public static MobileMoneyMethod valueOf(java.lang.String name)-
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified
- name
- java.lang.NullPointerException - if the argument is nullpublic int getValue()-
public static MobileMoneyMethod forValue(int value)-
Please note that you have to do atleast two test transanctions before you can move on to a live integrations.
+[Click here ](status_update.md) to get testing numbers.
+This page outlines the process for initiating a transaction. Here, you will submit your payment details to Paynow. In response, Paynow will provide a link from which you can complete your payment.
+After Payment completion you get payment status on your result, as shown here [Get status update](status_update.md)
+Please note that you should process at least 2 test transactions before you can set your integration to live
+Please note that `authemail` should be your Paynow registered email when doing a test transaction
+When the customer is ready to make payment, the merchant site must perform an Initiate Transaction request. This request is in the form of an HTTP POST to the URL:
+
+ POST https://www.paynow.co.zw/interface/initiatetransaction
+
+ HTTP POST should include the following fields:
+| Field | +Data Type | +Description | +
|---|---|---|
| id | +Integer | +Integration ID shown to the merchant in the “3rd Party Site or Link Profile” area of “Receive Payment Links” section of “Sell or Receive” on Paynow. | +
| reference | +String | +The transaction’s reference on the merchant site, this should be unique to the transaction. | +
| amount | +Decimal | +Final amount of the transaction to two decimal places (do not include a currency symbol). | +
| additionalinfo | +String | +(*optional*) Additional info to be displayed on Paynow to the Customer. This should not include any confidential information. | +
| returnurl | +String | +The URL on the merchant website the customer will be returned to after the transaction has been processed. It is recommended this URL contains enough information for the merchant site to identify the transaction. | +
| resulturl | +String | +The URL on the merchant website Paynow will post transaction results to. It is recommended this URL contains enough information for the merchant site to identify the transaction. | +
| authemail | +String | +(*optional*) If the field is present and set to an email address Paynow will attempt to auto login the customers email address as an anonymous user. If the email address has a registered account the user will be prompted to login to that account. | +
| authphone | +String | +(*optional*) If the field is present and set to a valid mobile phone number, Paynow will attempt to use it as the customers mobile number for the duration of their session. | +
| authname | +String | +(*optional*) If the field is present, Paynow will attempt to use it as the customers name for the duration of their session. | +
| tokenize | +Boolean | +(*optional*) If set to true and the customer uses Visa/Mastercard to complete the transaction, the tokenized payment instrument will be returned in the **status update** which can be used for recurring payments without requiring further input from the card holder. **N.B.** *A merchant may only use this field if permitted to tokenize payment instruments. Contact support@paynow.co.zw to apply for this functionality.* | +
| merchanttrace | +String | +(*optional*) Must be unique per merchant if specified. Can be up to 32 characters in length. Used to check the status of a transaction in the event of a timeout or network error. | +
| status | +String | +Should be set to “Message” at this stage of the transaction. | +
| hash | +String | +Details of Hash generation are provided in the [Generating Hash](generating_hash.md) section. | +
If the initiate transaction request is successful, Paynow will reply with a message as a string and + formatted as an HTTP Post, i.e., each field separated by a "&" and Key Value pairs separated by an "=" and + all Values URL Encoded.
+ +The message will contain the following fields:
+ +| Field | +Data Type | +Description | +
|---|---|---|
| browserurl | +String | +The URL on Paynow that the merchant site will redirect the Customer’s browser to. Upon redirect, the Customer will perform their transaction. | +
| pollurl | +String | +The URL on Paynow the merchant site can poll to confirm the transaction’s current status. | +
| status | +String | +Set to “Ok” at this stage of the transaction. | +
| hash | +String | +Details of Hash generation are provided in a later section of this document. | +
++ +It is vital that the merchant site verify the hash value contained in the message before redirecting the Customer to the
+browserurl.
Below is an example of a successful initiate transaction request:
+ +If the initiate transaction request failed, Paynow will reply with a message as a string and formatted as an HTTP Post, i.e., each field separated by a "&" and Key Value pairs separated by an "=" and all Values URL Encoded.
+ +The message will contain the following fields:
+ +| Field | +Data Type | +Description | +
|---|---|---|
| status | +String | +Set to “Error” at this stage of the transaction. | +
| error | +String | +Details of the failure on Paynow. | +
Below is an example of an unsuccessful initiate transaction request:
+ +