Skip to content

Commit

Permalink
add excoveralls
Browse files Browse the repository at this point in the history
add badges to readme
  • Loading branch information
Paul Daigle committed May 18, 2015
1 parent 76fa6a1 commit 522416b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ erl_crash.dump
*.ez
*.swp
temp/*
cacert.pem
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
language: elixir
otp_release:
- 17.4
after_success:
- mix compile
- mix coveralls.travis
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[![Build Status](https://travis-ci.org/philosodad/bitpay-elixir.svg?branch=master)](https://travis-ci.org/philosodad/bitpay-elixir) [![Hex Package](https://img.shields.io/badge/hexpm-v0.0.1-plug.svg)](https://hex.pm/packages/bitpay)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/bitpay/elixir-client/master/LICENSE.md)
[![Travis](https://img.shields.io/travis/bitpay/elixir-client.svg?style=flat-square)](https://travis-ci.org/bitpay/elixir-client)
[![Hex Package](https://img.shields.io/badge/hexpm-v0.0.1-plug.svg)](https://hex.pm/packages/bitpay)
[![Coveralls](https://img.shields.io/coveralls/bitapy/elixir-client.svg?style=flat-square)](https://coveralls.io/r/bitpay/elixir-client)

# BitPay Library for Elixir or Erlang
Powerful, flexible, lightweight interface to the BitPay Bitcoin Payment Gateway API. Can be used in an Elixir project or directly in an Erlang project as described in the [Elixir Crash Course](http://elixir-lang.org/crash-course.html). This README assumes that you are using Elixir.
Expand All @@ -8,20 +11,20 @@ Powerful, flexible, lightweight interface to the BitPay Bitcoin Payment Gateway
using hex, add to mixfile:
{ :bitpay, "~> 0.0.1" }

otherwise:
otherwise:
{ :bitpay, github: "bitpay/elixir-client", tag: "v0.0.1" }

## Basic Usage

The bitpay library allows authenticating with BitPay, creating invoices, and retrieving invoices.

### Pairing with Bitpay.com

Before pairing with BitPay.com, you'll need to log in to your BitPay account and navigate to /api-tokens. Generate a new pairing code and use it in the next step. If you want to test against
Before pairing with BitPay.com, you'll need to log in to your BitPay account and navigate to /api-tokens. Generate a new pairing code and use it in the next step. If you want to test against

> pem = BitPay.KeyUtils.generate_pem
> webclient = %BitPay.WebClient{pem: pem} #or %BitPay.WebClient{pem: pem, uri: "https://test.bitpay.com"}
> token = BitPay.WebClient.pair_pos_client(pairingcode, webclient)
> token = BitPay.WebClient.pair_pos_client(pairingcode, webclient)

You'll need to know the pem file and the token in order to create invoices.

Expand All @@ -38,7 +41,7 @@ That will return a map representing the invoice, and create an invoice on BitPay
## Testnet Usage

To use testnet, add a uri parameter when creating the webclient struct `%BitPay.WebClient{uri: "https://test.bitpay.com"}`


## API Documentation

Expand All @@ -48,7 +51,7 @@ API Documentation is available on the [BitPay site](https://bitpay.com/api).

The tests depend on a custom fork of elixir-webdriver and require that you have phantomjs installed.

Before running the tests, get a test.bitpay.com account. On Mac or Linux systems, set your system variables using the `set_constants` shell file in the test directory.
Before running the tests, get a test.bitpay.com account. On Mac or Linux systems, set your system variables using the `set_constants` shell file in the test directory.

$ source ./test/set_constants.sh https://test.bitpay.com <youremail> <yourpassword>
$ mix test
Expand All @@ -60,4 +63,3 @@ Let us know! Send a pull request or a patch. Questions? Ask! We're here to help.

## Contributors
[Click here](https://github.com/philosodad/bitpay-elixir/graphs/contributors) to see a list of the contributors to this library.

8 changes: 5 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ defmodule Client.Mixfile do
elixir: "~> 1.0",
description: description,
package: package,
deps: deps]
deps: deps,
test_coverage: [tool: ExCoveralls]]
end

# Configuration for the OTP application
Expand Down Expand Up @@ -43,13 +44,14 @@ defmodule Client.Mixfile do
end

defp deps do
[{ :mock, "~> 0.1.0", only: :test },
[{ :mock, "~> 0.1.0", only: [:dev, :test] },
{ :ibrowse, github: "cmullaparthi/ibrowse", tag: "v4.1.0" },
{ :httpotion, "~> 1.0.0" },
{ :exjsx, "~> 3.1.0" },
{ :webdriver, github: "atlantaelixir/elixir-webdriver", tag: "v0.7.2" },
{ :uuid, "~> 0.1.5" },
{ :earmark, "~> 0.1", only: :dev },
{:ex_doc, "~> 0.7", only: :dev}]
{ :ex_doc, "~> 0.7", only: :dev},
{ :excoveralls, "~> 0.3", only: [:dev, :test]}]
end
end
1 change: 1 addition & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%{"earmark": {:hex, :earmark, "0.1.13"},
"ex_doc": {:hex, :ex_doc, "0.7.1"},
"excoveralls": {:hex, :excoveralls, "0.3.10"},
"exjsx": {:hex, :exjsx, "3.1.0"},
"hackney": {:hex, :hackney, "0.14.3"},
"hound": {:hex, :hound, "0.6.0"},
Expand Down

0 comments on commit 522416b

Please sign in to comment.