Skip to content

Commit ed77389

Browse files
committed
Updated documentation
1 parent 1dcd446 commit ed77389

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
[![codecov](https://codecov.io/gh/zotapay/python-sdk/branch/master/graph/badge.svg?token=5L1EYONUCU)](https://codecov.io/gh/zotapay/python-sdk)
22
![Python Matrix Test](https://github.com/zotapay/python-sdk/workflows/Python%20Matrix%20Test/badge.svg)
33

4-
## `zotapaysdk`
5-
### Official Python REST API SDK
4+
# Official Python REST API SDK
65
This is the **official** page of the [Zotapay](http://www.zotapay.com) Python SDK. It is intended to be used by
76
developers who run modern Python applications and would like to integrate our next generation payments platform.
87

98

10-
### REST API Docs
9+
## REST API Docs
1110

1211
> **[Official Deposit Documentation](https://doc.zotapay.com/deposit/1.0/#introduction)**
1312
1413
> **[Official Payout Documentation](https://doc.zotapay.com/payout/1.0/#introduction)**
1514
1615

17-
#### Introduction
16+
## Introduction
1817
This Python SDK provides all the necessary methods for integrating the Zotapay Merchant API.
1918
This SDK is to be used by clients, as well as all the related eCommerce plugins for Python applications.
2019

2120
The SDK covers all available functionality that ZotaPay's Merchant API exposes.
2221

23-
#### Requirements
22+
### Requirements
2423
* A functioning Zotapay Sandbox or Production account and related credentials
2524
* Python 3.5 (or higher)
2625

27-
#### Installation
26+
### Installation
2827
```sh
2928
pip install zotapaysdk
3029
```
3130

3231

33-
#### Configuration
32+
## Configuration
3433

3534
[API CONFIGURATION DOCS](https://doc.zotapay.com/deposit/1.0/?python#before-you-begin)
3635

@@ -41,7 +40,7 @@ Credentials for the SDK can be passed in 3 different ways:
4140

4241
This part of the documentation will guide you on how to configure and use this SDK.
4342

44-
##### Before you begin
43+
### Before you begin
4544

4645
To use this API, obtain the following credentials from Zotapay:
4746

@@ -53,16 +52,16 @@ EndpointID One or more unique endpoint identifiers to use in API request
5352

5453
Contact [Zotapay](https://zotapay.com/contact/) to start your onboarding process and obtain all the credentials.
5554

56-
##### API Url
55+
### API Url
5756
There are two environments to use with the Zotapay API:
5857

5958
> Sandbox environment, used for integration and testing purposes.
60-
>>`https://api.zotapay-sandbox.com`
59+
`https://api.zotapay-sandbox.com`
6160

6261
> Live environment.
63-
>>`https://api.zotapay.com` or `https://mg-api.zotapay.com`
62+
`https://api.zotapay.com`
6463

65-
##### Configuration in the code
64+
### Configuration in the code
6665

6766
The implementation fo the Zotapay API SDK depends on creating an instance of the `MGClient`. First priority
6867
configuration is the one passed to the client itself.
@@ -79,7 +78,7 @@ client = zotapaysdk.MGClient(
7978

8079
Passing configuration to the client itself is best when supporting multiple clients.
8180

82-
##### Environment variables configuration
81+
### Environment variables configuration
8382

8483
There are 4 environment variables that need to be set for the API SDK to be configured correctly:
8584

@@ -91,7 +90,7 @@ ZOTAPAY_REQUEST_URL - https://api.zotapay-sandbox.com or https://api
9190
```
9291

9392

94-
##### Configuration file
93+
### Configuration file
9594
Configuration parameters can be passed through a `.mg_env` file placed in the user's home directory.
9695

9796
The structure of the files follows Python's [configparser](https://docs.python.org/3/library/configparser.html)
@@ -105,19 +104,19 @@ endpoint_id=<EndpointID as received from Zotapay>,
105104
request_url=<MGClient.LIVE_API_URL or MGClient.SANDBOX_API_URL or "https://api.zotapay-sandbox.com"...>
106105
```
107106

108-
#### Usage
107+
## Usage
109108
In order to use the SDK we need to instantiate a client:
110-
```
109+
```python
111110
from zotapaysdk.client import MGClient
112111

113112
mg_client = MGClient()
114113
```
115114

116-
##### Deposit
115+
### Deposit
117116

118117
A deposit request can be generated in two different ways:
119118

120-
```
119+
```python
121120
from zotapaysdk.mg_requests import MGDepositRequest
122121

123122
example_deposit_request_with_kwargs = MGDepositRequest(
@@ -142,10 +141,10 @@ example_deposit_request_with_kwargs = MGDepositRequest(
142141

143142
```
144143

145-
or
144+
or alternatively
146145

147146

148-
```
147+
```python
149148
example_deposit_request = MGDepositRequest(). \
150149
set_merchant_order_id("QvE8dZshpKhaOmHY"). \
151150
set_merchant_order_desc("Test order"). \
@@ -168,14 +167,15 @@ example_deposit_request = MGDepositRequest(). \
168167

169168
Sending the request to Zotapay happens through the client:
170169

171-
```
170+
```python
172171
deposit_response = mg_client.send_deposit_request(example_deposit_request)
173172
print("Deposit Request is " + str(deposit_response.is_ok))
174173
```
175174

176175
In order to send a `Credit Card Deposit` we need to append the appropriate [Credit Card Params](https://doc.zotapay.com/deposit/1.0/?python#card-payment-integration-2)
177176
which is achieved through sending a `MGCardDepositRequest`
178-
```
177+
178+
```python
179179
example_cc_deposit_request = MGCardDepositRequest(
180180
merchant_order_id="QvE8dZshpKhaOmHY",
181181
merchant_order_desc="Test order",
@@ -207,19 +207,19 @@ deposit_response = mg_client.send_deposit_request(example_cc_deposit_request)
207207
print("Deposit Request is " + str(deposit_response.is_ok))
208208
```
209209

210-
##### Working with `Deposit Response`
210+
### Working with `Deposit Response`
211211
Each deposit attempt against a Zotapay returns either a `MGDepositResponse` or `MGCardDepositResponse`.
212212

213213
The above objects are simply a wrapper around the standard HTTP response as described [here](https://doc.zotapay.com/deposit/1.0/?python#issue-a-deposit-request).
214214

215215
The response classes contain an additional helper method that validates the signature of the response when provided with a `merchant_secret_key`
216216

217-
#### Payout
217+
## Payout
218218
Sending a payout request is almost identical to sending a deposit request.
219219

220220
The request is built:
221221

222-
```
222+
```python
223223
from zotapaysdk.mg_requests import MGPayoutRequest
224224

225225
example_payout_request = \
@@ -248,18 +248,18 @@ example_payout_request = \
248248

249249
The client returns `MGPayoutResponse` which is again a wrapper around the standard HTTP response.
250250

251-
#### Callbacks
251+
## Callbacks
252252
`MGCallback` is a class that parses the raw HTTP Request sent from Zotapay to the configured endpoint. It's purpose
253253
is to make working with callbacks manageable.
254254

255255

256-
#### Validations
256+
## Validations
257257
The `MGRequest` class implements a `validate()` method which can be used for parameter validation of the request
258258
offline before the request is being sent. It's purpose is to check whether all the values passsed to the different
259259
parameters is in-line with what Zotapay's endpoint expects. See the API DOCS for more info and guidance about the
260260
format of the different parameters.
261261

262-
### Test Coverage
262+
## Test Coverage
263263

264264
[![codecov](https://codecov.io/gh/zotapay/python-sdk/graphs/tree.svg?width=650&height=150&src=pr&token=5L1EYONUCU)](https://codecov.io/gh/zotapay/python-sdk/)
265265

docs/RELEASING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Releasing the package
2+
3+
In order to release the package, commit anything to master and a new tag should be created. Go to releases and simply publish the latest draft release!

0 commit comments

Comments
 (0)