This is the Unofficial React Native library for Bongloy Payment Gateway API.
npm install bongloy-react-native --save
# or
yarn add bongloy-react-native
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);
}
}
See the API docs.