0.1.9 • Published 10 months ago

netpayjs_reactnative v0.1.9

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

netpayjs_reactnative

Libreria desarrollada en el framework de React Native para dispositivos moviles, basado en la herramienta de netpay js (Custom checkout)

Instalacion de libreria

npm install netpayjs_reactnative

Levantar proyecto de manera local

yarn - Instala todas las dependencias
yarn example start - Levanta el proyecto del repositorio
expo start - Levantar proyecto creado desde cero

Implementación

import { NetPay } from 'netpayjs_reactnative';
import React from 'react';
import { Alert } from 'react-native';
import { View, StyleSheet } from 'react-native';

function success(e: any) {
  console.log('Token created successfully');
  Alert.alert('Token created successfully', 'El token se creo correctamente.');
  console.log(e);
}

function error(e: any) {
  console.log('Something went wrong!');
  Alert.alert('Something went wrong!', 'Ocurrio un error, intenta nuevamente.');
  console.log(e);
}

//Si se desea realizar pruebas en modo sandbox descomentar la propiedad sandboxMode: true, en caso contrario no agregarlo.

const form = {
  id: 'netpay-form',
  success,
  error,
  options: { title: 'Pagos con tarjeta', submitText: 'Continuar' },
  //sandboxMode: true,
};

const noForm = {
  success,
  error,
  cardInformation: {
    cardNumber: 'numberCard',
    expMonth: 'expMonth',
    expYear: 'expYear',
    cvv2: 'cvv',
    deviceFingerPrint: '',
    //sandboxMode: true,
  },
};

//SON ESTILOS PARA CENTRAR EL FORMULARIO DE PAGO
const styles = StyleSheet.create({
  container: {
    flex: 1,
    top: 80,
  },
});

// Usar api keys dependiendo al ambiente que apunten
// apikey="Usar public key"
// form={formulario declarados anteriormente}

export default function App() {
  return (
    <View style={styles.container}>
      <NetPay apikey="apiKey" form={"form o noForm"} />
    </View>
  );
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.1.8

10 months ago

0.1.7

12 months ago

0.1.9

10 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago