react-native-khenshin
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

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

Package Sidebar

Install

npm i react-native-khenshin

Weekly Downloads

42

Version

1.3.1

License

MIT

Unpacked Size

453 kB

Total Files

37

Last publish

Collaborators

  • peace