@@ -14,14 +14,14 @@ pip install pythepeer
1414```
1515
1616## Usage
17- Instantiate the ThePeerInit class like so:
17+ Instantiate the ThepeerInit class like so:
1818``` python
1919import thepeer
20- from thepeer.main import ThePeerInit
20+ from thepeer.main import ThepeerInit
2121
2222# create an instance of ThePeerInit class
2323
24- thepeer_instance = ThePeerInit (" YOUR_API_KEY_HERE" )
24+ thepeer_instance = ThepeerInit (" YOUR_API_KEY_HERE" )
2525
2626```
2727
@@ -30,7 +30,7 @@ thepeer_instance = ThePeerInit("YOUR_API_KEY_HERE")
3030** Note:**
3131 - For More info about the exposed methods, please refer to the general [ documentation] ( https://docs.thepeer.co/ )
3232 - Be sure to keep your API Credentials securely in [ environment variables] ( https://www.twilio.com/blog/environment-variables-python )
33- #### ``` Indexing A User ```
33+ ### Indexing A User
3434This describes how to index a user on your account (this is usually the first step before using other methods)
3535
3636``` python
@@ -41,11 +41,11 @@ test = thepeer_instance.index_user("Osagie Iyayi", "
[email protected] ", "
4141
4242| Parameters | Data Type | Required | Description |
4343| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
44- | name | string | true | The name of user to be indexed.
45- | identifier | string | true | the identifier of the account(either email or username).
46- | email | string | true | the email of the user |
44+ | ``` name ``` | ``` string ``` | ``` true ``` | ``` The name of user to be indexed ``` .
45+ | ``` identifier ``` | ``` string ``` | ``` true ``` | ``` the identifier of the account(either email or username). ```
46+ | ``` email ``` | ``` string ``` | ``` true ``` | ``` the email of the user ``` |
4747
48- #### ``` Validating a HMAC signature ```
48+ ### Validating a HMAC signature
4949This method validates incoming an [ hmac] ( https://www.okta.com/identity-101/hmac/ ) signature with the payload and credentials that was passed with it
5050
5151** Pro Tip:** it is used to verify that an incoming webhook event/response is coming from thepeer's servers
@@ -57,10 +57,10 @@ test = thepeer_instance.validate_signature(data,signature)
5757
5858| Parameters | Data Type | Required | Description |
5959| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
60- | data | dictionary | true | the payload containing the data to be authenticated
61- | signature | string | true | The HMAC signature |
60+ | ``` data ``` | ``` dictionary ``` | ``` true ``` | ``` the payload containing the data to be authenticated ```
61+ | ``` signature ``` | ``` string ``` | ``` true ``` | ``` The HMAC signature ``` |
6262
63- #### ``` Get an Indexed User ```
63+ ### Get an Indexed User
6464This method gets the information of an indexed user
6565
6666``` python
@@ -72,9 +72,9 @@ test = thepeer_instance.view_user("3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd")
7272
7373| Parameters | Data Type | Required | Description |
7474| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
75- | reference | string | true | the unique reference returned when the user was indexed
75+ | ``` reference ``` | ``` string ``` | ``` true ``` | ``` the unique reference returned when the user was indexed ```
7676
77- #### ``` Get All Indexed Users ```
77+ ### Get All Indexed Users
7878This method returns all indexed users for a specific account
7979
8080``` python
@@ -85,11 +85,11 @@ test = thepeer_instance.all_users(1,15)
8585
8686| Parameters | Data Type | Required | Description |
8787| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
88- | page | integer | false | the first page displaying all the indexed users. defaults to 1
89- | per_page | integer | false | The number of users to display per page. defaults to 15 |
88+ | ``` page ``` | ``` integer ``` | ``` false ``` | ``` the first page displaying all the indexed users. defaults to 1 ```
89+ | ``` per_page ``` | ``` integer ``` | ``` false ``` | ``` The number of users to display per page. defaults to 15 ``` |
9090
9191
92- #### ``` Update an Indexed User ```
92+ ### Update an Indexed User
9393This methods helps to update the details of an indexed user
9494
9595``` python
@@ -99,16 +99,16 @@ test = thepeer_instance.update_user(reference,**data)
9999
100100| Parameters | Data Type | Required | Description |
101101| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
102- | reference | string | true | the unique reference returned when the user was indexed
103- | data | Any | true | A keyword argument which contains on or more of the indexed user's email, name or identifier |
102+ | ``` reference ``` | ``` string ``` | ``` true ``` | ``` the unique reference returned when the user was indexed ```
103+ | ``` data ``` | ``` Any ``` | ``` true ``` | ``` A keyword argument which contains on or more of the indexed user's email, name or identifier ``` |
104104
105105### Sample
106106``` python
107- test = thepeer_instance.update_user(" 3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd" , identifier = " iyayiemmanuel1@gmail .com" ,
108- name = " Osagie Iyayi " ,
109- email = " iyayiemmanuel1 @gmail.com" )
107+ test = thepeer_instance.update_user(" 3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd" , identifier = " dwave101@yahoo .com" ,
108+ name = " Edmond Kirsch " ,
109+ email = " dwave101 @gmail.com" )
110110```
111- #### ``` Remove an Indexed User ```
111+ ### Remove an Indexed User
112112This methods helps to remove the details of an indexed user from a specific account
113113
114114``` python
@@ -119,9 +119,9 @@ test = thepeer_instance.delete_user("3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd")
119119
120120| Parameters | Data Type | Required | Description |
121121| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
122- | reference | string | true | the unique reference returned when the user was indexed
122+ | ``` reference ``` | ``` string ``` | ``` true ``` | ``` the unique reference returned when the user was indexed ```
123123
124- #### ``` Get User Links ```
124+ ### Get User Links
125125
126126This method gets all payment links associated to an indexed user
127127``` python
@@ -131,10 +131,10 @@ test = thepeer_instance.get_user_links("3bbb0fbf-82fa-48a0-80eb-d2c0338fe7dd")
131131
132132| Parameters | Data Type | Required | Description |
133133| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
134- | reference | string | true | the unique reference returned when the user was indexed
134+ | ``` reference ``` | ``` string ``` | ``` true ``` | ``` the unique reference returned when the user was indexed ```
135135
136136
137- ### ``` Get Single Link ```
137+ ### Get Single Link
138138
139139This method gets the payment information located in a payment link
140140
@@ -146,10 +146,10 @@ test = thepeer_instance.get_single_link("da14a90c-61c2-4cf7-a837-e3112a2d0c3d")
146146
147147| Parameters | Data Type | Required | Description |
148148| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
149- | link_id | string | true | the unique link_id containing the payment information
149+ | ``` link_id ``` | ``` string ``` | ``` true ``` | ``` the unique link_id containing the payment information ```
150150
151151
152- ### ``` Charge A Link```
152+ ### Charge A Link
153153This method allows a business to charge a user via their linked account
154154``` python
155155test = thepeer_instance.charge_link(link_id, amount, remark, currency)
@@ -159,12 +159,12 @@ test = thepeer_instance.charge_link(link_id, amount, remark, currency)
159159
160160| Parameters | Data Type | Required | Description |
161161| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
162- | link_id | string | true | the unique link_id containing the payment information
163- | amount | integer | true | the amount of the whole transaction
164- | remark | string | true | short detail about the transaction |
165- | currency | string | false | The denomination medium of paying (either one of NGN and USD). defaults to NGN
162+ | ``` link_id ``` | ``` string ``` | ``` true ``` | ``` the unique link_id containing the payment information ```
163+ | ``` amount ``` | ``` integer ``` | ``` true ``` | ``` the amount of the whole transaction ```
164+ | ``` remark ``` | ``` string ``` | ``` true ``` | ``` short detail about the transaction ``` |
165+ | ``` currency ``` | ``` string ``` | ``` false ``` | ``` The denomination medium of paying (either one of NGN and USD). defaults to NGN ```
166166
167- ### ``` Authorize Direct Charge ```
167+ ### Authorize Direct Charge
168168This method allows a business to authorize a direct charge request made by a user
169169
170170``` python
@@ -174,13 +174,13 @@ test = thepeer_instance.authorize_direct_charge(auth_charge_reference, event)
174174
175175| Parameters | Data Type | Required | Description |
176176| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
177- | auth_charge_reference | string | true | the reference associated to a pending charge request
178- | event | string | true | the type of webhook event |
177+ | ``` auth_charge_reference ``` | ``` string ``` | ``` true ``` | ``` the reference associated to a pending charge request ```
178+ | ``` event ``` | ``` string ``` | ``` true ``` | ``` the type of webhook event ``` |
179179
180180** Pro Tip:** the various types of webhook events are available [ here] ( https://docs.thepeer.co/authorization/process-authorization-requests#supported-events )
181181
182182
183- ### ``` Get Transaction Detail ```
183+ ### Get Transaction Detail
184184This method gets the details of a transaction
185185``` python
186186test = thepeer_instance.get_transaction_detail(" eda58ee3-4f2c-4aa4-9da7-10a2b8ced453" )
@@ -190,9 +190,9 @@ test = thepeer_instance.get_transaction_detail("eda58ee3-4f2c-4aa4-9da7-10a2b8ce
190190
191191| Parameters | Data Type | Required | Description |
192192| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
193- | transaction_id | string | true | the unique transaction identifier
193+ | ``` transaction_id ``` | ``` string ``` | ``` true ``` | ``` the unique transaction identifier ```
194194
195- ### ``` Refund Transaction ```
195+ ### Refund Transaction
196196This method allows a business to refund a transaction back to the user for obvious reasons
197197``` python
198198test = thepeer_instance.refund_transaction(" 28e52edf-16d9-4921-8a54-ef34d7029707" , " possible threat actor" ):
@@ -201,8 +201,8 @@ test = thepeer_instance.refund_transaction("28e52edf-16d9-4921-8a54-ef34d7029707
201201#### Parameters Required
202202| Parameters | Data Type | Required | Description |
203203| ----------------------| ---------------------------| ----------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
204- | transaction_id | string | true | the unique transaction identifier
205- | reason | string | false | a short sentence explaining reasons for the refund |
204+ | ``` transaction_id ``` | ``` string ``` | ``` true ``` | ``` the unique transaction identifier ```
205+ | ``` reason ``` | ``` string ``` | ``` false ``` | ``` a short sentence explaining reasons for the refund ``` |
206206
207207
208208
0 commit comments