New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details → →
Socket
Book a DemoSign in
Socket

express-payment-request-react-native

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-payment-request-react-native

đź’¸ The companion React Native (iOS/Android/Web) frontend for express-payment-request.

latest
Source
npmnpm
Version
0.1.0-alpha.5
Version published
Maintainers
1
Created
Source

express-payment-request-react-native

đź’¸ The companion React Native (iOS/Android/Web) frontend for express-payment-request.

This allows you to accept cross-platform payments using services such as Apple Pay without linking.

🚀 Getting Started

Using yarn:

yarn add express-payment-request-react-native

✍️ Example

Below, we show that a the client can define the amount to pay via the usePaymentRequest hook. This requires that your app is wrapped within a PaymentRequestProvider.

import React from "react";
import { TouchableOpacity, Text } from "react-native";
import PaymentRequestProvider, { usePaymentRequest } from "express-payment-request-react-native";

function Button() {
  const { requestPayment, clearPaymentRequest } = usePaymentRequest();
  return (
    <TouchableOpacity
      onPress={() =>
        requestPayment({
          displayItems: [
            {
              label: "A client driven amount!",
              amount: { currency: "USD", value: "0.02" },
            },
          ],
          total: {
            label: "Total due",
            amount: { currency: "USD", value: "0.02" },
          },
        })
      }
    >
      <Text children="Request Payment of $0.02" />
    </TouchableOpacity>
  );
}

function App() {
  return (
    <PaymentRequestProvider uri="https://localhost:3000/payment">
      <Button />
    </PaymentRequestProvider>
  );
}

✌️ License

MIT

Keywords

express

FAQs

Package last updated on 23 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts