Skip to content

AndrewBarba/coinbase-commerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coinbase Commerce

npm version wercker status

Node.js library for commerce.coinbase.com

Usage

Create a Commerce client:

const { CoinbaseCommerce } = require('coinbase-commerce')

let client = new CoinbaseCommerce({
  apiKey: '1234abcd-1234-abcd-1234-abcd1234abcd',
  version: '2018-03-22' // optional
})

Charges

List

let results = await client.charges.list()

Get

let result = await client.charges.get('66BEOV2A')

Create

let result = await client.charges.create(options)

Request

let result = await client.charges.request('post', '/resolve')

Checkouts

List

let results = await client.checkouts.list()

Get

let result = await client.checkouts.get('1234abcd-1234-abcd-1234-abcd1234abcd')

Create

let result = await client.checkouts.create({})

Update

let result = await client.checkouts.update('1234abcd-1234-abcd-1234-abcd1234abcd', updates)

Delete

let result = await client.checkouts.delete('1234abcd-1234-abcd-1234-abcd1234abcd')

Events

List

let results = await client.events.list()

Get

let result = await client.events.get('66BEOV2A')

Webhooks

Verify Signature

// `body` can be a String, Buffer or Object
let isVerified = client.verifyWebhookSignature(signature, body, sharedSecret)