@@ -13,6 +13,13 @@ func (n *numericString) UnmarshalJSON(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Environment string
|
||||||
|
|
||||||
|
const (
|
||||||
|
Sandbox Environment = "Sandbox"
|
||||||
|
Production Environment = "PROD"
|
||||||
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
// https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html
|
// https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html
|
||||||
// The IAPRequest type has the request parameter
|
// The IAPRequest type has the request parameter
|
||||||
@@ -118,7 +125,7 @@ type (
|
|||||||
// If you get other types or fields from the IAP response, you should use the struct you defined.
|
// If you get other types or fields from the IAP response, you should use the struct you defined.
|
||||||
IAPResponse struct {
|
IAPResponse struct {
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
Environment string `json:"environment"`
|
Environment Environment `json:"environment"`
|
||||||
Receipt Receipt `json:"receipt"`
|
Receipt Receipt `json:"receipt"`
|
||||||
LatestReceiptInfo []InApp `json:"latest_receipt_info"`
|
LatestReceiptInfo []InApp `json:"latest_receipt_info"`
|
||||||
LatestReceipt string `json:"latest_receipt"`
|
LatestReceipt string `json:"latest_receipt"`
|
||||||
|
|||||||
@@ -16,13 +16,6 @@ const (
|
|||||||
NotificationTypeDidChangeRenewalPreference NotificationType = "DID_CHANGE_RENEWAL_PREFERENCE"
|
NotificationTypeDidChangeRenewalPreference NotificationType = "DID_CHANGE_RENEWAL_PREFERENCE"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NotificationEnv string
|
|
||||||
|
|
||||||
const (
|
|
||||||
NotificationEnvSandbox NotificationEnv = "SANDBOX"
|
|
||||||
NotificationEnvProduction NotificationEnv = "PROD"
|
|
||||||
)
|
|
||||||
|
|
||||||
type NotificationExpiresDate struct {
|
type NotificationExpiresDate struct {
|
||||||
ExpiresDateMS string `json:"expires_date"`
|
ExpiresDateMS string `json:"expires_date"`
|
||||||
ExpiresDateUTC string `json:"expires_date_formatted"`
|
ExpiresDateUTC string `json:"expires_date_formatted"`
|
||||||
@@ -51,7 +44,7 @@ type NotificationReceipt struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SubscriptionNotification struct {
|
type SubscriptionNotification struct {
|
||||||
Environment NotificationEnv `json:"environment"`
|
Environment Environment `json:"environment"`
|
||||||
NotificationType NotificationType `json:"notification_type"`
|
NotificationType NotificationType `json:"notification_type"`
|
||||||
|
|
||||||
// Not show in raw notify body
|
// Not show in raw notify body
|
||||||
|
|||||||
Reference in New Issue
Block a user