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-trust-payment

v0.1.29

Published

Accept Payments with Google Pay, Apple Pay and Card Payment for React Native apps using Trust Payment Provider.

Downloads

40

Readme

react-native-trust-payment

NPM pkg for access the native ios/android TPM libs for payment

Installation For iOS

npm install react-native-trust-payment

Update your iOS Project Pod File with below code first , in llast of pod file , Need to replace :project => "TpmGateWayApp", with :project => {{PROJECT__NAME}},

plugin 'cocoapods-keys', {
    :project => {{PROJECT__NAME}},
    :keys => [
      "JWTSecret",
      "MERCHANT_USERNAME",
      "MERCHANT_SITEREFERENCE"
   ]
}

Usage

import { TrustPaymentView } from 'react-native-trust-payment';

Replace These Keys in TrustPaymentView Class

JWTSecret;
MERCHANT_USERNAME;
MERCHANT_SITEREFERENCE;

Add Following Import

import { NativeEventEmitter } from 'react-native';
import { ReactNativeEventEmitter } from 'react-native-trust-payment';

After Add Above 2 Imports need to setup Event Listener. You can add it in component Constructor or use UseEffect Also on RN VIEW call this setupDataPayment() to setup and call the payment view. setupDataPayment can setup and send the keys to sdk and amount to charge

useEffect(() => {
  ///Oder Code Here
  var eventEmitter = new NativeEventEmitter(ReactNativeEventEmitter);
  // After Order Failed, You will get a Event with onPaymentFailed
  eventEmitter.addListener('onPaymentFailed', (data) => {
    console.log(data);
    // Data will contain the Failed Reason
    console.log('Payment Failed');
  });
  // After Oder Success, You will get a Event with onPaymentSuccess
  eventEmitter.addListener('onPaymentSuccess', (data) => {
    console.log(data);
    // Data will contain the Transection ID
    console.log('Payment Success');
  });
});
function setupDataPayment() {
  // playerRef?.
  const jsonObject = {
    mMerchantName: 'NAME FOR MERCHANGE',
    mERCHANT_USERNAME: '[email protected]',
    mERCHANT_SITEREFERENCE: 'test_integercomputersllp121446',
    jWTSecret:
      '55-021017fcde1ff4f3f6d3da2ef37b34cfbd4c17bcfd53d8906a59caeb2e61aa51',
    paymentValue: '1100',
    isForApple: 'YES',
    isDirectPayment: 'true',
    appleObject: appleObject,
    isProduction: 'false',
    // Add more key-value pairs as needed
  };

  // console.log(jsonObject, 'HOST JOINING BROADCAST')
  // Convert the object to a JSON-encoded string
  const jsonString = JSON.stringify(jsonObject);
  UIManager.dispatchViewManagerCommand(
    findNodeHandle(playerRef.current),
    UIManager.TrustPaymentView.Commands.setupPayment,
    [jsonString]
  );
}

After Setup Event Listner we need to Init the Trust Payment View on Any Button Click or any Action.

<TrustPaymentView color="white" ref={playerRef} style={styles.sectionTitle} />

This view will setup UI For now, We Will upate the Direcct Evvent in next verision's no worries!

Waooooooo! Yoou are Good To Go!

Contributing

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

License

MIT


Made with create-react-native-library