npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-lio

v1.0.4

Published

[![Version](https://img.shields.io/npm/v/react-native-lio.svg)](https://www.npmjs.com/package/react-native-lio) [![NPM](https://img.shields.io/npm/dm/react-native-lio.svg)](https://www.npmjs.com/package/react-native-lio)

Downloads

85

Readme

Version NPM

react-native-lio fornece a integração de aplicações que usam React Native à máquina CIELO Lio, implementando os principais métodos usados, baseado na documentação https://developercielo.github.io/manual/cielo-lio

Features

  1. Fornece as operações básicas de integração, compra e impressão usando Cielo LIO.
  2. Fornece outros métodos auxiliares para capturar informações e estados da máquina.

Installation

Vale ressaltar que este pacote tem suporte apenas para Android, visto que é o SO utilizado pela LIO.

  1. Instale o pacote

    from npm

    npm install react-native-lio

    from yarn

    yarn add react-native-lio
  2. Adicione ao final do arquivo /android/build.gradle

allprojects {
   ...
   repositories {
      maven {
        ...
        jcenter()
        maven {
            url("$rootDir/../node_modules/react-native-lio/android/cielo-sdk")
        }
    }
}
  1. Adicione ou altere no android/app/src/main/AndroidManifest.xml o allowBackup para true
android:allowBackup="true"

Supported react-native versions

| react-native-lio | react-native | | ---------------- | ------------ | | 1.0.0 | <= 0.64.5 | | 1.0.1 | <= 0.64.5 | | 1.0.2 | > 0.64.5 |

API

- setup(clientID, accessToken, ec)

Load library with client ID, accessToken and ec.

  • Client-Id Access identification. It's generation takes place at the time of creation by the developer panel. Its value can be viewed in the Client ID column, within the ‘Client ID Registered’ menu;
  • Access-Token Access token identification, which stores the access rules allowed to the Client ID. Its generation takes place when the Client ID is created by the developer panel. It's value can be viewed by clicking on 'details' in the 'Access Tokens' column, within the 'Client ID Registered' menu;
  • Ec is an client code;

- requestPaymentCrashCredit(amount, orderId)

Request payment with credit on sight. *amout, value to pay; *orderId, order number to transaction;

requestPaymentCreditInstallment(amount, orderId, installments)

Request payment with credit in installments. *amout, value to pay; *orderId, order number to transaction; *installments, number of installments

requestPaymentDebit(amount, orderId)

Request payment with credit on sight. *amout, value to pay; *orderId, order number to transaction;

getMachineInformation()

Gets the machine informations.

getOrderList()

Gets order list.

createDraftOrder()

Creats a draft order.

addItems()

Add items to order.

placeOrder()

checkoutOrder()

printText(text, style)

Print one line text using machine printter.

  • text: texto to print;
  • style: style of text;

printImage(encodedImage, style = {})

Print an image using machine printter.

  • encodedImage: Image encoded with base64 to print;
  • style: style of image;

addListener()

Troubleshooting

Unexpected behavior

If you have unexpected behavior, please create a clean project with the latest versions of react-native and react-native-lio

react-native init CleanProject
cd CleanProject/
yarn add react-native-lio

Make a reproduction of the problem in App.js

react-native run-android

Opening issues

Verify that it is still an issue with the latest version as specified in the previous step. If so, open a new issue, include the entire App.js file, specify what platforms you've tested, and the results of running this command:

react-native info