-
Notifications
You must be signed in to change notification settings - Fork 1
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
OMG-25427 - Set SHIPPO-ACCOUNT-ID header #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we add a separate "headers" argument to Client.do
instead of changing every struct definition?
Good idea! I made the changes in this PR and am in the process of updating the shipping-service PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
client/client.go
Outdated
// add any passed in headers | ||
if headers != nil { | ||
for k, v := range headers { | ||
c.logPrintf("Client.createRequest() setting header: key=%q, value=%q", k, v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to relocate the c.logPrintf
to the defer func
above, looks like logging is only done if the logger isn't nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but logPrintf
also checks if logger is nil.
…nt, UpdateCarrierAccount, or ConnectCarrierAccount
…ierAccount, UpdateCarrierAccount, or ConnectCarrierAccount" This reverts commit 65e1b60.
…he value is not empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think GetTrackingUpdate
needs an update.
client/tracking_status.go
Outdated
@@ -8,7 +8,7 @@ import ( | |||
) | |||
|
|||
// GetTrackingUpdate requests the tracking status of a shipment. | |||
func (c *Client) GetTrackingUpdate(carrier, trackingNumber string) (*models.TrackingStatus, error) { | |||
func (c *Client) GetTrackingUpdate(carrier, trackingNumber string, shippoSubAccountID string) (*models.TrackingStatus, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think we'll need subaccount here, there's a carrier but it's usps
not the carrier id: https://docs.goshippo.com/shippoapi/public-api/#operation/GetTrack
@ilyutov This is the strategy we went with. Please review when you have a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
OMG-25427
Update to support the
SHIPPO-ACCOUNT-ID
header required for Shippo's new sub-account system.Related PR: