Skip to content

Commit

Permalink
Merge pull request #235 from SlinkyLab/master
Browse files Browse the repository at this point in the history
add status enum
  • Loading branch information
takecy authored Aug 31, 2023
2 parents c517517 + d31c379 commit 110cbf1
Showing 1 changed file with 32 additions and 18 deletions.
50 changes: 32 additions & 18 deletions appstore/api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ type SubscriptionGroupIdentifierItem struct {
}

type LastTransactionsItem struct {
OriginalTransactionId string `json:"originalTransactionId"`
Status int32 `json:"status"`
SignedRenewalInfo string `json:"signedRenewalInfo"`
SignedTransactionInfo string `json:"signedTransactionInfo"`
OriginalTransactionId string `json:"originalTransactionId"`
Status AutoRenewSubscriptionStatus `json:"status"`
SignedRenewalInfo string `json:"signedRenewalInfo"`
SignedTransactionInfo string `json:"signedTransactionInfo"`
}

// MassExtendRenewalDateRequest https://developer.apple.com/documentation/appstoreserverapi/massextendrenewaldaterequest
Expand Down Expand Up @@ -84,20 +84,20 @@ type ConsumptionRequestBody struct {

// JWSRenewalInfoDecodedPayload https://developer.apple.com/documentation/appstoreserverapi/jwsrenewalinfodecodedpayload
type JWSRenewalInfoDecodedPayload struct {
AutoRenewProductId string `json:"autoRenewProductId"`
AutoRenewStatus int32 `json:"autoRenewStatus"`
Environment Environment `json:"environment"`
ExpirationIntent int32 `json:"expirationIntent"`
GracePeriodExpiresDate int64 `json:"gracePeriodExpiresDate"`
IsInBillingRetryPeriod *bool `json:"isInBillingRetryPeriod"`
OfferIdentifier string `json:"offerIdentifier"`
OfferType string `json:"offerType"`
OriginalTransactionId string `json:"originalTransactionId"`
PriceIncreaseStatus *int32 `json:"priceIncreaseStatus"`
ProductId string `json:"productId"`
RecentSubscriptionStartDate int64 `json:"recentSubscriptionStartDate"`
RenewalDate int64 `json:"renewalDate"`
SignedDate int64 `json:"signedDate"`
AutoRenewProductId string `json:"autoRenewProductId"`
AutoRenewStatus AutoRenewStatus `json:"autoRenewStatus"`
Environment Environment `json:"environment"`
ExpirationIntent int32 `json:"expirationIntent"`
GracePeriodExpiresDate int64 `json:"gracePeriodExpiresDate"`
IsInBillingRetryPeriod *bool `json:"isInBillingRetryPeriod"`
OfferIdentifier string `json:"offerIdentifier"`
OfferType string `json:"offerType"`
OriginalTransactionId string `json:"originalTransactionId"`
PriceIncreaseStatus *int32 `json:"priceIncreaseStatus"`
ProductId string `json:"productId"`
RecentSubscriptionStartDate int64 `json:"recentSubscriptionStartDate"`
RenewalDate int64 `json:"renewalDate"`
SignedDate int64 `json:"signedDate"`
}

func (J JWSRenewalInfoDecodedPayload) Valid() error {
Expand Down Expand Up @@ -241,3 +241,17 @@ const (
type SendTestNotificationResponse struct {
TestNotificationToken string `json:"testNotificationToken"`
}

type AutoRenewSubscriptionStatus int32
type AutoRenewStatus int32

const (
SubscriptionActive AutoRenewSubscriptionStatus = 1
SubscriptionExpired AutoRenewSubscriptionStatus = 2
SubscriptionRetryPeriod AutoRenewSubscriptionStatus = 3
SubscriptionGracePeriod AutoRenewSubscriptionStatus = 4
SubscriptionRevoked AutoRenewSubscriptionStatus = 5

AutoRenewStatusOff AutoRenewStatus = 0
AutoRenewStatusOn AutoRenewStatus = 1
)

0 comments on commit 110cbf1

Please sign in to comment.