Skip to content

Commit a38f7d8

Browse files
committed
Added code in init methods of model, corrected rates,currency,subscription
1 parent 33ea167 commit a38f7d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+9027
-312
lines changed

docs/GUIDE.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Using the BitPay Python client
2+
3+
This SDK provides a convenient abstraction of BitPay's [cryptographically-secure API](https://bitpay.com/api) and allows payment gateway developers to focus on payment flow/e-commerce integration rather than on the specific details of client-server interaction using the API. This SDK optionally provides the flexibility for developers to have control over important details, including the handling of private keys needed for client-server communication.
4+
5+
It also implements BitPay's remote client authentication and authorization strategy. No private or shared-secret information is ever transmitted over the wire.
6+
7+
8+
- [Dependencies](GUIDE.md#dependencies)
9+
- [Installation](GUIDE.md#installation)
10+
- [Handling your client private key](GUIDE.md#handling-your-client-private-key)
11+
- [Initializing your BitPay client](GUIDE.md#initializing-your-BitPay-client)
12+
- [Pair your client with BitPay](GUIDE.md#pair-your-client-with-BitPay)
13+
- [Getting Started](GUIDE.md#getting-started)
14+
- [Invoice](docs/invoice.md)
15+
- [Bill](docs/bill.md)
16+
- [Ledger](docs/ledger.md)
17+
- [Payout Recipient](docs/payout-recipient.md)
18+
- [Payouts](docs/payouts.md)
19+
- [Payout Batch](docs/payout-batch.md)
20+
- [Rate](docs/rate.md)
21+
- [Refunds](docs/refunds.md)
22+
- [Settlement](docs/settlement.md)
23+
- [Wallet](docs/wallet.md)
24+
- [Errors](docs/errors.md)
25+
- [Copyright](GUIDE.md#copyright)
26+
27+
## Dependencies
28+
29+
You must have a BitPay merchant account to use this SDK. It's free to [sign-up for a BitPay merchant account](https://bitpay.com/start).
30+
31+
If you need a test account, please visit https://test.bitpay.com/dashboard/signup and register for a BitPay merchant test account. Please fill in all questions, so you get a fully working test account.
32+
If you are looking for a testnet bitcoin wallet to test with, please visit https://bitpay.com/wallet and
33+
create a new wallet.
34+
If you need testnet bitcoin please visit a testnet faucet, e.g. https://testnet.coinfaucet.eu/en/ or http://tpfaucet.appspot.com/
35+
36+
For more information about testing, please see https://bitpay.com/docs/testing
37+
38+
## Installation
39+
40+
You can find and download this package from pip
41+
Make sure you have the latest version to avoid implementation and security issues.
42+
43+
### Handling your client private key
44+
45+
Each client paired with the BitPay server requires a ECDSA key. This key provides the security mechanism for all client interaction with the BitPay server. The public key is used to derive the specific client identity that is displayed on your BitPay dashboard. The public key is also used for securely signing all API requests from the client. See the [BitPay API](https://bitpay.com/api) for more information.
46+
47+
The private key should be stored in the client environment such that it cannot be compromised. If your private key is compromised you should revoke the compromised client identity from the BitPay server and re-pair your client, see the [API tokens](https://bitpay.com/api-tokens) for more information.
48+
49+
The [BitPay.Net Setup utility](https://github.com/bitpay/csharp-bitpay-client/releases/download/v3.1.1912/BitPay.Net_Setup_utility_3.1.1912.zip) helps to generate the private key, as well as a environment file formatted in JSON which contains all configuration requirements, that should be stored in the client local file system. It is not recommended to transmit the private key over any public or unsecure networks.
50+
51+
Follow the guide [BitPay.Net Setup utility guide](https://github.com/bitpay/csharp-bitpay-client/blob/master/BitPaySetup/README.md) that assist you to create the environment file which you will be able to modify it, either manually or by using the BitPay.Net Setup utility, later on by asking you to provide the path to your existing JSON file.
52+
53+
### Initializing your BitPay client
54+
55+
Once you have the environment file (JSON previously generated) you can initialize the client in two ways:
56+
57+
```python
58+
from bitpay_sdk.client import Client
59+
60+
bitpay = Client(config_file_path)
61+
```
62+
63+
```python
64+
from bitpay_sdk.client import Client
65+
66+
bitpay = Client(None, environment, private_key_path, tokens)
67+
```
68+
69+
### Pair your client with BitPay
70+
71+
Your client must be paired with the BitPay server. The pairing initializes authentication and authorization for your client to communicate with BitPay for your specific merchant account.
72+
73+
Pairing is accomplished by having the BitPay.Net Setup utility request a pairing code from the BitPay server.
74+
Meanwhile a new pairing code is generated, the BitPay.Net Setup utility will ask you to activate it in your BitPay account. It will also store the paired token in the environment file.
75+
76+
The pairing code is then entered into the BitPay merchant dashboard for the desired merchant. Your interactive authentication at https://bitpay.com/login provides the authentication needed to create finalize the client-server pairing request.
77+
78+
## Copyright
79+
Copyright (c) 2019 BitPay
80+
81+
See also the tests project for more examples of API calls.

0 commit comments

Comments
 (0)