React Payment Request
A Payment Request component for React.js
Installation
Npm
npm install react-payment-request --save
Umd
Usage
const details = ...const methodData = ...const options = ... const getOptionsforAddress = {...}const updateTotal = {...} <ReactPaymentRequest = = = = = = => <button>Pay</button></ReactPaymentRequest>
API
Parameter | Type | Description |
---|---|---|
details | object | Required information about transaction. |
methodData | array | Required payment method data. |
onError | func | Something bad happened. |
onShippingAddressChange | func | When user selects a shipping address. |
onShippingOptionChange | func | When user selects a shipping option. |
onSuccess | func | Process paymentResponse here. |
options | object | Optional parameter for things like shipping, etc. |
Test
npm test