A simple flexible API wrapper for coinbase commerce API. Totally unofficial.

Overview

coinbase_commerce

A dart library that connects to interact with the Coinbase Commerce API. Enables projects to connect seamlessly to coinbase and receive payments!

For more details visit Coinbase API docs.

To start using library, you need to register on Coinbase Commerce and get your API_KEY from user settings.

Next create a Coinbase object for interacting with the API: the object contains links to an dart Class representations of the API resources Checkout, Charge and Invoice.

Each request returns a CoinbaseResponseObject. Every CoinbaseResponseObject matches the API response Jsons and casts them as models.

Features

  • Create Charges
  • Cancel Charges
  • View Charges
  • List Charges
  • View The Status of Charges
  • Create Invoices
  • View Invoices
  • List Invoices
  • Create Checkouts
  • Delete Checkouts
  • View Checkouts
  • List Checkouts

See also:

Usage

To create a new instance of a coinbase_commerce object you have to supply your API as generated from the coinbase commerce settings page.

Coinbase coinbase=Coinbase('YOUR API KEY HERE',debug:true);

Charges

To create a new charge

ChargeObject charge = await coinbase.createCharge(
                        name: 'Coffee Charge',
                        description: '3 cups of Coffee',
                        currency: CurrencyType.usd,
                        pricingType: PricingType.fixedPrice,
                        amount: 40);

To view the status of Your previously created charge

StatusObject status = StatusCheck().checkChargeStatus(image);

Charges can either be (NEW, PENDING, COMPLETED, EXPIRED, UNRESOLVED, RESOLVED, CANCELED, REFUND PENDING, REFUNDED,NONE)

In the case where it returns a status of none it implies that no record of the charge was seen.

To view the information concerning a particular charge

ChargeObject charge = await coinbase.viewCharge('YOUR CHARGE ID HERE');

To cancel a charge

ChargeObject charge= await coinbase.cancelCharge('YOUR CHARGE ID HERE');

To list all charges assoiciated with an account

List<ChargeObject> charge = await coinbase.retrieveAllCharges;

Checkouts

To create a new checkout

CheckoutObject checkout = await coinbase.createCheckout(
                        description: 'description',
                        name: 'name',
                        pricingType: PricingType.noPrice,
                        currency: CurrencyType.usd);

To view the information concerning a particular checkout

CheckoutObject charge = await coinbase.viewCheckout('YOUR CHECKOUT ID HERE');

To update a previously created checkout, supply the id and the new information,

CheckoutObject checkout = await coinbase.updateCheckout(
                        checkoutID: 'c4357d83-42d4-4d7b-bc44-d0262b1efd25',
                        name: 'New Name here');

To delete a checkout

CheckoutObject checkout= await coinbase.deleteCheckout('YOUR CHECKOUT ID HERE');

To List all charges assoiciated with an account

List<CheckoutObject> checkoutList = await coinbase.retrieveAllCheckouts;

Invoices

To create a new invoice

InvoiceObject invoice = await coinbase.createInvoice(
                      businessName: 'businessName',
                      customerEmail: '[email protected]',
                      customerName: 'Onuoha Silver',
                      currency: CurrencyType.usd,
                      amount: 20,
                    );

To view an invoice

InvoiceObject invoice = await coinbase
                        .viewInvoice('2a4aeb3e-a12b-4728-9c88-297dea5d2adb');

To retrieve all Invoices

List<InvoiceObject> invoice =await coinbase.retrieveAllInvoices;
You might also like...

Args simple - A simple argument parser and handler, integrated with JSON and dart

args_simple A simple argument parser and handler, integrated with JSON and dart:

Jan 22, 2022

Flutter Version Management: A simple CLI to manage Flutter SDK versions.

Flutter Version Management: A simple CLI to manage Flutter SDK versions.

fvm Flutter Version Management: A simple cli to manage Flutter SDK versions. FVM helps with the need for a consistent app builds by allowing to refere

Jan 8, 2023

A simple way to cache values that result from rather expensive operations.

cached_value A simple way to cache values that result from rather expensive operations. It is useful to cache values that: Are computed from other val

Nov 11, 2022

Simple & Beautiful Note taking app written in dart with flutter UI toolkit.

Simple & Beautiful Note taking app written in dart with flutter UI toolkit.

Notes is a privacy oriented, Secure ,beautiful and fast application made in flutter, it supports various features like adding and saving notes. Hiding

Dec 30, 2022

A few handy Flutter tools, dead simple `UriRouter` for `Uri`-based navigator or `BuildTracker` to track widget rebuilds and what caused them to rebuild.

noob A few handy tools for Flutter apps. UriRouter Hooks Providers PointerIndicator BuildTracker PeriodicListenable UriRouter Dead simple Uri-based pa

Jan 18, 2022

Simple generative arts created using Flutter

Simple generative arts created using Flutter

Flutter Generative Art Try it out on DartPad Simple Generative Art created using Flutter. Watch the full video on YouTube to know how to build it from

Aug 11, 2022

A simple Flutter / Dart Utility class for converting complex objects to uri and query string

A simple Flutter / Dart Utility class for converting complex or nested objects to uri and query strings you can follow the the article on how this cla

Sep 7, 2022

Simple CLI tool to produce icons for your next app.

icon_set_generator Simple CLI tool to enable easy production of icon sets for your next application. Installation Clone the repo and add bin/icon_set_

Nov 17, 2021
Owner
Onuoha Obinna
The answer is 42.
Onuoha Obinna
Fluro is a Flutter routing library that adds flexible routing options like wildcards, named parameters and clear route definitions.

Fluro is a Flutter routing library that adds flexible routing options like wildcards, named parameters and clear route definitions.

Luke Pighetti 3.5k Jan 4, 2023
Dependency Injection is a great design pattern that allows us to eliminate rigid dependencies between elements and it makes the application more flexible

GetX lib DI pattern Dependency Injection is a great design pattern that allows us to eliminate rigid dependencies between elements and it makes the ap

Trương Việt Hoàng 4 Feb 1, 2022
Flexible retry library for Dio package

Flexible retry library for Dio package. This is a next generation of an abandoned dio_retry package.

Rodion Mostovoy 43 Dec 12, 2022
Volt is a wrapper over the Revolt API for easily writing bots using the Dart language.

Volt is a wrapper over the Revolt API for easily writing bots using the Dart language. It is currently in active development so not all of the functionality has yet been implemented.

null 8 Dec 13, 2022
Minimal Dart wrapper to interact with Some Random Api. Easy to use, simplified and lightweight.

SRA - Some Random Api Minimal Dart wrapper to interact with Some Random Api. Easy to use, simplified and lightweight. Getting started Add the package

Yakiyo 3 Jan 4, 2023
Dart wrapper via dart:ffi for https://github.com/libusb/libusb

libusb Dart wrapper via dart:ffi for https://github.com/libusb/libusb Environment Windows(10) macOS Linux(Ubuntu 18.04 LTS) Usage Checkout example Fea

Woodemi Co., Ltd 28 Dec 20, 2022
Easy to use session wrapper that adds support to session storage and management in flutter.

flutter_session_manager Adds an easy to use wrapper to session management in flutter. Allows for easy session storage and management. The session pers

Eduardo Migueis 2 Feb 15, 2022
Simple GEL converter to showcase Flutter basics. Fundamental widgets and simple methods.

gel_converter A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Tornike Gogberashvili 1 Oct 17, 2021
A simple command-line application to generate simple folder and file structure for Flutter Applications

Kanza_cli is a simple command line tool to generate folder and file structure for your Flutter apps. To use it, you should do the followings: 1. First

Kanan Yusubov 9 Dec 16, 2022