Ninjapay URI Intent

Ninjapay supports a URI scheme which allows web pages, apps, or other services to initiate a payment request through the Ninjapay app installed on the user's device.

Constructing the Ninjapay URI

The URI should be constructed as follows:

ninjapay://pay?key=<invoice-key>&tid=<transaction-id>

where:

  • <invoice-key> is the unique API invoice key used for authentication.

  • <transaction-id> is the unique 12-digit number to be used for the payment. Get it using request payment method.

For example:

ninjapay://pay?key=n6bda6e5c9377c21a5cdee98572f08e1&tid=128662902742

Initiating the Payment Request

To initiate the payment request, simply navigate to the constructed URI.

In a web page, this can be done by providing the URI as a hyperlink:


<a href="ninjapay://pay?key=n6bda6e5c9377c21a5cdee98572f08e1&tid=128662902742">Pay with Ninjapay</a>

In a mobile app, this can typically be done by opening the URI:


window.open("ninjapay://pay?key=n6bda6e5c9377c21a5cdee98572f08e1&tid=128662902742");

Receiving a Payment Response

After the payment has been processed, the Ninjapay app will return control to the calling app along with a response that contains details about the transaction. This response will typically include:

  • tid: a unique identifier for the transaction.

  • status: the status of the transaction, e.g., "successful", "failed", etc.

The method of receiving this response will depend on the specific platform and programming language. In general, you will need to set up a callback mechanism to handle the response.

User Experience

When a user activates a Ninjapay URI:

  1. The Ninjapay app will open on their device, with the payment details pre-filled according to the information provided in the URI.

  2. The user will be asked to confirm the payment.

    If the user is not already logged in to the Ninjapay app, they will be asked to log in before they can confirm the payment.

  3. Once the user confirms the payment, the transaction will be processed. The user will see a confirmation message in the Ninjapay app, and they can then return to the original app or webpage.

Note:

  • Allowing payments to be initiated in this way can be convenient for users, but it also presents security considerations. Ensure that the Ninjapay URIs are only generated and used in a secure manner.

  • Make sure to verify payment status confirmations from Ninjapay on the server side.


This covers the basic usage of the NinjaPay URI intent system. Depending on the specifics of your implementation, you may want to add more details or examples to help users understand how to use it effectively.

Last updated