Skip to content

Commit

Permalink
Fix issue #15 with tracking_status unmarshalling.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkelley79 committed May 18, 2021
1 parent 852544f commit ec2464a
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions models/transaction.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package models

import "time"

// See https://goshippo.com/docs/reference#transactions
type TransactionInput struct {
Rate string `json:"rate,omitempty"`
Expand All @@ -16,15 +18,16 @@ type TransactionInput struct {
type Transaction struct {
TransactionInput
CommonOutputFields
ObjectState string `json:"object_state,omitempty"`
Status string `json:"status,omitempty"`
Test bool `json:"test"`
TrackingNumber string `json:"tracking_number,omitempty"`
TrackingStatus *TrackingStatusDict `json:"tracking_status,omitempty"`
TrackingHistory []*TrackingStatusDict `json:"tracking_history,omitempty"`
TrackingURLProvider string `json:"tracking_url_provider,omitempty"`
LabelURL string `json:"label_url,omitempty"`
CommercialInvoiceURL string `json:"commercial_invoice_url,omitempty"`
Messages []*OutputMessage `json:"messages,omitempty"`
Async bool `json:"async"`
ObjectState string `json:"object_state,omitempty"`
Status string `json:"status,omitempty"`
Test bool `json:"test"`
TrackingNumber string `json:"tracking_number,omitempty"`
TrackingStatus string `json:"tracking_status,omitempty"`
TrackingURLProvider string `json:"tracking_url_provider,omitempty"`
Eta time.Time `json:"eta,omitempty"`
LabelURL string `json:"label_url,omitempty"`
CommercialInvoiceURL string `json:"commercial_invoice_url,omitempty"`
Messages []*OutputMessage `json:"messages,omitempty"`
QRCodeURL string `json:"qr_code_url,omitempty"`
Async bool `json:"async"`
}

0 comments on commit ec2464a

Please sign in to comment.