react-carbon-checkout
Version:
React component for Carbon payment checkout.
56 lines (52 loc) • 1.55 kB
Markdown
# react-carbon-checkout
Fiber carbon checkout widget. Allow your users to seemlesly use their credit card to purchase crypto.
# Install
```
npm install react-carbon-checkout --save
```
# Example Usage
```javascript
import React from 'react';
import { render } from "react-dom";
import CarbonCheckout from "../src";
const App = () => {
return(
<div>
Sample Carbon Checkout
<CarbonCheckout
environment="sandbox"
currency="eur"
total="5.99"
apiKey="API_KEY"
c12Id="CONTACT_ID"
paymentGateway={true}
onError={() => {}}
onEvent={() => {}}
/>
</div>
);
};
render(<App />, document.getElementById("root"));
```
# Props
### apiKey (required)
Your applications API key. You can get your key by signing up at [https://carbon.money/](https://fiber.carbon.money/).
### environment (required)
This will be either 'sandbox' or 'production'.
### c12Id (required)
Unique user id.
### total (required)
Amount user will be charged in specified currency.
### currency
Currency used for displayed total amount.
### paymentGateway
Boolean that determines whether Carbon conducts purchase start to finish (false) or simply submits an order (true). If false, must supply `token` and `address`.
### token
Crypto symbol of crypto to be purchased. See docs.carbon.money for supported cryptos.
### address
Crypto address to which purchased crypto will be delivered.
### onError
Subscribe to error events.
### onEvent
Subscribe to events such as a successful order request.
```