Wrapper for working with cryptocloud.plus API
Install with npm:
npm install cryptocloud
Install with yarn:
yarn add cryptocloud
import { CryptoCloud, Currency, StatusInvoice } from 'cryptocloud'
const cryptoCloud = new CryptoCloud('apiKey', 'shopId')
/** Invoice creation */
const invoice = await cryptoCloud.createInvoice({
amount: 100,
orderId: 'myOrderId',
currency: Currency.USD,
email: 'customer@gmail.com'
})
/** Checking invoice status */
const status = await cryptoCloud.checkInvoiceStatus({ uuid: invoice.invoiceId })
if (status.statusInvoice === StatusInvoice.CREATED) {
// ...
}
import { CryptoCloud } from 'cryptocloud'
const cryptoCloud = new CryptoCloud('apiKey', 'shopId')
/** Invoice creation */
const invoice = await cryptoCloud.createInvoice({
amount: 100,
orderId: 'myOrderId',
currency: 'USD',
email: 'customer@gmail.com'
})
/** Checking invoice status */
const status = await cryptoCloud.checkInvoiceStatus({ uuid: invoice.invoiceId })
if (status.statusInvoice === 'created') {
// ...
}
npm ci i
- create and fill out
.env
file based on.env.example
- make sure all tests are passed by running
npm test