Refunds
AsyncRefund
Bases: BaseAsyncAPI
Provides a wrapper for paystack Refunds API
The Refunds API allows you to create and manage transaction refunds. https://paystack.com/docs/api/refund/
Source code in src/pypaystack2/api/refunds.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
|
create(transaction, amount=None, currency=None, customer_note=None, merchant_note=None)
async
Initiate a refund on your integration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transaction
|
str
|
Transaction reference or id |
required |
amount
|
Optional[int]
|
Amount ( in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR ) to be refunded to the customer. Amount is optional(defaults to original transaction amount) and cannot be more than the original transaction amount |
None
|
currency
|
Optional[Currency]
|
Any value from the |
None
|
customer_note
|
Optional[str]
|
Customer reason |
None
|
merchant_note
|
Optional[str]
|
Merchant reason |
None
|
Returns:
Type | Description |
---|---|
Response
|
A named tuple containing the response gotten from paystack's server. |
Source code in src/pypaystack2/api/refunds.py
get_refund(reference)
async
Get details of a refund on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference
|
str
|
Identifier for transaction to be refunded |
required |
Returns:
Type | Description |
---|---|
Response
|
A named tuple containing the response gotten from paystack's server. |
Source code in src/pypaystack2/api/refunds.py
get_refunds(reference=None, currency=None, pagination=50, page=1, start_date=None, end_date=None)
async
Fetch refunds available on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference
|
Optional[str]
|
Identifier for transaction to be refunded |
None
|
currency
|
Optional[Currency]
|
Any value from the |
None
|
pagination
|
int
|
Specifies how many records you want to retrieve per page. If not specified we use a default value of 50. |
50
|
page
|
int
|
Specifies exactly what refund you want to page. If not specified we use a default value of 1. |
1
|
start_date
|
Optional[str]
|
A timestamp from which to start listing refund e.g. 2016-09-21 |
None
|
end_date
|
Optional[str]
|
A timestamp at which to stop listing refund e.g. 2016-09-21 |
None
|
Returns:
Type | Description |
---|---|
Response
|
A named tuple containing the response gotten from paystack's server. |
Source code in src/pypaystack2/api/refunds.py
Refund
Bases: BaseAPI
Provides a wrapper for paystack Refunds API
The Refunds API allows you to create and manage transaction refunds. https://paystack.com/docs/api/refund/
Source code in src/pypaystack2/api/refunds.py
create(transaction, amount=None, currency=None, customer_note=None, merchant_note=None)
Initiate a refund on your integration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transaction
|
str
|
Transaction reference or id |
required |
amount
|
Optional[int]
|
Amount ( in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR ) to be refunded to the customer. Amount is optional(defaults to original transaction amount) and cannot be more than the original transaction amount |
None
|
currency
|
Optional[Currency]
|
Any value from the |
None
|
customer_note
|
Optional[str]
|
Customer reason |
None
|
merchant_note
|
Optional[str]
|
Merchant reason |
None
|
Returns:
Type | Description |
---|---|
Response
|
A named tuple containing the response gotten from paystack's server. |
Source code in src/pypaystack2/api/refunds.py
get_refund(reference)
Get details of a refund on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference
|
str
|
Identifier for transaction to be refunded |
required |
Returns:
Type | Description |
---|---|
Response
|
A named tuple containing the response gotten from paystack's server. |
Source code in src/pypaystack2/api/refunds.py
get_refunds(reference=None, currency=None, pagination=50, page=1, start_date=None, end_date=None)
Fetch refunds available on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference
|
Optional[str]
|
Identifier for transaction to be refunded |
None
|
currency
|
Optional[Currency]
|
Any value from the |
None
|
pagination
|
int
|
Specifies how many records you want to retrieve per page. If not specified we use a default value of 50. |
50
|
page
|
int
|
Specifies exactly what refund you want to page. If not specified we use a default value of 1. |
1
|
start_date
|
Optional[str]
|
A timestamp from which to start listing refund e.g. 2016-09-21 |
None
|
end_date
|
Optional[str]
|
A timestamp at which to stop listing refund e.g. 2016-09-21 |
None
|
Returns:
Type | Description |
---|---|
Response
|
A named tuple containing the response gotten from paystack's server. |