You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove web driver tests, make compatible with test helper utility
Added basic Post endpoint
Fixed travis tests to use environment PEM and existing merchant tokens.
removed go gets from .travis
Ginko command changed
Change env variable to use BITPAYAPI
Update readme
Copy file name to clipboardexpand all lines: GUIDE.md
+6-8
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,7 @@ The bitpay client creates a cryptographically secure connection to your server b
18
18
## Pairing
19
19
Most calls to the BitPay REST API require that your client is paired with the bitpay.com server. To pair with bitpay.com you need to have an approved merchant account.
20
20
21
-
Your client can be paired via the `pos` (point-of-sale) facade. The `pos` facade allows for invoices to be created and retrieved.
22
-
23
-
_For development or quick deployment purposes, consider the [BitPay Go Command-Line Interface](https://github.com/philosodad/bitpay-go-cli) to simplify the deployment process_
21
+
The BitPay test helper is probably the easi
24
22
25
23
### Pairing Programatically
26
24
@@ -32,9 +30,10 @@ The example below demonstrates this, assuming that the bitpay-go client is impor
During development and testing, take advantage of the [Bitcoin TestNet](https://en.bitcoin.it/wiki/Testnet) by creating a client with the ApiUri value "https://test.bitpay.com"
58
+
During development and testing, take advantage of the [Bitcoin TestNet](https://en.bitcoin.it/wiki/Testnet) by creating a client with the ApiUri value "https://test.bitpay.com"
60
59
61
60
Note that in order to pair with testnet, you will need a pairing code from test.bitpay.com.
62
61
63
62
## API Documentation
64
63
65
64
API Documentation is available on the [BitPay site](https://bitpay.com/api).
The python script should retrieve three pairing codes from the server and store them in three files in a `temp` directory in the main project directory, `temp/retrievecode.txt`, `temp/paircode.txt`, and `temp/invoicecode.txt`. If this does not go smoothly, you can manually add the pairing codes to those files by visiting (https://test.bitpay.com/dashboard/merchant/api-tokens) and creating three tokens, saving each pairing code into one of the files in temp.
36
+
1. Set the environment variables `BITPAYAPI` & `BITPAYPEM` to "https://test.bitpay.com" and a valid PEM value.
36
37
37
-
1. For reasons that are not entirely clear, we need to delete all of the required files and re-import them.
38
-
39
-
`rm -rf src/github.com src/golang`
38
+
This is slightly tricky, the PEM file has to already be paired with a merchant token on your bitpay account. To do this it is probably best to use the [bitpay test helper](https://github.com/bitpay/bitpay-test-helper).
40
39
41
-
`go get -u -t github.com/bitpay/bitpay-go/client`
40
+
1. You will also need a paid invoice on the server. Set the environment variable `INVOICEID` to the id of a paid invoice on the server.
42
41
43
42
1. We are now ready to run the tests.
44
-
43
+
45
44
`ginkgo -r src/github.com/bitpay/`
46
-
45
+
47
46
## Found a bug?
48
47
Let us know! Send a pull request or a patch. Questions? Ask! We're here to help. We will respond to all filed issues.
// PairWithCode retrieves a token from the server and authenticates the keys of the calling client. The string passed to the client is a "pairing code" that must be retrieved from https://bitpay.com/dashboard/merchant/api-tokens. PairWithCode returns a Token type that must be assigned to the Token field of a client in order for that client to create invoices. For example `client.Token = client.PairWithCode("abcdefg")`.
// GetInvoice is a public facade method, any client which has the ApiUri field set can retrieve an invoice from that endpoint, provided they have the invoice id.
0 commit comments