Skip to content

Commit

Permalink
Merge pull request #267 from richzw/master
Browse files Browse the repository at this point in the history
feat(appstore): add more fields to JWSTransactionDecodedPayload
  • Loading branch information
takecy authored Mar 14, 2024
2 parents 1579b86 + 71cb676 commit e6d4a84
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions appstore/notification_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ const (
TransactionReasonRenewal = "RENEWAL"
)

type OfferDiscountType string

const (
OfferDiscountTypeFreeTrial OfferDiscountType = "FREE_TRIAL"
OfferDiscountTypePayAsYouGo OfferDiscountType = "PAY_AS_YOU_GO"
OfferDiscountTypePayUpFront OfferDiscountType = "PAY_UP_FRONT"
)

type (
// SubscriptionNotificationV2 is struct for
// https://developer.apple.com/documentation/appstoreservernotifications/responsebodyv2
Expand Down Expand Up @@ -211,14 +219,17 @@ type (
JWSTransactionDecodedPayload struct {
AppAccountToken string `json:"appAccountToken"`
BundleId string `json:"bundleId"`
Currency string `json:"currency,omitempty"`
Environment Environment `json:"environment"`
ExpiresDate int64 `json:"expiresDate"`
InAppOwnershipType string `json:"inAppOwnershipType"`
IsUpgraded bool `json:"isUpgraded"`
OfferDiscountType OfferDiscountType `json:"offerDiscountType"`
OfferIdentifier string `json:"offerIdentifier"`
OfferType OfferType `json:"offerType"`
OriginalPurchaseDate int64 `json:"originalPurchaseDate"`
OriginalTransactionId string `json:"originalTransactionId"`
Price int32 `json:"price,omitempty"`
ProductId string `json:"productId"`
PurchaseDate int64 `json:"purchaseDate"`
Quantity int64 `json:"quantity"`
Expand Down

0 comments on commit e6d4a84

Please sign in to comment.