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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-plug-pag-service

v0.1.17

Published

React Native Plug Pag Service Plugin

Readme

react-native-plug-pag-service

Getting started

$ npm install react-native-plug-pag-service --save

Mostly automatic installation

$ react-native link react-native-plug-pag-service

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-plug-pag-service and add PlugPagService.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libPlugPagService.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java

    • Add import com.reactlibrary.PlugPagServicePackage; to the imports at the top of the file
    • Add new PlugPagServicePackage() to the list returned by the getPackages() method
  2. Append the following lines to android/settings.gradle:

    include ':react-native-plug-pag-service'
    project(':react-native-plug-pag-service').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-plug-pag-service/android')
  3. Insert the following lines inside the dependencies block in android/app/build.gradle:

      compile project(':react-native-plug-pag-service')
  4. AndroidManifest.xml

    • Permissions To integrate the library with the PlugPagService library in Android applications you must add the following permission to AndroidManifest.xml.
    <uses-permission android:name="br.com.uol.pagseguro.permission.MANAGE_PAYMENTS"/>

    This permission allows the library to bind to PlugPagService , Moderninha Smart's embedded service , which manages all payment transactions.

    • Intent-filter In order for your app to be chosen as the default payment app and receive Card Insertion Intents, you need to add the following code to your AndroidManifest.xml within your main Activity.
    <intent-filter>
          <action android:name="br.com.uol.pagseguro.PAYMENT"/>
          <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>

Usage

import PlugPagService from 'react-native-plug-pag-service'

CONSTANTS

PAYMENT TYPES

PlugPagService.PAYMENT_CREDITO - Set the payment as CREDIT. PlugPagService.PAYMENT_DEBITO - Set the payment as DEBIT. PlugPagService.PAYMENT_VOUCHER - Set the payment as VOUCHER.

INSTALLMENTS TYPES

PlugPagService.INSTALLMENT_TYPE_A_VISTA - Set the installment type as VISTA PlugPagService.INSTALLMENT_TYPE_PARC_VENDEDOR - Set the installment type as PARCELADO VENDEDOR PlugPagService.INSTALLMENT_TYPE_PARC_COMPRADOR - Set the installment type as PARCELADO COMPRADOR

METHODS

PlugPagService.setAppIdendification(appName, appVersion) - Set app information PlugPagService.initializeAndActivatePinpad(activationCode, promise) - Initialize and activate pinpad PlugPagService.doPayment(paymentDataJsonString, promise) - Do payment

Implementation Examples

Below are some examples of layers of the PlugPagService Wrapper methods for performing transactions.

Payment of $ 250.00. Credit in sight:

startPayment() {
    // Cria a identificação do aplicativo
    PlugPagService.setAppIdendification("MeuApp", "1.0.7")

    // Ativa terminal e faz o pagamento
    var activationCode = "403938"

    PlugPagService.initializeAndActivatePinpad(activationCode).then((initResult) => {
        if (initResult.retCode == PlugPagService.RET_OK) {
            // Define os dados do pagamento
            const paymentData = {
                type: PlugPagService.PAYMENT_CREDITO,
                amount: 250,
                installmentType: PlugPagService.INSTALLMENT_TYPE_A_VISTA,
                installments: 1,
                userReference: "CODVENDA"
            };

            PlugPagService.doPayment(JSON.stringify(paymentData)).then((result) => {
                if (result.retCode == PlugPagService.RET_OK) {
                    alert("Payment success with ret code: " + success)
                } else {
                    alert("Payment failed with error code: " + error2)
                }
            })
            // Trata o resultado da transação
        } else {
            alert("Initialize And Activate failed with error code: " + initResult)
        }
    })
}

Payment of $ 300.00. Credit in sight:

startPayment() {
    // Cria a identificação do aplicativo
    PlugPagService.setAppIdendification("MeuApp", "1.0.7")

    // Ativa terminal e faz o pagamento
    var activationCode = "403938"

    PlugPagService.initializeAndActivatePinpad(activationCode).then((initResult) => {
        if (initResult.retCode == PlugPagService.RET_OK) {
            // Define os dados do pagamento
            const paymentData = {
                type: PlugPagService.PAYMENT_CREDITO,
                amount: 300,
                installmentType: PlugPagService.INSTALLMENT_TYPE_PARC_VENDEDOR,
                installments: 3,
                userReference: "CODVENDA"
            };

            PlugPagService.doPayment(JSON.stringify(paymentData)).then((result) => {
                if (result.retCode == PlugPagService.RET_OK) {
                    alert("Payment success with ret code: " + success)
                } else {
                    alert("Payment failed with error code: " + error2)
                }
            })
            // Trata o resultado da transação
        } else {
            alert("Initialize And Activate failed with error code: " + initResult)
        }
    })
}