forked from awa/go-iap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notification.go
33 lines (29 loc) · 1.34 KB
/
notification.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package playstore
// DeveloperNotification is sent by a Pub/Sub topic.
// Detailed description is following.
// https://developer.android.com/google/play/billing/realtime_developer_notifications.html#json_specification
type DeveloperNotification struct {
Version string `json:"version"`
PackageName string `json:"packageName"`
EventTimeMillis string `json:"eventTimeMillis"`
SubscriptionNotification SubscriptionNotification `json:"subscriptionNotification,omitempty"`
TestNotification SubscriptionNotification `json:"testNotification,omitempty"`
}
// SubscriptionNotification has subscription status as notificationType, toke and subscription id
// to confirm status by calling Google Android Publisher API.
type SubscriptionNotification struct {
Version string `json:"version"`
NotificationType NotificationType `json:"notificationType,omitempty"`
PurchaseToken string `json:"purchaseToken,omitempty"`
SubscriptionID string `json:"subscriptionId,omitempty"`
}
type NotificationType int
const (
NotificationTypeRecovered NotificationType = iota + 1
NotificationTypeRenewed
NotificationTypeCanceled
NotificationTypePurchased
NotificationTypeAccountHold
NotificationTypeGracePeriod
NotificationTypeReactivated
)