@natade-coco/react-pay-js
v0.3.7
Published
Library for COCOPay integration
Downloads
1
Readme
@natade-coco/react-pay-js
Library for COCOPay integration
🚧 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
| | light | dark | inverted | | :---: | :----------------------------------------------------------: | :---------------------------------------------------------: | :-------------------------------------------------------------: | | basic | | | | | short | | | | | stack | | | |
License
MIT © natadeCOCO