1.0.1 • Published 1 year ago

ach-ramp v1.0.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Ramp SDK

A JavaScript library for decentralised applications to onboard their global user base with fiat currency.

Installation

# Using npm
$ npm install @ramp/ramp-sdk

Example usage

Refer here for the full list of customisation options

<div id="rampView" style="width: 350px;height: 700px"></div> 
import {rampSDK} from '@ramp/ramp-sdk';

// Definition Ramp SDK
let ramp = new rampSDK({
    secret: '<you-secret-key>', // (Required)
    appId: '<your-app-id>', // (Required)
    environment: '<environment: TEST/PROD>', // (Required)
    containerNode: 'rampView', // (Required) Dom node id
    optionalParameter: {
        // .....
        // Parameters Tips:(The exact name and case of the parameter must be used.)
        // For the full list of customisation options check the link above
    },
});

// Initialization Ramp SDK
ramp.init();

// The callback triggered by the return button after the order payment is successful
ramp.on('TRANSAK_WIDGET_CLOSE',(cb) => {
    // Destroy Ramp SDK
    ramp.close()
})
// or
ramp.on('*',(cb) => {
    // Destroy Ramp SDK
    if(cb.eventName === 'TRANSAK_WIDGET_CLOSE'){
        ramp.close()
    }
})

For in-depth instructions on integrating Ramp, view our complete documentation.

1.0.1

1 year ago