paga-python 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {paga_python-0.1.1 → paga_python-0.1.2}/PKG-INFO +5 -1
- {paga_python-0.1.1 → paga_python-0.1.2}/README.md +4 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/pyproject.toml +1 -1
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/__init__.py +1 -1
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/collection.py +9 -6
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/direct_debit.py +2 -2
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/persistent.py +50 -4
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/subsidiary.py +9 -2
- {paga_python-0.1.1 → paga_python-0.1.2}/.gitignore +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/LICENSE +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/actions.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/airtime.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/auth.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/bill_payment.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/business.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/checkout.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/client.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/codes.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/customer.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/exceptions.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/models.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/money_transfer.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/outcome.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/refunds.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/status.py +0 -0
- {paga_python-0.1.1 → paga_python-0.1.2}/src/paga/webhooks.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: paga-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Unofficial async Python SDK for the Paga Engine API - payments, payouts, wallets and financial operations.
|
|
5
5
|
Project-URL: Homepage, https://github.com/TeamTrustBridge/paga-python
|
|
6
6
|
Project-URL: Documentation, https://github.com/TeamTrustBridge/paga-python#readme
|
|
@@ -38,6 +38,10 @@ Description-Content-Type: text/markdown
|
|
|
38
38
|
> API reference. Paga's own documentation is the source of truth — if this
|
|
39
39
|
> documentation and Paga's disagree, Paga's is right.
|
|
40
40
|
|
|
41
|
+
> **Documentation:** <https://teamtrustbridge.github.io/paga-python-docs/> — the full
|
|
42
|
+
> Python API reference, organised like Paga's own documentation. Source:
|
|
43
|
+
> [TeamTrustBridge/paga-python-docs](https://github.com/TeamTrustBridge/paga-python-docs).
|
|
44
|
+
|
|
41
45
|
`paga-python` makes the Paga developer workflow easy for page and integration
|
|
42
46
|
developers building checkout and payment experiences. It wraps the Paga Engine
|
|
43
47
|
API — payments, refunds, money transfers, airtime, bill payments, Direct
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
> API reference. Paga's own documentation is the source of truth — if this
|
|
8
8
|
> documentation and Paga's disagree, Paga's is right.
|
|
9
9
|
|
|
10
|
+
> **Documentation:** <https://teamtrustbridge.github.io/paga-python-docs/> — the full
|
|
11
|
+
> Python API reference, organised like Paga's own documentation. Source:
|
|
12
|
+
> [TeamTrustBridge/paga-python-docs](https://github.com/TeamTrustBridge/paga-python-docs).
|
|
13
|
+
|
|
10
14
|
`paga-python` makes the Paga developer workflow easy for page and integration
|
|
11
15
|
developers building checkout and payment experiences. It wraps the Paga Engine
|
|
12
16
|
API — payments, refunds, money transfers, airtime, bill payments, Direct
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "paga-python"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "Unofficial async Python SDK for the Paga Engine API - payments, payouts, wallets and financial operations."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "GPL-3.0" }
|
|
@@ -19,6 +19,7 @@ from typing import Any, Dict, List, Optional
|
|
|
19
19
|
|
|
20
20
|
from .auth import (
|
|
21
21
|
COLLECT_BANKS_HASH_FIELDS,
|
|
22
|
+
PAYMENT_REQUEST_FULL_HASH_FIELDS,
|
|
22
23
|
PAYMENT_REQUEST_HASH_FIELDS,
|
|
23
24
|
PAYMENT_STATUS_HASH_FIELDS,
|
|
24
25
|
USD_PAYMENT_STATUS_HASH_FIELDS,
|
|
@@ -115,12 +116,14 @@ class CollectionMixin:
|
|
|
115
116
|
is_allow_over_payments: Whether over-payments are allowed. Optional.
|
|
116
117
|
narration: Optional narration shown to the payer.
|
|
117
118
|
redirect_url: Where to send the customer after the flow. Optional.
|
|
118
|
-
hash_fields: Override the hash field order. The default signs
|
|
119
|
+
hash_fields: Override the hash field order. The default signs the
|
|
120
|
+
full documented set —
|
|
119
121
|
``referenceNumber + amount + currency + payer.phoneNumber +
|
|
120
|
-
payer.email
|
|
121
|
-
|
|
122
|
-
:data:`paga.auth.
|
|
123
|
-
|
|
122
|
+
payer.email + payee.accountNumber + payee.phoneNumber +
|
|
123
|
+
payee.bankId + payee.bankAccountNumber + hashKey``. Pass
|
|
124
|
+
:data:`paga.auth.PAYMENT_REQUEST_HASH_FIELDS` for the shorter
|
|
125
|
+
variant. Paga's Collect API operations page lists the full
|
|
126
|
+
set as the payment request hash.
|
|
124
127
|
|
|
125
128
|
Returns:
|
|
126
129
|
The parsed :class:`CollectPaymentRequestResponse`.
|
|
@@ -183,7 +186,7 @@ class CollectionMixin:
|
|
|
183
186
|
payload,
|
|
184
187
|
use_hash=True,
|
|
185
188
|
use_basic=True,
|
|
186
|
-
hash_fields=hash_fields or
|
|
189
|
+
hash_fields=hash_fields or PAYMENT_REQUEST_FULL_HASH_FIELDS,
|
|
187
190
|
)
|
|
188
191
|
return CollectPaymentRequestResponse.model_validate(response.model_dump())
|
|
189
192
|
|
|
@@ -23,7 +23,7 @@ from .auth import (
|
|
|
23
23
|
CHARGE_MANDATE_STATUS_HASH_FIELDS,
|
|
24
24
|
DISABLE_MANDATE_HASH_FIELDS,
|
|
25
25
|
MANDATE_STATUS_HASH_FIELDS,
|
|
26
|
-
|
|
26
|
+
PAYMENT_REQUEST_FULL_HASH_FIELDS,
|
|
27
27
|
)
|
|
28
28
|
from .models import (
|
|
29
29
|
ChargeMandateResponse,
|
|
@@ -227,7 +227,7 @@ class DirectDebitMixin:
|
|
|
227
227
|
payload,
|
|
228
228
|
use_hash=True,
|
|
229
229
|
use_basic=True,
|
|
230
|
-
hash_fields=
|
|
230
|
+
hash_fields=PAYMENT_REQUEST_FULL_HASH_FIELDS,
|
|
231
231
|
)
|
|
232
232
|
return response
|
|
233
233
|
|
|
@@ -32,6 +32,12 @@ class PersistentPaymentAccountMixin:
|
|
|
32
32
|
credit_bank_id: str,
|
|
33
33
|
credit_bank_account_number: str,
|
|
34
34
|
callback_url: str,
|
|
35
|
+
account_name: str,
|
|
36
|
+
first_name: str,
|
|
37
|
+
last_name: str,
|
|
38
|
+
phone_number: Optional[str] = None,
|
|
39
|
+
email: Optional[str] = None,
|
|
40
|
+
funding_transaction_limit: Optional[float] = None,
|
|
35
41
|
) -> PersistentPaymentAccountResponse:
|
|
36
42
|
"""Register a persistent payment account.
|
|
37
43
|
|
|
@@ -48,6 +54,16 @@ class PersistentPaymentAccountMixin:
|
|
|
48
54
|
credit_bank_id: The credit bank's UUID. From :meth:`get_collect_banks`.
|
|
49
55
|
credit_bank_account_number: The credit account number.
|
|
50
56
|
callback_url: Where Paga sends the funding callback.
|
|
57
|
+
account_name: The customer's full name, as registered with the
|
|
58
|
+
credit bank (for example ``"Bellview Walker"``).
|
|
59
|
+
first_name: The customer's first name.
|
|
60
|
+
last_name: The customer's last name.
|
|
61
|
+
phone_number: The customer's phone number. Paga requires it when
|
|
62
|
+
no email is supplied.
|
|
63
|
+
email: The customer's email address. Paga requires it when no
|
|
64
|
+
phone number is supplied.
|
|
65
|
+
funding_transaction_limit: Optional maximum amount that may be
|
|
66
|
+
transferred to the persistent account.
|
|
51
67
|
|
|
52
68
|
Returns:
|
|
53
69
|
The parsed :class:`PersistentPaymentAccountResponse`.
|
|
@@ -59,7 +75,16 @@ class PersistentPaymentAccountMixin:
|
|
|
59
75
|
"creditBankId": credit_bank_id,
|
|
60
76
|
"creditBankAccountNumber": credit_bank_account_number,
|
|
61
77
|
"callbackUrl": callback_url,
|
|
78
|
+
"accountName": account_name,
|
|
79
|
+
"firstName": first_name,
|
|
80
|
+
"lastName": last_name,
|
|
62
81
|
}
|
|
82
|
+
if phone_number is not None:
|
|
83
|
+
payload["phoneNumber"] = phone_number
|
|
84
|
+
if email is not None:
|
|
85
|
+
payload["email"] = email
|
|
86
|
+
if funding_transaction_limit is not None:
|
|
87
|
+
payload["fundingTransactionLimit"] = funding_transaction_limit
|
|
63
88
|
response = await self._request(
|
|
64
89
|
"POST",
|
|
65
90
|
"/registerPersistentPaymentAccount",
|
|
@@ -75,6 +100,7 @@ class PersistentPaymentAccountMixin:
|
|
|
75
100
|
*,
|
|
76
101
|
reference_number: str,
|
|
77
102
|
account_identifier: str,
|
|
103
|
+
reason: Optional[str] = None,
|
|
78
104
|
) -> PagaResponse:
|
|
79
105
|
"""Delete a persistent payment account.
|
|
80
106
|
|
|
@@ -84,17 +110,21 @@ class PersistentPaymentAccountMixin:
|
|
|
84
110
|
reference_number: Your unique reference for this request.
|
|
85
111
|
account_identifier: The account's NUBAN **or** its
|
|
86
112
|
``accountReference``.
|
|
113
|
+
reason: Optional reason for the deletion.
|
|
87
114
|
|
|
88
115
|
Returns:
|
|
89
116
|
The parsed :class:`PagaResponse`.
|
|
90
117
|
"""
|
|
118
|
+
payload: Dict[str, Any] = {
|
|
119
|
+
"referenceNumber": reference_number,
|
|
120
|
+
"accountIdentifier": account_identifier,
|
|
121
|
+
}
|
|
122
|
+
if reason is not None:
|
|
123
|
+
payload["reason"] = reason
|
|
91
124
|
response = await self._request(
|
|
92
125
|
"POST",
|
|
93
126
|
"/deletePersistentPaymentAccount",
|
|
94
|
-
|
|
95
|
-
"referenceNumber": reference_number,
|
|
96
|
-
"accountIdentifier": account_identifier,
|
|
97
|
-
},
|
|
127
|
+
payload,
|
|
98
128
|
use_hash=True,
|
|
99
129
|
use_basic=True,
|
|
100
130
|
hash_fields=DELETE_PERSISTENT_ACCOUNT_HASH_FIELDS,
|
|
@@ -110,6 +140,10 @@ class PersistentPaymentAccountMixin:
|
|
|
110
140
|
credit_bank_id: Optional[str] = None,
|
|
111
141
|
credit_bank_account_number: Optional[str] = None,
|
|
112
142
|
callback_url: Optional[str] = None,
|
|
143
|
+
account_name: Optional[str] = None,
|
|
144
|
+
first_name: Optional[str] = None,
|
|
145
|
+
last_name: Optional[str] = None,
|
|
146
|
+
phone_number: Optional[str] = None,
|
|
113
147
|
) -> PersistentPaymentAccountResponse:
|
|
114
148
|
"""Update a persistent payment account.
|
|
115
149
|
|
|
@@ -126,6 +160,10 @@ class PersistentPaymentAccountMixin:
|
|
|
126
160
|
credit_bank_id: Optional new credit bank UUID.
|
|
127
161
|
credit_bank_account_number: Optional new credit account number.
|
|
128
162
|
callback_url: Optional new callback URL.
|
|
163
|
+
account_name: Optional new full customer name.
|
|
164
|
+
first_name: Optional new customer first name.
|
|
165
|
+
last_name: Optional new customer last name.
|
|
166
|
+
phone_number: Optional new customer phone number.
|
|
129
167
|
|
|
130
168
|
Returns:
|
|
131
169
|
The parsed :class:`PersistentPaymentAccountResponse`.
|
|
@@ -142,6 +180,14 @@ class PersistentPaymentAccountMixin:
|
|
|
142
180
|
payload["creditBankAccountNumber"] = credit_bank_account_number
|
|
143
181
|
if callback_url is not None:
|
|
144
182
|
payload["callbackUrl"] = callback_url
|
|
183
|
+
if account_name is not None:
|
|
184
|
+
payload["accountName"] = account_name
|
|
185
|
+
if first_name is not None:
|
|
186
|
+
payload["firstName"] = first_name
|
|
187
|
+
if last_name is not None:
|
|
188
|
+
payload["lastName"] = last_name
|
|
189
|
+
if phone_number is not None:
|
|
190
|
+
payload["phoneNumber"] = phone_number
|
|
145
191
|
|
|
146
192
|
response = await self._request(
|
|
147
193
|
"POST",
|
|
@@ -297,7 +297,10 @@ class SubsidiaryMixin:
|
|
|
297
297
|
use_basic=True,
|
|
298
298
|
base_url=self.base_url,
|
|
299
299
|
hash_fields=SUBSIDIARY_RETRIEVE_HASH_FIELDS,
|
|
300
|
-
params={
|
|
300
|
+
params={
|
|
301
|
+
"referenceNumber": reference_number,
|
|
302
|
+
"accountIdentifier": account_reference,
|
|
303
|
+
},
|
|
301
304
|
)
|
|
302
305
|
return SubsidiaryAccountResponse.model_validate(response.model_dump())
|
|
303
306
|
|
|
@@ -396,7 +399,10 @@ class SubsidiaryMixin:
|
|
|
396
399
|
use_basic=True,
|
|
397
400
|
base_url=self.base_url,
|
|
398
401
|
hash_fields=SUBSIDIARY_BALANCE_HASH_FIELDS,
|
|
399
|
-
params={
|
|
402
|
+
params={
|
|
403
|
+
"referenceNumber": reference_number,
|
|
404
|
+
"accountIdentifier": account_reference,
|
|
405
|
+
},
|
|
400
406
|
)
|
|
401
407
|
return SubsidiaryBalanceResponse.model_validate(response.model_dump())
|
|
402
408
|
|
|
@@ -443,6 +449,7 @@ class SubsidiaryMixin:
|
|
|
443
449
|
hash_fields=SUBSIDIARY_HISTORY_HASH_FIELDS,
|
|
444
450
|
params={
|
|
445
451
|
"referenceNumber": reference_number,
|
|
452
|
+
"accountIdentifier": account_reference,
|
|
446
453
|
"startDateTimeUTC": start_date_time_utc,
|
|
447
454
|
"endDateTimeUTC": end_date_time_utc,
|
|
448
455
|
"pageSize": page_size,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|