0.2.0 • Published 4 years ago
bongloy-react-native v0.2.0
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.