0.0.12 • Published 4 years ago

@one-checkout/one-checkout-sdk v0.0.12

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
4 years ago

One-Checkout SDK

Install

npm install --save @one-checkout/one-checkout-sdk

Create Account

Goto https://one-checkout.com and create a new account. Obtain an API key from the merchant backend.

Usage

import React from 'react'
import {
  Provider,
  BuyButton,
  Cart,
  useOneCheckoutData,
} from '@one-checkout/one-checkout-sdk'

export default function App() {
  return (
    <div>
      <Provider apiKey="yourApiKey">
        <CustomComponent />
        <BuyButton productId="productIdFromMerchantBackend">
          Buy now
        </BuyButton>
        <Cart />
      </Provider>
    </div>
  )
}

function CustomComponent() {
  const oneCheckoutData = useOneCheckoutData();

  return <div>{oneCheckoutData.cart.sumFormatted}</div>;
}

License

UNLICENSED © One-Checkout

0.0.12

4 years ago

0.0.10

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago