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

@tripleplaypay/react-native

v1.1.3

Published

Stripe SDK for React Native

Downloads

14

Readme

TPP React Native SDK

Getting Started

Install the SDK

npm install @tripleplaypay/react-native

Setup

For assistance setting up the hardware, visit this document.

iOS

To get started with the TPP React Native SDK on iOS, follow these steps:

  1. Install the TPP React Native SDK and link the pods:
npx pod-install
  1. Open the XCWorkspace file under ios/ in XCode. You can do so from the commandline like this:
open ./ios/MyProject.xcworkspace
  1. Add the Bluetooth permission to your app's Info.plist file:
  • The app's Info.plist must contain an NSBluetoothAlwaysUsageDescription key with a string value explaining to the user how the app uses this data.
  • You can easily configure this from the Info tab. Click on the + button under any of the entries and select Privacy - Bluetooth Always Usage Description and make sure to place an accurate description in the text box next to it.
  1. Under the signing and capabilities tab, make sure to set up your Apple account for signing the application.
  2. Add the `MagTekSDK.xcframework.
  • Under the General tab, Click on the + symbol
  • Select the library Workspace > Pods > MagTekSDK.xcframework
  • Click add
  1. Make sure to build the project in XCode first, this will place the app on your phone. Afterwards you can run the react-native server using:
npx react-native start

Android

If our Android MagTek SDK doesn't resolve, you may need to add our repo to the allprojects section of your android app's gradle file, like so:

allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri('https://maven.pkg.github.com/TriplePlayPay/TPP-Android-MagTekSDK')
            credentials {
                username "${GITHUB_USER}"
                password "${GITHUB_TOKEN}"
            }
        }
    }
}

Usage:

  1. Import the @tripleplaypay/react-native module in your project:
import {TPPSDKModule} from '@tripleplaypay/react-native';
  1. Prior to any usage, initialize the SDK with your publishable key:
TPPSDKModule.initialize('prod-key-example');

or for testing sandbox transactions

TPPSDKModule.initializeSandbox('sandbox-key-example');
  1. To initiate a transaction, use the useTransactionUpdates hook to get the startTransaction method and a stateful transactionResult object that updates during each phase of the transaction processing.

    Use the hook inside of a react component so that transactionResult changes will trigger re-render effects:

const {transactionResult, startTransaction} = TPPSDKModule.useTransactionUpdates();

// Start the transaction
startTransaction('10.00');

The message property on transactionResult will begin statefully updating with messages such as: "PRESENT CARD" when it is ready for the user to pay, "APPROVED" if the transaction submitted to TPP servers successfully, or "DECLINED" for other failures.