1.1.1 • Published 5 months ago

apple-pay-button v1.1.1

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

Apple Pay Button (React) Library

Description

This is a TypeScript React library for creating an Apple Pay Button. This library follows the Apple Pay Button JavaScript guidelines. It allows you to easily integrate Apple Pay into your React applications.

Resources

Here are some resources to help you understand how this library works:

Installation

To install this library, run the following command:

npm install apple-pay-button

Usage

Here's a basic example of how to use this library:

import { ApplePayButton } from 'apple-pay-button';

function App() {
    const onClick = () => {
        // Do something
    }

  return (
    <div className="App">
      <ApplePayButton
        onClick={onClick}
        style={{
            width: '100%',
            borderRadius: '8px',
        }}
        type="continue"
    />
    </div>
  );
}

export default App;

Props

PropTypeDescription
buttonStyle'black' \| 'white' \| 'white-outline'The style of the Apple Pay button. Default is 'black'.
typeButtonTypeThe type of the Apple Pay button. Default is 'buy'.
localestringThe locale for the Apple Pay button. Default is 'en-US'.
onClick() => voidThe callback function when the Apple Pay button is clicked.
style{ width?: string; height?: string; borderRadius?: string; padding?: string; boxSizing?: string; }The style object for the Apple Pay button.

Where ButtonType is one of the following: 'plain', 'add-money', 'book', 'buy', 'check-out', 'continue', 'contribute', 'donate', 'order', 'pay', 'reload', 'rent', 'set-up', 'subscribe', 'support', 'tip', 'top-up'.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT © Johan Corrales

1.1.1

5 months ago

1.1.0

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago