react-native-khenshin

v1.3.1
Wrapper react-native para la tecnologĂ­a browser2app de khipu
react-native-khenshin khenshin khipu browser2app

react-native-khenshin

This is a fork of https://github.com/khipu/react-native-khenshin published to npmjs.com.

Add the library to your project

npm install react-native-khenshin

Install and configure

Usage

import React from 'react';
import {SafeAreaView, ScrollView, Button} from 'react-native';
import khenshin from 'react-native-khenshin';

function App(this: any): JSX.Element {
    const onStartPayment = () => {
        khenshin.startPaymentById('mboyd2tem42r')
            .then(({status, result}) => {
                if (status === 'CONCILIATING') {
                    // khenshin is conciliating the payment
                } else if (status === 'USER_CANCELED') {
                    // The user cancelled the transaction
                } else {
                    // Error!, see `result` for details
                    console.log(result);
                }
            })
            .catch((err: any) => console.log({err}));
    };

    return (
        <SafeAreaView>
            <ScrollView>
                <Button title={'pagar'} onPress={onStartPayment} />
            </ScrollView>
        </SafeAreaView>
);
}

export default App;

Example project

npm i react-native-khenshin

Metadata

  • MIT
  • Whatever
  • Emilio Davis
  • released 11/9/2023

Downloads

Maintainers