From ec24a9b9d121ff9156f593c4840b1230f2cf4d04 Mon Sep 17 00:00:00 2001 From: Jary Date: Sat, 16 Mar 2024 18:15:54 +0800 Subject: [PATCH 1/5] feat(playstore): add pointer for SubscriptionNotification, OneTimeProductNotification, VoidedPurchaseNotification, TestNotification in DeveloperNotification --- playstore/notification.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/playstore/notification.go b/playstore/notification.go index cedf75d..00a55cf 100644 --- a/playstore/notification.go +++ b/playstore/notification.go @@ -39,13 +39,13 @@ const ( // Detailed description is following. // https://developer.android.com/google/play/billing/rtdn-reference#json_specification type DeveloperNotification struct { - Version string `json:"version"` - PackageName string `json:"packageName"` - EventTimeMillis string `json:"eventTimeMillis"` - SubscriptionNotification SubscriptionNotification `json:"subscriptionNotification,omitempty"` - OneTimeProductNotification OneTimeProductNotification `json:"oneTimeProductNotification,omitempty"` - VoidedPurchaseNotification VoidedPurchaseNotification `json:"voidedPurchaseNotification,omitempty"` - TestNotification TestNotification `json:"testNotification,omitempty"` + Version string `json:"version"` + PackageName string `json:"packageName"` + EventTimeMillis string `json:"eventTimeMillis"` + SubscriptionNotification *SubscriptionNotification `json:"subscriptionNotification,omitempty"` + OneTimeProductNotification *OneTimeProductNotification `json:"oneTimeProductNotification,omitempty"` + VoidedPurchaseNotification *VoidedPurchaseNotification `json:"voidedPurchaseNotification,omitempty"` + TestNotification *TestNotification `json:"testNotification,omitempty"` } // SubscriptionNotification has subscription status as notificationType, token and subscription id From b97c4168c0fce71ef4df072e1ae9fcaa62fcea22 Mon Sep 17 00:00:00 2001 From: Jary Date: Mon, 18 Mar 2024 20:07:48 +0800 Subject: [PATCH 2/5] add struct DeveloperNotificationNew --- playstore/notification.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/playstore/notification.go b/playstore/notification.go index 00a55cf..9daaa87 100644 --- a/playstore/notification.go +++ b/playstore/notification.go @@ -38,7 +38,21 @@ const ( // DeveloperNotification is sent by a Pub/Sub topic. // Detailed description is following. // https://developer.android.com/google/play/billing/rtdn-reference#json_specification +// Deprecated type DeveloperNotification struct { + Version string `json:"version"` + PackageName string `json:"packageName"` + EventTimeMillis string `json:"eventTimeMillis"` + SubscriptionNotification SubscriptionNotification `json:"subscriptionNotification,omitempty"` + OneTimeProductNotification OneTimeProductNotification `json:"oneTimeProductNotification,omitempty"` + VoidedPurchaseNotification VoidedPurchaseNotification `json:"voidedPurchaseNotification,omitempty"` + TestNotification TestNotification `json:"testNotification,omitempty"` +} + +// DeveloperNotification is sent by a Pub/Sub topic. +// Detailed description is following. +// https://developer.android.com/google/play/billing/rtdn-reference#json_specification +type DeveloperNotificationNew struct { Version string `json:"version"` PackageName string `json:"packageName"` EventTimeMillis string `json:"eventTimeMillis"` From c16a4311b7545d94df12681127530f6b14c7064e Mon Sep 17 00:00:00 2001 From: Jary Date: Mon, 18 Mar 2024 20:10:07 +0800 Subject: [PATCH 3/5] modify comments --- playstore/notification.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playstore/notification.go b/playstore/notification.go index 9daaa87..978919b 100644 --- a/playstore/notification.go +++ b/playstore/notification.go @@ -49,7 +49,7 @@ type DeveloperNotification struct { TestNotification TestNotification `json:"testNotification,omitempty"` } -// DeveloperNotification is sent by a Pub/Sub topic. +// DeveloperNotificationNew is sent by a Pub/Sub topic. // Detailed description is following. // https://developer.android.com/google/play/billing/rtdn-reference#json_specification type DeveloperNotificationNew struct { From 0db55ccdd1e9d95451db28b2c6efcd69c2d5b2bc Mon Sep 17 00:00:00 2001 From: Jary Date: Tue, 19 Mar 2024 13:04:19 +0800 Subject: [PATCH 4/5] modify the struct name DeveloperNotificationNew to DeveloperNotificationV2;modify comment --- playstore/notification.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/playstore/notification.go b/playstore/notification.go index 978919b..457fa49 100644 --- a/playstore/notification.go +++ b/playstore/notification.go @@ -38,6 +38,7 @@ const ( // DeveloperNotification is sent by a Pub/Sub topic. // Detailed description is following. // https://developer.android.com/google/play/billing/rtdn-reference#json_specification +// use DeveloperNotificationV2 instead // Deprecated type DeveloperNotification struct { Version string `json:"version"` @@ -49,10 +50,10 @@ type DeveloperNotification struct { TestNotification TestNotification `json:"testNotification,omitempty"` } -// DeveloperNotificationNew is sent by a Pub/Sub topic. +// DeveloperNotificationV2 is sent by a Pub/Sub topic. // Detailed description is following. // https://developer.android.com/google/play/billing/rtdn-reference#json_specification -type DeveloperNotificationNew struct { +type DeveloperNotificationV2 struct { Version string `json:"version"` PackageName string `json:"packageName"` EventTimeMillis string `json:"eventTimeMillis"` From 94dcc4ff33d22e1eb5f9a7a3c6256665245715cc Mon Sep 17 00:00:00 2001 From: Jary Date: Tue, 19 Mar 2024 14:09:47 +0800 Subject: [PATCH 5/5] modify comment --- playstore/notification.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/playstore/notification.go b/playstore/notification.go index 457fa49..e699137 100644 --- a/playstore/notification.go +++ b/playstore/notification.go @@ -38,8 +38,7 @@ const ( // DeveloperNotification is sent by a Pub/Sub topic. // Detailed description is following. // https://developer.android.com/google/play/billing/rtdn-reference#json_specification -// use DeveloperNotificationV2 instead -// Deprecated +// Depreacated: use DeveloperNotificationV2 instead. type DeveloperNotification struct { Version string `json:"version"` PackageName string `json:"packageName"`