forked from awa/go-iap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification.go
35 lines (31 loc) · 1.33 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
34
35
package amazon
// NotificationType is type
// https://developer.amazon.com/docs/in-app-purchasing/rtn-example.html
type NotificationType string
const (
NotificationTypeSubscription = "SUBSCRIPTION_PURCHASED"
NotificationTypeConsumable = "CONSUMABLE_PURCHASED"
NotificationTypeEntitlement = "ENTITLEMENT_PURCHASED"
)
// Notification is struct for amazon notification
type Notification struct {
Type string `json:"Type"`
MessageId string `json:"MessageId"`
TopicArn string `json:"TopicArn"`
Message string `json:"Message"`
Timestamp string `json:"Timestamp"`
SignatureVersion string `json:"SignatureVersion"`
Signature string `json:"Signature"`
SigningCertURL string `json:"SigningCertURL"`
UnsubscribeURL string `json:"UnsubscribeURL"`
}
// NotificationMessage is struct for Message field of Notification
type NotificationMessage struct {
AppPackageName string `json:"appPackageName"`
NotificationType NotificationType `json:"notificationType"`
AppUserId string `json:"appUserId"`
ReceiptId string `json:"receiptId"`
RelatedReceipts struct{} `json:"relatedReceipts"`
Timestamp int64 `json:"timestamp"`
BetaProductTransaction bool `json:"betaProductTransaction"`
}