Versions in this module Expand all Collapse all v1 v1.33.2 May 30, 2024 v1.33.1 May 29, 2024 Changes in this version + const AutoRenewableSubscriptionStatusActive + const AutoRenewableSubscriptionStatusBillingGracePeriod + const AutoRenewableSubscriptionStatusBillingRetryPeriod + const AutoRenewableSubscriptionStatusExpired + const AutoRenewableSubscriptionStatusRevoked + const ContentType + const ProductionURL + const SandboxURL + const SubTypeV2Accepted + const SubTypeV2AutoRenewDisabled + const SubTypeV2AutoRenewEnabled + const SubTypeV2BillingRecovery + const SubTypeV2BillingRetry + const SubTypeV2Downgrade + const SubTypeV2Failure + const SubTypeV2GracePeriod + const SubTypeV2InitialBuy + const SubTypeV2Pending + const SubTypeV2PriceIncrease + const SubTypeV2ProductNotForSale + const SubTypeV2Resubscribe + const SubTypeV2Summary + const SubTypeV2Unreported + const SubTypeV2Upgrade + const SubTypeV2Voluntary + const TransactionReasonPurchase + const TransactionReasonRenewal + var ErrAppStoreServer = errors.New("AppStore server error") + var ErrInternalDataAccessError = errors.New("Internal data access error.") + var ErrInvalidJSON = errors.New("The App Store could not read the JSON object you provided.") + var ErrInvalidReceiptData = errors.New("The data in the receipt-data property was malformed or missing.") + var ErrInvalidSharedSecret = errors.New(...) + var ErrReceiptIsForProduction = errors.New(...) + var ErrReceiptIsForTest = errors.New(...) + var ErrReceiptUnauthenticated = errors.New("The receipt could not be authenticated.") + var ErrReceiptUnauthorized = errors.New(...) + var ErrServerUnavailable = errors.New("The receipt server is not currently available.") + var ErrUnknown = errors.New("An unknown error occurred") + func HandleError(status int) error + type AutoRenewStatus int + const Off + const On + type AutoRenewStatusChangeDate struct + AutoRenewStatusChangeDate string + AutoRenewStatusChangeDateMS string + AutoRenewStatusChangeDatePST string + type AutoRenewableSubscriptionStatus int32 + type CancellationDate struct + CancellationDate string + CancellationDateMS string + CancellationDatePST string + type Cert struct + func (c *Cert) ExtractPublicKeyFromToken(token string) (*ecdsa.PublicKey, error) + type Client struct + ProductionURL string + SandboxURL string + func New() *Client + func NewWithClient(client *http.Client) *Client + func (c *Client) ParseNotificationV2(tokenStr string, result *jwt.Token) error + func (c *Client) ParseNotificationV2WithClaim(tokenStr string, result jwt.Claims) error + func (c *Client) Verify(ctx context.Context, reqBody IAPRequest, result interface{}) error + func (c *Client) VerifyWithStatus(ctx context.Context, reqBody IAPRequest, result interface{}) (int, error) + type Environment string + const Production + const Sandbox + type ExpirationIntent int + const BillingError + const CustomerCancelled + const NoPriceChangeConsent + const ProductUnavailable + type ExpiresDate struct + ExpiresDate string + ExpiresDateFormatted string + ExpiresDateFormattedPST string + ExpiresDateMS string + ExpiresDatePST string + type GracePeriodDate struct + GracePeriodDate string + GracePeriodDateMS string + GracePeriodDatePST string + type IAPClient interface + ParseNotificationV2 func(tokenStr string, result *jwt.Token) error + ParseNotificationV2WithClaim func(tokenStr string, result jwt.Claims) error + Verify func(ctx context.Context, reqBody IAPRequest, resp interface{}) error + VerifyWithStatus func(ctx context.Context, reqBody IAPRequest, resp interface{}) (int, error) + type IAPRequest struct + ExcludeOldTransactions bool + Password string + ReceiptData string + type IAPResponse struct + Environment Environment + IsRetryable bool + LatestReceipt string + LatestReceiptInfo []InApp + PendingRenewalInfo []PendingRenewalInfo + Receipt Receipt + Status int + type IAPResponseForIOS6 struct + AutoRenewProductID string + AutoRenewStatus int + CancellationReason string + ExpirationIntent string + IsInBillingRetryPeriod string + LatestExpiredReceiptInfo ReceiptForIOS6 + LatestReceipt string + LatestReceiptInfo ReceiptForIOS6 + Receipt ReceiptForIOS6 + Status int + type IAPType string + const AutoRenewable + const Consumable + const NonConsumable + const NonRenewable + type InApp struct + AppAccountToken string + CancellationReason string + InAppOwnershipType string + IsInIntroOfferPeriod string + IsTrialPeriod string + IsUpgraded string + OfferCodeRefName string + OriginalTransactionID NumericString + ProductID string + PromotionalOfferID string + Quantity string + SubscriptionGroupIdentifier string + TransactionID string + WebOrderLineItemID string + type JWSRenewalInfo string + type JWSRenewalInfoDecodedPayload struct + AutoRenewProductId string + AutoRenewStatus AutoRenewStatus + Environment Environment + ExpirationIntent ExpirationIntent + GracePeriodExpiresDate int64 + IsInBillingRetryPeriod bool + OfferIdentifier string + OfferType OfferType + OriginalTransactionId string + PriceIncreaseStatus PriceIncreaseStatus + ProductId string + RecentSubscriptionStartDate int64 + RenewalDate int64 + SignedDate int64 + type JWSTransaction string + type JWSTransactionDecodedPayload struct + AppAccountToken string + BundleId string + Currency string + Environment Environment + ExpiresDate int64 + IAPtype IAPType + InAppOwnershipType string + IsUpgraded bool + OfferDiscountType OfferDiscountType + OfferIdentifier string + OfferType OfferType + OriginalPurchaseDate int64 + OriginalTransactionId string + Price int64 + ProductId string + PurchaseDate int64 + Quantity int64 + RevocationDate int64 + RevocationReason RevocationReason + SignedDate int64 + Storefront string + StorefrontId string + SubscriptionGroupIdentifier string + TransactionId string + TransactionReason TransactionReason + WebOrderLineItemId string + type NotificationEnvironment string + const NotificationProduction + const NotificationSandbox + type NotificationExpiresDate struct + ExpiresDateMS string + ExpiresDatePST string + ExpiresDateUTC string + type NotificationReceipt struct + AppItemID string + BID string + BVRS string + IsInIntroOfferPeriod string + IsTrialPeriod string + ItemID string + OriginalTransactionID NumericString + ProductID string + Quantity string + TransactionID string + UniqueIdentifier string + UniqueVendorIdentifier string + VersionExternalIdentifier string + WebOrderLineItemID string + type NotificationType string + const NotificationTypeCancel + const NotificationTypeConsumptionRequest + const NotificationTypeDidChangeRenewalPreference + const NotificationTypeDidChangeRenewalStatus + const NotificationTypeDidFailToRenew + const NotificationTypeDidRecover + const NotificationTypeDidRenew + const NotificationTypeDidRevoke + const NotificationTypeInitialBuy + const NotificationTypeInteractiveRenewal + const NotificationTypePriceIncreaseConsent + const NotificationTypeRefund + const NotificationTypeRenewal + type NotificationTypeV2 string + const NotificationTypeV2ConsumptionRequest + const NotificationTypeV2DidChangeRenewalPref + const NotificationTypeV2DidChangeRenewalStatus + const NotificationTypeV2DidFailToRenew + const NotificationTypeV2DidRenew + const NotificationTypeV2Expired + const NotificationTypeV2ExternalPurchaseToken + const NotificationTypeV2GracePeriodExpired + const NotificationTypeV2OfferRedeemed + const NotificationTypeV2PriceIncrease + const NotificationTypeV2Refund + const NotificationTypeV2RefundDeclined + const NotificationTypeV2RefundReversed + const NotificationTypeV2RenewalExtended + const NotificationTypeV2RenewalExtension + const NotificationTypeV2Revoke + const NotificationTypeV2Subscribed + const NotificationTypeV2Test + type NotificationUnifiedReceipt struct + Environment Environment + LatestReceipt string + LatestReceiptInfo []InApp + PendingRenewalInfo []PendingRenewalInfo + Status int + type NumericString string + func (n *NumericString) UnmarshalJSON(b []byte) error + type OfferDiscountType string + const OfferDiscountTypeFreeTrial + const OfferDiscountTypePayAsYouGo + const OfferDiscountTypePayUpFront + type OfferType int + const IntroductoryOffer + const PromotionalOffer + const SubscriptionOfferCode + type OriginalPurchaseDate struct + OriginalPurchaseDate string + OriginalPurchaseDateMS string + OriginalPurchaseDatePST string + type PendingRenewalInfo struct + OfferCodeRefName string + OriginalTransactionID string + PriceIncreaseStatus string + ProductID string + PromotionalOfferID string + SubscriptionAutoRenewProductID string + SubscriptionAutoRenewStatus string + SubscriptionExpirationIntent string + SubscriptionPriceConsentStatus string + SubscriptionRetryFlag string + type PreorderDate struct + PreorderDate string + PreorderDateMS string + PreorderDatePST string + type PriceIncreaseStatus int + const CustomerConsented + const CustomerNotYetConsented + type PurchaseDate struct + PurchaseDate string + PurchaseDateMS string + PurchaseDatePST string + type Receipt struct + AdamID int64 + AppItemID NumericString + ApplicationVersion string + BundleID string + DownloadID int64 + InApp []InApp + OriginalApplicationVersion string + ReceiptType string + VersionExternalIdentifier NumericString + type ReceiptCreationDate struct + CreationDate string + CreationDateMS string + CreationDatePST string + type ReceiptForIOS6 struct + AppItemID NumericString + BID string + BVRS string + IsInIntroOfferPeriod string + IsTrialPeriod string + ItemID string + OriginalTransactionID NumericString + ProductID string + Quantity string + TransactionID string + UniqueIdentifier string + UniqueVendorIdentifier string + VersionExternalIdentifier NumericString + WebOrderLineItemID string + type RequestDate struct + RequestDate string + RequestDateMS string + RequestDatePST string + type RevocationReason int + const AppIssue + const OtherReason + type StatusResponse struct + Status int + type SubscriptionNotification struct + AutoRenewAdamID string + AutoRenewProductID string + AutoRenewStatus string + BID string + BVRS string + Environment NotificationEnvironment + ExpirationIntent NumericString + LatestExpiredReceipt string + LatestExpiredReceiptInfo NotificationReceipt + LatestReceipt string + LatestReceiptInfo NotificationReceipt + NotificationType NotificationType + OriginalTransactionID NumericString + Password string + UnifiedReceipt NotificationUnifiedReceipt + WebOrderLineItemID string + type SubscriptionNotificationV2 struct + SignedPayload SubscriptionNotificationV2SignedPayload + type SubscriptionNotificationV2Data struct + AppAppleID int + BundleID string + BundleVersion string + Environment string + SignedRenewalInfo JWSRenewalInfo + SignedTransactionInfo JWSTransaction + Status AutoRenewableSubscriptionStatus + type SubscriptionNotificationV2DecodedPayload struct + Data SubscriptionNotificationV2Data + NotificationType NotificationTypeV2 + NotificationUUID string + NotificationVersion string + SignedDate int64 + Subtype SubtypeV2 + Summary SubscriptionNotificationV2Summary + type SubscriptionNotificationV2JWSDecodedHeader struct + Alg string + Kid string + X5c []string + type SubscriptionNotificationV2SignedPayload struct + SignedPayload string + type SubscriptionNotificationV2Summary struct + AppAppleId int64 + BundleID string + Environment string + FailedCount int64 + ProductID string + RequestIdentifier string + StorefrontCountryCodes string + SucceededCount int64 + type SubtypeV2 string + type TransactionReason string