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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-tapon-pagseguro

v1.0.0

Published

Integration of PagSeguro Tap On for React Native

Downloads

94

Readme

react-native-tapon-pagseguro

React Native library to integrate PagBank / PagSeguro Tap On (NFC Tap-to-Pay) using the official Android extension.

Accept contactless payments (credit, debit and installment) directly on Android devices that support NFC + the PagBank Tap On extension.

Features

  • Initialize Tap On service with app credentials
  • Customizable theme (colors for toolbar, buttons, status bar…)
  • Check NFC support, NFC enabled status & extension compatibility
  • Redirect user to install Tap On extension from Play Store
  • Perform contactless payments (credit/debit/installments)
  • Request full or partial refunds (estornos)

Currently supported only on Android (via react-native-nitro-modules)

Installation

npm install react-native-tapon-pagseguro react-native-nitro-modules
# or
yarn add react-native-tapon-pagseguro react-native-nitro-modules

Quick Start

import TapOn, { SetupError, PaymentError } from 'react-native-tapon-pagseguro';

// 1. Initialize (call once – ideally in App.tsx or splash)
TapOn.initialize({
  app_key:    "your_app_key_from_pagbank",
  app_name:   "Your App Name",
  app_version:"1.2.3",
  // optional theme
  theme: {
    toolbar_color: "#1E40AF",
    button_background_color: "#3B82F6",
    button_text_color: "#FFFFFF",
  }
});

// 2. Check if device & extension are ready
if (!TapOn.is_nfc_supported()) {
  alert("Device does not support NFC payments.");
  return;
}

if (!TapOn.is_nfc_enabled()) {
  alert("Please enable NFC in device settings.");
  return;
}

if (!TapOn.is_extension_available()) {
  // Redirect user to install extension
  TapOn.get_extension_on_playstore();
  return;
}

// 3. Perform a payment (amount in cents)
try {
  const result = await TapOn.request_payment(15000); // R$ 150,00

  console.log({
    transaction_code: result.transaction_code,
    card_brand:       result.card_brand,
    installments:     result.installments,
    payment_method:   result.payment_method, // 0=credit, 1=debit, 2=installment
  });
} catch (e) {
  if (e instanceof PaymentError) {
    console.error(`Payment failed [${e.code}]: ${e.message}`);
  } else if (e instanceof SetupError) {
    console.error(`Configuration error: ${e.message}`);
  } else {
    console.error(e);
  }
}

API Reference

Static Methods

| Method | Description | Returns | Throws | |:------------------------------------|:----------------------------------------------------------------------------|:---------------------------------|:---------------------| | initialize(data: SettingData) | Initialize service (call once) | void | SetupError | | set_theme(data: ThemeSettings) | Change visual theme after initialization | void | SetupError | | is_nfc_supported() | Device has NFC hardware | boolean | — | | is_nfc_enabled() | NFC is turned on in system settings | boolean | — | | is_extension_supported() | Device hardware is compatible with Tap On | boolean | — | | is_extension_available() | Tap On extension is installed | boolean | — | | get_extension_on_playstore() | Open Play Store page of Tap On extension | void | — | | request_payment(amount: number) | Start contactless payment (amount in cents) | Promise<PaymentResult> | PaymentError, SetupError | | request_refund(transaction_code, amount) | Refund (full or partial) | Promise<boolean> | RefundError, SetupError |

Types

type SettingData = {
  app_key:    string;
  app_name:   string;
  app_version:string;
  theme?:     ThemeSettings;
};

type ThemeSettings = {
  toolbar_color?:           string;   // #RRGGBB or #RRGGBBAA
  toolbar_text_color?:      string;
  status_bar_color?:        string;
  button_background_color?: string;
  button_text_color?:       string;
};

type PaymentResult = {
  amount:                 number;           // in cents
  raw_amount:             number;
  payment_method:         PaymentTypes;     // 0=credit, 1=debit, 2=installment
  transaction_code:       string;
  transaction_date_time:  string;
  card_holder:            string;
  card_brand:             string;
  installments:           number;
  installment_value:      number;           // in cents
  raw_installment_value:  number;
  installment_method:     InstallmentTypes; // who absorbs the installment cost
};

enum PaymentTypes {
  CREDIT            = 0,
  DEBIT             = 1,
  INSTALLMENT_CREDIT= 2,
}

enum InstallmentTypes {
  NO_INSTALLMENT    = 0,
  SELLER_INSTALLMENT= 1,
  BUYER_INSTALLMENT = 2,
}

Requirements

  • Android only (iOS not supported yet)
  • react-native-nitro-modules ≥ 0.32.0
  • Android minSdk 24+ (usually already satisfied)
  • PagBank Tap On extension installed on the device
  • Valid PagBank app_key (contact PagBank integration team)

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -m 'Add your feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a pull request.

Support the Project ☕

If you've found this library helpful, consider buying me a coffee!

Scan the QR code to donate (PIX):

PIX donation QR code

Thank you for your support! 🚀

License

MIT License. See LICENSE for details.