From dcca74c5cab75a8af71df62822223c0b6ae83650 Mon Sep 17 00:00:00 2001 From: Paul Rouge Date: Thu, 26 Sep 2024 15:30:16 +0200 Subject: [PATCH 1/2] add SubscriptionID to subscription struct --- subscriptions.go | 1 + 1 file changed, 1 insertion(+) diff --git a/subscriptions.go b/subscriptions.go index 3468ef7..b5176ae 100644 --- a/subscriptions.go +++ b/subscriptions.go @@ -6,6 +6,7 @@ import "time" // https://docs.lemonsqueezy.com/api/subscriptions#the-subscription-object type Subscription struct { StoreID int `json:"store_id"` + SubscriptionID int `json:"subscription_id"` CustomerID int `json:"customer_id"` OrderID int `json:"order_id"` OrderItemID int `json:"order_item_id"` From a02467f492d3f250995e840fea1fea51cf6a9062 Mon Sep 17 00:00:00 2001 From: Paul Rouge Date: Thu, 26 Sep 2024 15:30:45 +0200 Subject: [PATCH 2/2] Added SubscriptionID Struct tests --- internal/stubs/subscriptions.go | 2 ++ subscriptions_service_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/internal/stubs/subscriptions.go b/internal/stubs/subscriptions.go index 44d6996..928346f 100644 --- a/internal/stubs/subscriptions.go +++ b/internal/stubs/subscriptions.go @@ -15,6 +15,7 @@ func SubscriptionGetResponse() []byte { "id": "1", "attributes": { "store_id": 1, + "subscription_id": 1, "customer_id": 1, "order_id": 1, "order_item_id": 1, @@ -387,6 +388,7 @@ func SubscriptionCancelResponse() []byte { "id": "1", "attributes": { "store_id": 1, + "subscription_id": 1, "customer_id": 1, "order_id": 1, "order_item_id": 1, diff --git a/subscriptions_service_test.go b/subscriptions_service_test.go index 0b4997c..2b89d19 100644 --- a/subscriptions_service_test.go +++ b/subscriptions_service_test.go @@ -40,6 +40,7 @@ func TestSubscriptionsService_Get(t *testing.T) { ID: "1", Attributes: Subscription{ StoreID: 1, + SubscriptionID: 1, CustomerID: 1, OrderID: 1, OrderItemID: 1, @@ -186,6 +187,7 @@ func TestSubscriptionsService_Cancel(t *testing.T) { ID: "1", Attributes: Subscription{ StoreID: 1, + SubscriptionID: 1, CustomerID: 1, OrderID: 1, OrderItemID: 1,