Skip to content

Commit 8da1ed4

Browse files
committed
Change price to any
1 parent d218e9a commit 8da1ed4

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

order.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type OrderAttributes struct {
2121
TaxUsd int `json:"tax_usd"`
2222
TotalUsd int `json:"total_usd"`
2323
TaxName string `json:"tax_name"`
24-
TaxRate string `json:"tax_rate"`
24+
TaxRate any `json:"tax_rate"`
2525
Status string `json:"status"`
2626
StatusFormatted string `json:"status_formatted"`
2727
Refunded bool `json:"refunded"`
@@ -49,8 +49,8 @@ type OrderAttributes struct {
4949
UpdatedAt time.Time `json:"updated_at"`
5050
}
5151

52-
// ApiResponseRelationshipsOrder relationships of an order
53-
type ApiResponseRelationshipsOrder struct {
52+
// APIResponseRelationshipsOrder relationships of an order
53+
type APIResponseRelationshipsOrder struct {
5454
Store ApiResponseLinks `json:"store"`
5555
Customer ApiResponseLinks `json:"customer"`
5656
OrderItems ApiResponseLinks `json:"order-items"`
@@ -59,8 +59,8 @@ type ApiResponseRelationshipsOrder struct {
5959
DiscountRedemptions ApiResponseLinks `json:"discount-redemptions"`
6060
}
6161

62-
// OrderApiResponse is the api response for one order
63-
type OrderApiResponse = ApiResponse[OrderAttributes, ApiResponseRelationshipsOrder]
62+
// OrderAPIResponse is the api response for one order
63+
type OrderAPIResponse = ApiResponse[OrderAttributes, APIResponseRelationshipsOrder]
6464

65-
// OrdersApiResponse is the api response for a list of orders.
66-
type OrdersApiResponse = ApiResponseList[OrderAttributes, ApiResponseRelationshipsOrder]
65+
// OrdersAPIResponse is the api response for a list of orders.
66+
type OrdersAPIResponse = ApiResponseList[OrderAttributes, APIResponseRelationshipsOrder]

orders_service.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ type OrdersService service
1212
// Get returns the order with the given ID.
1313
//
1414
// https://docs.lemonsqueezy.com/api/orders#retrieve-an-order
15-
func (service *OrdersService) Get(ctx context.Context, orderID string) (*OrderApiResponse, *Response, error) {
15+
func (service *OrdersService) Get(ctx context.Context, orderID string) (*OrderAPIResponse, *Response, error) {
1616
response, err := service.client.do(ctx, http.MethodGet, "/v1/orders/"+orderID)
1717
if err != nil {
1818
return nil, response, err
1919
}
2020

21-
order := new(OrderApiResponse)
21+
order := new(OrderAPIResponse)
2222
if err = json.Unmarshal(*response.Body, order); err != nil {
2323
return nil, response, err
2424
}
@@ -29,13 +29,13 @@ func (service *OrdersService) Get(ctx context.Context, orderID string) (*OrderAp
2929
// List returns a paginated list of orders.
3030
//
3131
// https://docs.lemonsqueezy.com/api/orders#list-all-orders
32-
func (service *OrdersService) List(ctx context.Context) (*OrdersApiResponse, *Response, error) {
32+
func (service *OrdersService) List(ctx context.Context) (*OrdersAPIResponse, *Response, error) {
3333
response, err := service.client.do(ctx, http.MethodGet, "/v1/orders")
3434
if err != nil {
3535
return nil, response, err
3636
}
3737

38-
orders := new(OrdersApiResponse)
38+
orders := new(OrdersAPIResponse)
3939
if err = json.Unmarshal(*response.Body, orders); err != nil {
4040
return nil, response, err
4141
}

variant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type VariantAttributes struct {
88
Name string `json:"name"`
99
Slug string `json:"slug"`
1010
Description string `json:"description"`
11-
Price int `json:"price"`
11+
Price any `json:"price"`
1212
IsSubscription bool `json:"is_subscription"`
1313
Interval *string `json:"interval"`
1414
IntervalCount *int `json:"interval_count"`

webhook_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package lemonsqueezy
22

33
// WebhookRequestOrder is the payload for order related events e.g. order_created, order_refunded
4-
type WebhookRequestOrder WebhookRequest[OrderAttributes, ApiResponseRelationshipsOrder]
4+
type WebhookRequestOrder WebhookRequest[OrderAttributes, APIResponseRelationshipsOrder]
55

66
// WebhookRequestSubscription is the payload for subscription related events e.g. subscription_created, subscription_updated
77
type WebhookRequestSubscription WebhookRequest[Subscription, ApiResponseRelationshipsSubscription]

0 commit comments

Comments
 (0)