1.0.1 • Published 5 months ago

react-native-paypal-buttons v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

react-native-paypal-buttons

React native implementation of PayPal Buttons Expo snack Demo

Table of Contents

Installation

npm install react-native-paypal-buttons

Setup

This package uses PayPalOpen-Regular font for the button labels.

  1. Update react-native.config.js
    ...
      assets: [
        "./node_modules/react-native-paypal-buttons/src/assets/fonts"
      ]
  2. Run command
    ````
    npx react-native-asset
    ````
  1. Install the expo-font package:
    expo install expo-font
  2. Update expo config
    {
      "expo": {
        "plugins": [
          [
            "expo-font",
            {
              "fonts": ["./node_modules/react-native-paypal-buttons/src/assets/fonts/PayPalOpen-Regular.otf"]
            }
          ]
        ]
      }
    }

Usage

import { 
  PayPalButton,
  PayPalCreditButton,
  PayPalPayLaterButton,
} from 'react-native-paypal-buttons';

const MyComponent = () => (
  <>
    <PayPalButton />
    <PayPalPayLaterButton />
    <PayPalCreditButton />
  </>
);

Props

Common Props

Any PressableProps and the following: | Prop | Values | Default Value | |----------|------------------------------------------------------------------------------------------|---------------| | edges | PaymentButtonEdges.HARD_EDGES, PaymentButtonEdges.SOFT_EDGES, PaymentButtonEdges.ROUNDED, or a custom number | PaymentButtonEdges.SOFT_EDGES | | size | PaymentButtonSize.MINI, PaymentButtonSize.COLLAPSED, PaymentButtonSize.EXPANDED, PaymentButtonSize.FULL | PaymentButtonSize.EXPANDED |

PayPalButton Specific Props

PropValuesDefault Value
colorPayPalButtonColor.GOLD, PayPalButtonColor.WHITE, PayPalButtonColor.BLACK, PayPalButtonColor.SILVER, PayPalButtonColor.BLUEPayPalButtonColor.GOLD
labelPayPalButtonLabel.NONE, PayPalButtonLabel.CHECKOUT, PayPalButtonLabel.BUY_NOW, PayPalButtonLabel.PAY_WITHPayPalButtonLabel.NONE

PayPalPayLaterButton Specific Props

PropValuesDefault Value
colorPayLaterButtonColor.GOLD, PayLaterButtonColor.WHITE, PayLaterButtonColor.BLACK, PayLaterButtonColor.SILVER, PayLaterButtonColor.BLUEPayLaterButtonColor.GOLD

PayPalCreditButton Specific Props

PropValuesDefault Value
colorCreditButtonColor.WHITE, CreditButtonColor.BLACK, CreditButtonColor.DARK_BLUECreditButtonColor.WHITE

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

1.0.1

5 months ago

1.0.0

5 months ago

0.2.1

5 months ago

0.2.0

5 months ago