0.0.4 • Published 3 years ago

@departurelabs/quark-checkout.validate v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@departurelabs/quark-checkout

Installation

npm i -S @departurelabs/quark-checkout @departurelabs/quark-checkout.validate

Usage

Example integration:

import { initialize, TOKENS, PROVIDERS } from "@departurelabs/quark-checkout"
// NOTE: quark.validate can be removed when you have a valid configuration
import { validate } from "@departurelabs/quark-checkout.validate"

const { checkout } = initialize(
  validate.config({
    provider: PROVIDERS.II,
    domain: "https://34dvu-aqaaa-aaaah-qc6ua-cai.ic0.app",
    notify: {
      principalId: "dlftw-sqaaa-aaaaa-danil-cai",
      methodName: "canisterMethod",
    },
    integrator: "company@testnet.quark",
    callback: event => {
      if (event.data.result === "Accepted") {
        checkoutComplete()
      } else {
        checkoutFailed()
      }
    },
  }),
)

const basket = [
  {
    name: "Spoon",
    description: "Use this for your soup",
    value: 10000000,
    token: TOKENS.TEST,
  },
]

checkout(validate.basket(basket))

Websites

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago