MineraPay SDK Documentation

Welcome to the MineraPay SDK documentation. Here you will find all the information you need to integrate MineraPay into your website or application. To view the demo, please click the button below. Or, you can read the documentation here to view requested parameters.

View Demo ยป

Table of Contents:

  1. Installation
  2. Usage
  3. Parameters
  4. Contact

Installation

We provide two (2) environments for the SDK, one is the sandbox and the other one is the production environment:

Note: You can click the link below to download the file.

To use the SDK, include the following script below in your HTML file like this:

<script src="https://sdk.minerapay.com/M.old.js"></script>

Then, initialize the SDK with your Client Key and Secret:

<script>
    MineraPaySDK.clientId = 'YOUR_CLIENT_KEY';
    MineraPaySDK.clientSecret = 'YOUR_CLIENT_SECRET';
</script>

Usage

To use the MineraPay SDK, call the MineraPaySDK.requestPayment() method:

MineraPaySDK.requestPayment({
    amount: INTEGER_VALUE,
    reference: 'YOUR_REFERENCE_NUMBER',
    onFinish: function() {
        alert('Payment successful!');
    },
    onCancel: function() {
        alert('Payment canceled!');
    }
});

Parameters

The MineraPaySDK.requestPayment() method accepts the following optional parameters:

Parameter Type Description
amount string (REQUIRED) The amount that will be paid by user.
reference string The reference number of the payment. If not provided, our system will use random UUID.
onFinish function The callback function to execute when the payment is finished/successful.
onCancel function The callback function to execute when the payment is canceled.

Contact

If you have any questions or need help with the MineraPay SDK, please contact us at info@minerapay.com.