vionex-pay-button

vionex wallet pay button

Usage no npm install needed!

<script type="module">
  import vionexPayButton from 'https://cdn.skypack.dev/vionex-pay-button';
</script>

README

vionex-pay-button

vionex wallet pay button

NPM JavaScript Style Guide

Install

npm install --save vionex-pay-button

Usage

import React, { Component } from 'react'
import PayButton from 'vionex-pay-button'
import 'vionex-pay-button/dist/index.css'

const App = () => {
  const getRes = (res) => {
    console.log('res  ', res)
  }

  const buttonLoad = () => {
    console.log('button loaded')
  }

  const onTransactionStart = () => {
    console.log('transction started')
  }

  const onError = (err) => {
    console.log('error occured', err)
  }

  const onSuccess = (res) => {
    console.log('success ', res)
  }

  return (
    <PayButton
      amount={[0.001]}
      to={['addressHere']}
      responseCallback={getRes}
      onLoad={buttonLoad}
      onTransactionStart={onTransactionStart}
      onError={onError}
      onSuccess={onSuccess}
    />
  )
  // or transfer tokens
  // return (
  //   <PayButton
  //     token={tokenId}
  //     amount={[1]}
  //     to={['publicKeyHere']}
  //     responseCallback={getRes}
  //   />
  // )
}

export default App

License

MIT ©