Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change recipinet.Price.Amount from int to float #126

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recipient.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Recipient struct {
}

type Price struct {
Amount int
Amount float64
Currency string
}

Expand Down
2 changes: 1 addition & 1 deletion sms/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func assertExtendedMessageObject(t *testing.T, message *Message) {

assert.Nil(t, message.Recipients.Items[0].StatusErrorCode)
assert.NotNil(t, message.Recipients.Items[0].Price)
assert.Equal(t, 22, message.Recipients.Items[0].Price.Amount)
assert.Equal(t, 0.075, message.Recipients.Items[0].Price.Amount)
assert.Equal(t, "UAH", message.Recipients.Items[0].Price.Currency)
}

Expand Down
4 changes: 2 additions & 2 deletions sms/testdata/messageListObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"statusErrorCode": null,
"statusReason": "successfully delivered",
"price": {
"amount": 22,
"amount": 0.075,
"currency": "UAH"
},
"mccmnc": "25506",
Expand Down Expand Up @@ -86,7 +86,7 @@
"statusErrorCode": null,
"statusReason": "successfully delivered",
"price": {
"amount": 22,
"amount": 5,
"currency": "UAH"
},
"mccmnc": "20408",
Expand Down
2 changes: 1 addition & 1 deletion sms/testdata/readMessageObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"statusErrorCode": null,
"statusReason": "successfully delivered",
"price": {
"amount": 22,
"amount": 0.075,
"currency": "UAH"
},
"mccmnc": "25506",
Expand Down