0.3.7 • Published 4 years ago

@natade-coco/react-pay-js v0.3.7

Weekly downloads
71
License
MIT
Repository
gitlab
Last release
4 years ago

@natade-coco/react-pay-js

Library for COCOPay integration

NPM JavaScript Style Guide

🚧 Release Candidate

This is pre-release software. Changes may occur at any time, and certain features might be missing or broken.

📌 Requirements

You have to enable Stripe connected account via natadeCOCO Console and get your account ID.

⚙️ Install

npm install --save @natade-coco/react-pay-js

🚀 Usage

import React, { Component } from 'react'

import { Payout } from '@natade-coco/react-pay-js'
import '@natade-coco/react-pay-js/dist/index.css'

class Example extends Component {
  const handleOnCompleted = (txId: string, status: string, chargeId: string, receiptUrl: string): boolean => {
    // callback after payment success
    return true
  }
  const handleOnError = (reason: any) => {
    // callback when an error occurred
  }
  render() {
    return <Payout
      theme='light' // option: light(default), dark, inverted
      layout='basic' // option: basic(default), short, stack 
      account='YOUR_ACCOUNT_ID'
      amount={1000} 
      onCompleted={handleOnCompleted}
      onError={handleOnError} />
  }
}

🍭 Layouts & Colors

lightdarkinverted
basic
short
stack

License

MIT © natadeCOCO

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago