Skip to content

Commit 5898e1e

Browse files
authored
Rename fields based on suggestions (#62)
1 parent fee522c commit 5898e1e

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

uma/__tests__/test_invoice.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def test_invoice_tlv() -> None:
2424
),
2525
comment_chars_allowed=None,
2626
sender_uma=None,
27-
invoice_limit=None,
28-
uma_version="0.3",
27+
max_num_payments=None,
28+
uma_versions="0.3",
2929
kyc_status=KycStatus.VERIFIED,
3030
callback="https://example.com/callback",
3131
signature=b"signature",
@@ -47,13 +47,13 @@ def test_invoice_tlv() -> None:
4747
assert new_i.expiration == i.expiration
4848
assert new_i.is_subject_to_travel_rule == i.is_subject_to_travel_rule
4949
assert new_i.required_payer_data == i.required_payer_data
50-
assert new_i.uma_version == i.uma_version
50+
assert new_i.uma_versions == i.uma_versions
5151
assert new_i.kyc_status == i.kyc_status
5252
assert new_i.callback == i.callback
5353
assert new_i.signature == i.signature
5454
assert new_i.comment_chars_allowed == i.comment_chars_allowed
5555
assert new_i.sender_uma == i.sender_uma
56-
assert new_i.invoice_limit == i.invoice_limit
56+
assert new_i.max_num_payments == i.max_num_payments
5757
assert new_i.kyc_status == i.kyc_status
5858
assert new_i.callback == i.callback
5959
assert new_i.signature == i.signature

uma/protocol/invoice.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class Invoice(TLVCodable):
9393
required_payer_data: Optional[InvoiceCounterpartyDataOptions]
9494

9595
# UmaVersion is a list of UMA versions that the VASP supports for this transaction. It should be
96-
# containing the lowest minor version of each major version it supported, separated by commas.
97-
uma_version: str
96+
# containing the highest minor version of each major version it supported, separated by commas.
97+
uma_versions: str
9898

9999
# CommentCharsAllowed is the number of characters that the sender can include in the comment field of the pay request.
100100
comment_chars_allowed: Optional[int]
@@ -103,7 +103,7 @@ class Invoice(TLVCodable):
103103
sender_uma: Optional[str]
104104

105105
# The maximum number of times the invoice can be paid
106-
invoice_limit: Optional[int]
106+
max_num_payments: Optional[int]
107107

108108
# KYC status of the receiver, default is verified.
109109
kyc_status: Optional[KycStatus]
@@ -123,10 +123,10 @@ def __init__(
123123
expiration: int = 0,
124124
is_subject_to_travel_rule: bool = False,
125125
required_payer_data: Optional[InvoiceCounterpartyDataOptions] = None,
126-
uma_version: str = "",
126+
uma_versions: str = "",
127127
comment_chars_allowed: Optional[int] = None,
128128
sender_uma: Optional[str] = None,
129-
invoice_limit: Optional[int] = None,
129+
max_num_payments: Optional[int] = None,
130130
kyc_status: Optional[KycStatus] = None,
131131
callback: str = "",
132132
signature: Optional[bytes] = None,
@@ -138,10 +138,10 @@ def __init__(
138138
self.expiration = expiration
139139
self.is_subject_to_travel_rule = is_subject_to_travel_rule
140140
self.required_payer_data = required_payer_data
141-
self.uma_version = uma_version
141+
self.uma_versions = uma_versions
142142
self.comment_chars_allowed = comment_chars_allowed
143143
self.sender_uma = sender_uma
144-
self.invoice_limit = invoice_limit
144+
self.max_num_payments = max_num_payments
145145
self.kyc_status = kyc_status
146146
self.callback = callback
147147
self.signature = signature
@@ -156,10 +156,10 @@ def tlv_map(cls) -> dict:
156156
"expiration": 4,
157157
"is_subject_to_travel_rule": 5,
158158
"required_payer_data": 6,
159-
"uma_version": 7,
159+
"uma_versions": 7,
160160
"comment_chars_allowed": 8,
161161
"sender_uma": 9,
162-
"invoice_limit": 10,
162+
"max_num_payments": 10,
163163
"kyc_status": 11,
164164
"callback": 12,
165165
"signature": 100,

uma/uma.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,10 +874,10 @@ def create_uma_invoice(
874874
expiration=int(expiration.timestamp()),
875875
is_subject_to_travel_rule=is_subject_to_travel_rule,
876876
required_payer_data=invoice_required_payer_data,
877-
uma_version=UMA_PROTOCOL_VERSION,
877+
uma_versions=UMA_PROTOCOL_VERSION,
878878
comment_chars_allowed=comment_chars_allowed,
879879
sender_uma=sender_uma,
880-
invoice_limit=invoice_limit,
880+
max_num_payments=invoice_limit,
881881
kyc_status=receiver_kyc_status,
882882
callback=callback,
883883
)

0 commit comments

Comments
 (0)