Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(appstore): add more fields to JWSTransactionDecodedPayload #267

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading