Skip to content

Commit

Permalink
Merge pull request #126 from messagebird/recipient-price-float
Browse files Browse the repository at this point in the history
Change recipinet.Price.Amount from int to float
  • Loading branch information
vallerion committed Oct 21, 2022
2 parents 7755c0e + 544becc commit e0a41ed
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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

0 comments on commit e0a41ed

Please sign in to comment.