From f0018d491643f25c0d3eac25dd6bc3718b129bac Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 3 Nov 2023 18:15:08 -0700 Subject: [PATCH] Updating new fields added in App Store Server API v1.10\n\nhttps://developer.apple.com/documentation/appstoreserverapi?changes=latest_minor --- models/JWSTransactionDecodedPayload.ts | 32 ++++++++++++++++++++++++++ models/OfferDiscountType.ts | 20 ++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 models/OfferDiscountType.ts diff --git a/models/JWSTransactionDecodedPayload.ts b/models/JWSTransactionDecodedPayload.ts index 2a644db..cdca270 100644 --- a/models/JWSTransactionDecodedPayload.ts +++ b/models/JWSTransactionDecodedPayload.ts @@ -3,6 +3,7 @@ import { DecodedSignedData } from "./DecodedSignedData" import { Environment, EnvironmentValidator } from "./Environment" import { InAppOwnershipType, InAppOwnershipTypeValidator } from "./InAppOwnershipType" +import { OfferDiscountType, OfferDiscountTypeValidator } from "./OfferDiscountType" import { OfferType, OfferTypeValidator } from "./OfferType" import { RevocationReason, RevocationReasonValidator } from "./RevocationReason" import { TransactionReason, TransactionReasonValidator } from "./TransactionReason" @@ -176,6 +177,27 @@ export interface JWSTransactionDecodedPayload extends DecodedSignedData { * {@link https://developer.apple.com/documentation/appstoreserverapi/transactionreason transactionReason} **/ transactionReason?: TransactionReason + + /** + * The three-letter ISO 4217 currency code for the price of the product. + * + * {@link https://developer.apple.com/documentation/appstoreserverapi/currency currency} + **/ + currency?: string + + /** + * The price of the in-app purchase or subscription offer that you configured in App Store Connect, as an integer. + * + * {@link https://developer.apple.com/documentation/appstoreserverapi/price price} + **/ + price?: number + + /** + * The payment mode you configure for an introductory offer, promotional offer, or offer code on an auto-renewable subscription. + * + * {@link https://developer.apple.com/documentation/appstoreserverapi/offerdiscounttype offerDiscountType} + **/ + offerDiscountType?: OfferDiscountType } @@ -186,6 +208,7 @@ export class JWSTransactionDecodedPayloadValidator implements Validator { + validate(obj: any): obj is OfferDiscountType { + return Object.values(OfferDiscountType).includes(obj) + } +}