react-native-pretty-payment
Super pretty payment inputs for React Native. It exports a bunch of hooks and utility components to help you deliver a sweeter payment experience, faster. It uses bignumber.js to avoid floating point rounding errors.
🚀 Getting Started
Using Yarn:
yarn add react-native-pretty-payment
This solution is most effective when comprised with an internationalization library with support for currency, such as
react-intl
.
✏️ Usage
Firstly, you don't actually need any of the included UI to begin accepting payment information; all of the important business logic and props are retained inside a call to usePaymentButtons
:
;; ;
From this point, you're free render as you please, with the assurance that input and output values are going to remain bounded to the parameters supplied in the initial invocation of usePaymentButtons
.
For a full demonstration, please check out the included Example.
📒 Reference
usePaymentButtons
usePaymentButtons
is used to synthesize all of the form validation logic and related props required to pass into a payment input layout.
;