From 344a7ce6e553b10de60ebf479b11ee523b1eeffd Mon Sep 17 00:00:00 2001 From: Zhen Lu Date: Mon, 9 Sep 2024 18:35:39 -0700 Subject: [PATCH] Rename fields based on suggestions --- uma/protocol/invoice.go | 6 +++--- uma/test/protocol_test.go | 4 ++-- uma/uma.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/uma/protocol/invoice.go b/uma/protocol/invoice.go index 38ebecc..b484609 100644 --- a/uma/protocol/invoice.go +++ b/uma/protocol/invoice.go @@ -52,9 +52,9 @@ type UmaInvoice struct { // RequiredPayerData the data about the payer that the sending VASP must provide in order to send a payment. RequiredPayerData *CounterPartyDataOptions `tlv:"6"` - // UmaVersion is a list of UMA versions that the VASP supports for this transaction. It should be + // UmaVersions is a list of UMA versions that the VASP supports for this transaction. It should be // containing the lowest minor version of each major version it supported, separated by commas. - UmaVersion string `tlv:"7"` + UmaVersions string `tlv:"7"` // CommentCharsAllowed is the number of characters that the sender can include in the comment field of the pay request. CommentCharsAllowed *int `tlv:"8"` @@ -63,7 +63,7 @@ type UmaInvoice struct { SenderUma *string `tlv:"9"` // The maximum number of the invoice can be paid - InvoiceLimit *uint64 `tlv:"10"` + MaxNumPayments *uint64 `tlv:"10"` // KYC status of the receiver, default is verified. KycStatus *KycStatus `tlv:"11"` diff --git a/uma/test/protocol_test.go b/uma/test/protocol_test.go index 56bf9bb..b5503e5 100644 --- a/uma/test/protocol_test.go +++ b/uma/test/protocol_test.go @@ -290,10 +290,10 @@ func TestUMAInvoiceTLVAndBech32(t *testing.T) { "email": umaprotocol.CounterPartyDataOption{Mandatory: false}, "compliance": umaprotocol.CounterPartyDataOption{Mandatory: true}, }, - UmaVersion: "0.3", + UmaVersions: "0.3", CommentCharsAllowed: nil, SenderUma: nil, - InvoiceLimit: nil, + MaxNumPayments: nil, KycStatus: &kyc, Callback: "https://example.com/callback", Signature: &signature, diff --git a/uma/uma.go b/uma/uma.go index e4fbaa6..c9156a9 100644 --- a/uma/uma.go +++ b/uma/uma.go @@ -1142,10 +1142,10 @@ func CreateUmaInvoice( // TODO: modify the version once ready, all current version cannot support UMA invoice. // Since this only add fields and features to the protocol, this won't break the current // UMA version so it can be a minor version bump. - UmaVersion: UmaProtocolVersion, + UmaVersions: UmaProtocolVersion, CommentCharsAllowed: commentCharsAllowed, SenderUma: senderUma, - InvoiceLimit: invoiceLimit, + MaxNumPayments: invoiceLimit, KycStatus: receiverKycStatus, Callback: callback, Signature: nil,