Transactions
TransactionClient
Bases: BaseAPIClient
Provides a wrapper for paystack Transactions API
The Transactions API allows you to create and manage payments on your integration. see https://paystack.com/docs/api/transaction/
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 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 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 |
|
charge(amount, email, auth_code, reference=None, currency=None, metadata=None, channels=None, subaccount=None, transaction_charge=None, bearer=None, queue=False, alternate_model_class=None)
All authorizations marked as reusable can be charged with this endpoint whenever you need to receive payments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount
|
int
|
amount to charge. |
required |
email
|
str
|
Customer's email address |
required |
auth_code
|
str
|
Valid authorization code to charge |
required |
reference
|
str | None
|
Unique transaction reference. Only |
None
|
currency
|
Currency | None
|
Currency in which amount should be charged. Any value from the
|
None
|
metadata
|
dict[str, Any] | None
|
Add a custom_fields attribute which has an array of objects if
you would like the fields to be added to your transaction when
displayed on the dashboard.
Sample: |
None
|
channels
|
list[Channel] | None
|
A list of |
None
|
subaccount
|
str | None
|
The code for the subaccount that owns the payment. e.g. ACCT_8f4s1eq7ml6rlzj |
None
|
transaction_charge
|
int | None
|
A flat fee to charge the subaccount for this transaction (in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR). This overrides the split percentage set when the subaccount was created. Ideally, you will need to use this if you are splitting in flat rates (since subaccount creation only allows for percentage split). e.g., 7000 for a 70 naira |
None
|
bearer
|
Bearer | None
|
Who bears Paystack charges? any value from the |
None
|
queue
|
bool
|
If you are making a scheduled charge call, it is a good idea to queue them so the processing
system does not get overloaded causing transaction processing errors. Set |
False
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[Transaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
|
export(page=None, start_date=None, end_date=None, customer=None, status=None, currency=None, amount=None, settled=None, settlement=None, payment_page=None, pagination=50, alternate_model_class=None)
Fetch transactions carried out on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
int | None
|
Specifies exactly what page you want to retrieve. If not specified, we use a default value of 1. |
None
|
start_date
|
str | None
|
A timestamp from which to start listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
end_date
|
str | None
|
A timestamp at which to stop listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
customer
|
str | int | None
|
Specify an ID for the customer whose transactions you want to retrieve |
None
|
status
|
TransactionStatus | None
|
Filter transactions by status. Any value from the |
None
|
currency
|
Currency | None
|
Specify the transaction currency to export. Any value from the |
None
|
amount
|
int | None
|
Filter transactions by amount. Specify the amount, in
kobo if currency is |
None
|
settled
|
bool | None
|
Set to |
None
|
settlement
|
str | None
|
An ID for the settlement whose transactions we should export |
None
|
payment_page
|
str | None
|
Optional[int] Specify a payment page's id to export only transactions conducted on said page |
None
|
pagination
|
int
|
int Specifies how many records you want to retrieve per page. If not specified, we use a default value of 50. |
50
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[TransactionExport] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
get_timeline(id_or_ref, alternate_model_class=None)
View the timeline of a transaction
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_ref
|
int | str
|
The ID or the reference of the transaction |
required |
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[TransactionLog] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
get_transaction(id_, alternate_model_class=None)
Get details of a transaction carried out on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_
|
int | str
|
An ID for the transaction to fetch |
required |
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[Transaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
get_transactions(customer=None, start_date=None, end_date=None, status=None, page=None, amount=None, pagination=50, alternate_model_class=None)
Fetch transactions carried out on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
customer
|
int | str | None
|
Specify an ID for the customer whose transactions you want to retrieve |
None
|
start_date
|
str | None
|
A timestamp from which to start listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
end_date
|
str | None
|
A timestamp at which to stop listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
status
|
TransactionStatus | None
|
Filter transactions by status. any value from the |
None
|
page
|
int | None
|
Specify exactly what page you want to retrieve. If not specified, we use a default value of 1. |
None
|
amount
|
int | None
|
Optional[int]
Filter transactions by amount. Specify the amount (in kobo if currency is
|
None
|
pagination
|
int
|
Specifies how many records you want to retrieve per page. If not specified, we use a default value of 50. |
50
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[list[Transaction]] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
initialize(amount, email, currency=None, reference=None, callback_url=None, plan=None, invoice_limit=None, metadata=None, channels=None, split_code=None, subaccount=None, transfer_charge=None, bearer=None, alternate_model_class=None)
Initialize a transaction from your backend
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount
|
int
|
Amount should be in kobo if currency is |
required |
email
|
str
|
Customer's email address |
required |
currency
|
Currency | None
|
Any value from the |
None
|
reference
|
str | None
|
Unique transaction reference. Only |
None
|
callback_url
|
str | None
|
Fully qualified url, e.g. |
None
|
plan
|
str | None
|
If transaction is to create a subscription to a predefined plan, provide plan code here.
This would invalidate the value provided in |
None
|
invoice_limit
|
int | None
|
Number of times to charge customer during subscription to plan |
None
|
metadata
|
dict[str, Any] | None
|
A dictionary of additional info. check out this link for more information. https://paystack.com/docs/payments/metadata |
None
|
channels
|
list[Channel] | None
|
A list of |
None
|
split_code
|
str | None
|
The split code of the transaction split. e.g. SPL_98WF13Eb3w |
None
|
subaccount
|
str | None
|
The code for the subaccount that owns the payment. e.g. ACCT_8f4s1eq7ml6rlzj |
None
|
transfer_charge
|
int | None
|
An amount used to override the split configuration for a single split payment. If set, the amount specified goes to the main account regardless of the split configuration. |
None
|
bearer
|
Bearer | None
|
Any value from the |
None
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[InitTransaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Raises:
Type | Description |
---|---|
InvalidDataError
|
When email is not provided. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
partial_debit(auth_code, currency, amount, email, reference=None, at_least=None, alternate_model_class=None)
Retrieve part of a payment from a customer
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_code
|
str
|
Authorization Code |
required |
currency
|
Currency
|
Specify the currency you want to debit. Any value
from the |
required |
amount
|
int
|
Amount should be in kobo if currency is |
required |
email
|
str
|
Customer's email address (attached to the authorization code) |
required |
reference
|
str | None
|
Unique transaction reference. Only |
None
|
at_least
|
int | None
|
Minimum amount to charge |
None
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[Transaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Raises:
Type | Description |
---|---|
InvalidDataError
|
When Customer's email is not provided. When Customer's auth code is not provided. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
totals(page=None, start_date=None, end_date=None, pagination=50, alternate_model_class=None)
Total amount received on your account
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
int | None
|
Specifies exactly what page you want to retrieve. If not specified, we use a default value of 1. |
None
|
start_date
|
str | None
|
A timestamp from which to start listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
end_date
|
str | None
|
A timestamp at which to stop listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
pagination
|
int
|
Specifies how many records you want to retrieve per page. If not specified, we use a default value of 50. |
50
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[TransactionTotal] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
verify(reference, alternate_model_class=None)
Confirm the status of a transaction
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference
|
str
|
The transaction reference used to initiate the transaction |
required |
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[Transaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/sync_clients/transactions.py
AsyncTransactionClient
Bases: BaseAsyncAPIClient
Provides a wrapper for paystack Transactions API
The Transactions API allows you to create and manage payments on your integration. https://paystack.com/docs/api/transaction/
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 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 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 |
|
charge(amount, email, auth_code, reference=None, currency=None, metadata=None, channels=None, subaccount=None, transaction_charge=None, bearer=None, queue=False, alternate_model_class=None)
async
All authorizations marked as reusable can be charged with this endpoint whenever you need to receive payments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount
|
int
|
amount to charge. |
required |
email
|
str
|
Customer's email address |
required |
auth_code
|
str
|
Valid authorization code to charge |
required |
reference
|
str | None
|
Unique transaction reference. Only |
None
|
currency
|
Currency | None
|
Currency in which amount should be charged. Any value from the
|
None
|
metadata
|
dict[str, Any] | None
|
Add a custom_fields attribute which has an array of objects if
you would like the fields to be added to your transaction when
displayed on the dashboard.
Sample: |
None
|
channels
|
list[Channel] | None
|
A list of |
None
|
subaccount
|
str | None
|
The code for the subaccount that owns the payment. e.g. ACCT_8f4s1eq7ml6rlzj |
None
|
transaction_charge
|
int | None
|
A flat fee to charge the subaccount for this transaction (in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR). This overrides the split percentage set when the subaccount was created. Ideally, you will need to use this if you are splitting in flat rates (since subaccount creation only allows for percentage split). e.g., 7000 for a 70 naira |
None
|
bearer
|
Bearer | None
|
Who bears Paystack charges? any value from the |
None
|
queue
|
bool
|
If you are making a scheduled charge call, it is a good idea to queue them so the processing
system does not get overloaded causing transaction processing errors. Set |
False
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[Transaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
|
export(page=None, start_date=None, end_date=None, customer=None, status=None, currency=None, amount=None, settled=None, settlement=None, payment_page=None, pagination=50, alternate_model_class=None)
async
Fetch transactions carried out on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
int | None
|
Specifies exactly what page you want to retrieve. If not specified, we use a default value of 1. |
None
|
start_date
|
str | None
|
A timestamp from which to start listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
end_date
|
str | None
|
A timestamp at which to stop listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
customer
|
str | int | None
|
Specify an ID for the customer whose transactions you want to retrieve |
None
|
status
|
TransactionStatus | None
|
Filter transactions by status. Any value from the |
None
|
currency
|
Currency | None
|
Specify the transaction currency to export. Any value from the |
None
|
amount
|
int | None
|
Filter transactions by amount. Specify the amount, in
kobo if currency is |
None
|
settled
|
bool | None
|
Set to |
None
|
settlement
|
str | None
|
An ID for the settlement whose transactions we should export |
None
|
payment_page
|
str | None
|
Optional[int] Specify a payment page's id to export only transactions conducted on said page |
None
|
pagination
|
int
|
int Specifies how many records you want to retrieve per page. If not specified, we use a default value of 50. |
50
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[TransactionExport] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
get_timeline(id_or_ref, alternate_model_class=None)
async
View the timeline of a transaction
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_or_ref
|
int | str
|
The ID or the reference of the transaction |
required |
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[TransactionLog] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
get_transaction(id_, alternate_model_class=None)
async
Get details of a transaction carried out on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_
|
str
|
An ID for the transaction to fetch |
required |
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[Transaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
get_transactions(customer=None, start_date=None, end_date=None, status=None, page=None, amount=None, pagination=50, alternate_model_class=None)
async
Fetch transactions carried out on your integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
customer
|
int | str | None
|
Specify an ID for the customer whose transactions you want to retrieve |
None
|
start_date
|
str | None
|
A timestamp from which to start listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
end_date
|
str | None
|
A timestamp at which to stop listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
status
|
TransactionStatus | None
|
Filter transactions by status. any value from the |
None
|
page
|
int | None
|
Specify exactly what page you want to retrieve. If not specified, we use a default value of 1. |
None
|
amount
|
int | None
|
Optional[int]
Filter transactions by amount. Specify the amount (in kobo if currency is
|
None
|
pagination
|
int
|
Specifies how many records you want to retrieve per page. If not specified, we use a default value of 50. |
50
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[list[Transaction]] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
initialize(amount, email, currency=None, reference=None, callback_url=None, plan=None, invoice_limit=None, metadata=None, channels=None, split_code=None, subaccount=None, transfer_charge=None, bearer=None, alternate_model_class=None)
async
Initialize a transaction from your backend
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount
|
int
|
Amount should be in kobo if currency is |
required |
email
|
str
|
Customer's email address |
required |
currency
|
Currency | None
|
Any value from the |
None
|
reference
|
str | None
|
Unique transaction reference. Only |
None
|
callback_url
|
str | None
|
Fully qualified url, e.g. |
None
|
plan
|
str | None
|
If transaction is to create a subscription to a predefined plan, provide plan code here.
This would invalidate the value provided in |
None
|
invoice_limit
|
int | None
|
Number of times to charge customer during subscription to plan |
None
|
metadata
|
dict[str, Any] | None
|
A dictionary of additional info. check out this link for more information. https://paystack.com/docs/payments/metadata |
None
|
channels
|
list[Channel] | None
|
A list of |
None
|
split_code
|
str | None
|
The split code of the transaction split. e.g. SPL_98WF13Eb3w |
None
|
subaccount
|
str | None
|
The code for the subaccount that owns the payment. e.g. ACCT_8f4s1eq7ml6rlzj |
None
|
transfer_charge
|
int | None
|
An amount used to override the split configuration for a single split payment. If set, the amount specified goes to the main account regardless of the split configuration. |
None
|
bearer
|
Bearer | None
|
Any value from the |
None
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[InitTransaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Raises:
Type | Description |
---|---|
InvalidDataError
|
When email is not provided. |
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
partial_debit(auth_code, currency, amount, email, reference=None, at_least=None, alternate_model_class=None)
async
Retrieve part of a payment from a customer
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_code
|
str
|
Authorization Code |
required |
currency
|
Currency
|
Specify the currency you want to debit. Any value
from the |
required |
amount
|
int
|
Amount should be in kobo if currency is |
required |
email
|
str
|
Customer's email address (attached to the authorization code) |
required |
reference
|
str | None
|
Unique transaction reference. Only |
None
|
at_least
|
int | None
|
Minimum amount to charge |
None
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[Transaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Raises:
Type | Description |
---|---|
InvalidDataError
|
When Customer's email is not provided. When Customer's auth code is not provided. |
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
totals(page=None, start_date=None, end_date=None, pagination=50, alternate_model_class=None)
async
Total amount received on your account
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
int | None
|
Specifies exactly what page you want to retrieve. If not specified, we use a default value of 1. |
None
|
start_date
|
str | None
|
A timestamp from which to start listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
end_date
|
str | None
|
A timestamp at which to stop listing transaction e.g. 2016-09-24T00:00:05.000Z, 2016-09-21 |
None
|
pagination
|
int
|
Specifies how many records you want to retrieve per page. If not specified, we use a default value of 50. |
50
|
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[TransactionTotal] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |
Source code in src/pypaystack2/sub_clients/async_clients/transactions.py
verify(reference, alternate_model_class=None)
async
Confirm the status of a transaction
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference
|
str
|
The transaction reference used to initiate the transaction |
required |
alternate_model_class
|
type[PaystackDataModel] | None
|
A pydantic model class to use instead of the
default pydantic model used by the library to present the data in
the |
None
|
Returns:
Type | Description |
---|---|
Response[Transaction] | Response[PaystackDataModel]
|
A pydantic model containing the response gotten from paystack's server. |