0.0.12 • Published 11 months ago

@0xpay/sdk v0.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@0xpay/sdk

Node.js 0xPay integration package

npm

Overview

SDK for 0xPay Merchant API which allows merchants to accept and manage payments on various blockchain networks and fiat assets via integration options.

Getting started

Prerequisites

To start using 0xPay SDK you need to register your personal account and then create merchant at 0xPay to obtain your merchant id and private key and provide it to SDK.

Installation

// NPM
npm install @0xpay/sdk
// Yarn
yarn add @0xpay/sdk

Create instance

import { XPay } from '@0xpay/sdk'

const MERCHANT_ID = 'your-merchant-id'
const MERCHANT_PRIVATE_KEY = 'your-merchant-private-key'

// Create XPay instance
const xpay = new XPay(MERCHANT_ID, MERCHANT_PRIVATE_KEY)

Get available crypto assets

import { XPay } from '@0xpay/sdk'
import express from 'express'

// Create XPay instance
const xpay = new XPay(...)

express().post('/ipn', express.raw(), (req, res) => {
  const validationError = xpay.validateWebhookRequest({ ...req, ...req.headers })
  if (validationError) throw new Error(validationError.description)

  // processing your ipn...

  res.send('OK')
})

Extended Docs

0.0.11

11 months ago

0.0.12

11 months ago

0.0.10

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago