|
| 1 | +package amazon |
| 2 | + |
| 3 | +// NotificationType is type |
| 4 | +// https://developer.amazon.com/docs/in-app-purchasing/rtn-example.html |
| 5 | +type NotificationType string |
| 6 | + |
| 7 | +const ( |
| 8 | + NotificationTypeSubscription = "SUBSCRIPTION_PURCHASED" |
| 9 | + NotificationTypeConsumable = "CONSUMABLE_PURCHASED" |
| 10 | + NotificationTypeEntitlement = "ENTITLEMENT_PURCHASED" |
| 11 | +) |
| 12 | + |
| 13 | +// Notification is struct for amazon notification |
| 14 | +type Notification struct { |
| 15 | + Type string `json:"Type"` |
| 16 | + MessageId string `json:"MessageId"` |
| 17 | + TopicArn string `json:"TopicArn"` |
| 18 | + Message string `json:"Message"` |
| 19 | + Timestamp string `json:"Timestamp"` |
| 20 | + SignatureVersion string `json:"SignatureVersion"` |
| 21 | + Signature string `json:"Signature"` |
| 22 | + SigningCertURL string `json:"SigningCertURL"` |
| 23 | + UnsubscribeURL string `json:"UnsubscribeURL"` |
| 24 | +} |
| 25 | + |
| 26 | +// NotificationMessage is struct for Message field of Notification |
| 27 | +type NotificationMessage struct { |
| 28 | + AppPackageName string `json:"appPackageName"` |
| 29 | + NotificationType NotificationType `json:"notificationType"` |
| 30 | + AppUserId string `json:"appUserId"` |
| 31 | + ReceiptId string `json:"receiptId"` |
| 32 | + RelatedReceipts struct{} `json:"relatedReceipts"` |
| 33 | + Timestamp int64 `json:"timestamp"` |
| 34 | + BetaProductTransaction bool `json:"betaProductTransaction"` |
| 35 | +} |
0 commit comments