0.2.0 • Published 4 years ago

bongloy-react-native v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

bongloy-react-native

This is the Unofficial React Native library for Bongloy Payment Gateway API.

Installation

npm install bongloy-react-native --save
# or
yarn add bongloy-react-native

Usage

The package needs to be configured with your account's secret key, which is available in the Bongloy Dashboard. Require it with the key's value:

import bongloy from 'bongloy-react-native';

state = {
    params: {
      number: '6200000000000005',
      expMonth: 12,
      expYear: 24,
      cvc: '123',
    }
}

handlePayPress = async () => {
    try {
        bongloy.setDefaultPublishableKey({publishableKey: "pk_test_..."});
        const token = await bongloy.createToken(this.state.params)
        console.log(token);
    } catch (error) {
        console.log(error);
    }
}

Documentation

See the API docs.

0.2.0

4 years ago

0.1.0

4 years ago