0.0.2 • Published 1 year ago

dcolonv-elements3 v0.0.2

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Oatfi React-js

React JS components that enables OatFi flows to defer payments.

Requirements

The minimum supported version of React is v16.8. If you use an older version, upgrade React to use this library

Getting started

First Install OatFi-React-JS

npm install --save @oatfi/react-js

BNPL

Our package relies on our OatFiProvider that will handle our context for Oatfi transactions

Minimal example

import React from 'react';
import ReactDOM from 'react-dom';
import { BNPL, OatFiProvider } from '@oatfi/react-js';

// Obtain token authenticating in the api with your PK and Business Id
const partnerId = '629fe7c0f15794e7fe7e73d8';
const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....';
const invoiceExternalId = '2260c633-56e6-482b-ae88-a54af97a8587';
const payorExternalId = 'f89449d7-fdfb-4151-a5d9-20da5f5eae92';

const App = () => (
  <OatFiProvider token={token} partnerId={partnerId}>
    <BNPL payorExternalId={invoiceExternalId} invoiceExternalId={invoiceExternalId} />
  </OatFiProvider>
);

ReactDOM.render(<App />, document.body);

TypeScript support

OatFi React JS is packaged with TypeScript declarations.

Theming

Go to Theming section

0.0.2

1 year ago

0.0.1

1 year ago