@@ -14,11 +14,10 @@ func (c Client) CreateInvoice(ctx context.Context, accountID string, invoice Cre
1414 JsonBody (invoice ),
1515 )
1616 if err != nil {
17- return nil , err
17+ return nil , fmt . Errorf ( "calling http: %w" , err )
1818 }
1919
20- out , err := UnmarshalObjectResponse [Invoice ](resp )
21- return out , err
20+ return StartedObjectOrError [Invoice ](resp )
2221}
2322
2423// GetInvoice retrieves an invoice by ID
@@ -28,7 +27,7 @@ func (c Client) GetInvoice(ctx context.Context, accountID, invoiceID string) (*I
2827 AcceptJson (),
2928 )
3029 if err != nil {
31- return nil , err
30+ return nil , fmt . Errorf ( "calling http: %w" , err )
3231 }
3332
3433 return CompletedObjectOrError [Invoice ](resp )
@@ -42,7 +41,7 @@ func (c Client) UpdateInvoice(ctx context.Context, accountID, invoiceID string,
4241 JsonBody (invoice ),
4342 )
4443 if err != nil {
45- return nil , err
44+ return nil , fmt . Errorf ( "calling http: %w" , err )
4645 }
4746
4847 return CompletedObjectOrError [Invoice ](resp )
@@ -56,7 +55,7 @@ func (c Client) MarkInvoicePaid(ctx context.Context, accountID, invoiceID string
5655 JsonBody (payment ),
5756 )
5857 if err != nil {
59- return nil , err
58+ return nil , fmt . Errorf ( "calling http: %w" , err )
6059 }
6160
6261 return CompletedObjectOrError [Invoice ](resp )
@@ -70,7 +69,7 @@ func (c Client) MarkInvoicePaid(ctx context.Context, accountID, invoiceID string
7069// AcceptJson(),
7170// )
7271// if err != nil {
73- // return nil, err
72+ // return nil, fmt.Errorf("calling http: %w), err
7473// }
7574
7675// return CompletedObjectOrError[Invoice](resp)
@@ -117,7 +116,7 @@ func (c Client) ListInvoices(ctx context.Context, accountID string, filters ...L
117116 args := prependArgs (filters , AcceptJson ())
118117 resp , err := c .CallHttp (ctx , Endpoint (http .MethodGet , pathInvoices , accountID ), args ... )
119118 if err != nil {
120- return nil , err
119+ return nil , fmt . Errorf ( "calling http: %w" , err )
121120 }
122121
123122 return CompletedListOrError [Invoice ](resp )
0 commit comments