0.1.1 • Published 6 years ago

coinbase-kit v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

coinbase-kit

This is Node library for commerce.coinbase.com

Features

  • Full Test coverage.
  • Support for both API Key + Secret and OAuth 2 authentication.
  • Convenient methods for making calls to the API.
  • Automatic parsing of API responses into relevant Javascript objects.
  • Adheres to the nodejs error-first callback protocol.
  • Async call

Quick Start

Get the API Key

The first thing you'll need to do is sign up for coinbase.Visit --dashboard.settings-- page to find Label API Keys and copy it.

Install

yarn add coinbase-kit
// or
npm install --save coinbase-kit

Making API Calls

Init the client

const CoinbaseClient = reuqire("Coinbase-Kit");

const client = new CoinbaseClient({ api_key: apikey, secret_key: secretkey });

Create a charge

const result = await client.charge.create(charge);

Show a chagre

const code = '66BEOV2A'
const result = await client.charge.show(code);
or
const id = '1234abcd-1234-abcd-1234-abcd1234abcd'
const result = await client.charge.show(id);

Get a chagre list

const result = await client.charge.list({});

Create a checkout

const result = await client.checkout.create(checkout);

Get a checkout

const result = await client.checkout.show(checkout.id);

Get a checkouts list

const result = await client.checkout.list({});

Update a checkouts list

const result = await client.checkout.update(Checkout);

Remove a checkout

const result = await client.checkout.delete(checkout.id);

Verify webhook

const isPass = client.verifyHook(headers, body);

Response && Event Model

When you call ever methods , You will get response.Learn More see here for the detail.

Error Handling

Testing / Contributing

Any and all contributions are welcome! The process is simple:

1. Fork this repo
2. Make your changes and add tests
3. Run the test suite
4. Submit a pull request.

My tasks of the project.

  • Initialization
  • Authentication
  • Charges
  • Checkouts
  • Docs (20%)
  • Demo && Example
    • Docker
    • Heroku