@@ -16,124 +16,107 @@ use crate::primitives::advanced_commerce_transaction_info::AdvancedCommerceTrans
1616/// [JWSTransactionDecodedPayload](https://developer.apple.com/documentation/appstoreserverapi/jwstransactiondecodedpayload)
1717#[ serde_with:: serde_as]
1818#[ derive( Debug , Clone , serde:: Deserialize , serde:: Serialize , Hash ) ]
19+ #[ serde( rename_all = "camelCase" ) ]
1920pub struct JWSTransactionDecodedPayload {
2021 /// The original transaction identifier of a purchase.
2122 ///
2223 /// [originalTransactionId](https://developer.apple.com/documentation/appstoreserverapi/originaltransactionid)
23- #[ serde( rename = "originalTransactionId" ) ]
2424 pub original_transaction_id : Option < String > ,
2525
2626 /// The unique identifier for a transaction such as an in-app purchase, restored in-app purchase, or subscription renewal.
2727 ///
2828 /// [transactionId](https://developer.apple.com/documentation/appstoreserverapi/transactionid)
29- #[ serde( rename = "transactionId" ) ]
3029 pub transaction_id : Option < String > ,
3130
3231 /// The unique identifier of subscription-purchase events across devices, including renewals.
3332 ///
3433 /// [webOrderLineItemId](https://developer.apple.com/documentation/appstoreserverapi/weborderlineitemid)
35- #[ serde( rename = "webOrderLineItemId" ) ]
3634 pub web_order_line_item_id : Option < String > ,
3735
3836 /// The bundle identifier of an app.
3937 ///
4038 /// [bundle_id](https://developer.apple.com/documentation/appstoreserverapi/bundleid)
41- #[ serde( rename = "bundleId" ) ]
4239 pub bundle_id : Option < String > ,
4340
4441 /// The unique identifier for the product, that you create in App Store Connect.
4542 ///
4643 /// [productId](https://developer.apple.com/documentation/appstoreserverapi/productid)
47- #[ serde( rename = "productId" ) ]
4844 pub product_id : Option < String > ,
4945
5046 /// The identifier of the subscription group that the subscription belongs to.
5147 ///
5248 /// [subscriptionGroupIdentifier](https://developer.apple.com/documentation/appstoreserverapi/subscriptiongroupidentifier)
53- #[ serde( rename = "subscriptionGroupIdentifier" ) ]
5449 pub subscription_group_identifier : Option < String > ,
5550
5651 /// The time that the App Store charged the user’s account for an in-app purchase, a restored in-app purchase, a subscription, or a subscription renewal after a lapse.
5752 ///
5853 /// [purchaseDate](https://developer.apple.com/documentation/appstoreserverapi/purchasedate)
59- #[ serde( rename = "purchaseDate" ) ]
6054 #[ serde_as( as = "Option<TimestampMilliSeconds<String, Flexible>>" ) ]
6155 pub purchase_date : Option < DateTime < Utc > > ,
6256
6357 /// The purchase date of the transaction associated with the original transaction identifier.
6458 ///
6559 /// [originalPurchaseDate](https://developer.apple.com/documentation/appstoreserverapi/originalpurchasedate)
66- #[ serde( rename = "originalPurchaseDate" ) ]
6760 #[ serde_as( as = "Option<TimestampMilliSeconds<String, Flexible>>" ) ]
6861 pub original_purchase_date : Option < DateTime < Utc > > ,
6962
7063 /// The UNIX time, in milliseconds, an auto-renewable subscription expires or renews.
7164 ///
7265 /// [expiresDate](https://developer.apple.com/documentation/appstoreserverapi/expiresdate)
73- #[ serde( rename = "expiresDate" ) ]
7466 #[ serde_as( as = "Option<TimestampMilliSeconds<String, Flexible>>" ) ]
7567 pub expires_date : Option < DateTime < Utc > > ,
7668
7769 /// The number of consumable products purchased.
7870 ///
7971 /// [quantity](https://developer.apple.com/documentation/appstoreserverapi/quantity)
80- #[ serde( rename = "quantity" ) ]
8172 pub quantity : Option < i32 > ,
8273
8374 /// The type of the in-app purchase.
8475 ///
8576 /// [type](https://developer.apple.com/documentation/appstoreserverapi/type)
86- #[ serde( rename = "type" ) ]
8777 pub r#type : Option < ProductType > ,
8878
8979 /// The UUID that an app optionally generates to map a customer’s in-app purchase with its resulting App Store transaction.
9080 ///
9181 /// [appAccountToken](https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken)
92- #[ serde( rename = "appAccountToken " ) ]
82+ #[ serde( skip_serializing_if = "Option::is_none " ) ]
9383 pub app_account_token : Option < Uuid > ,
9484
9585 /// A string that describes whether the transaction was purchased by the user, or is available to them through Family Sharing.
9686 ///
9787 /// [inAppOwnershipType](https://developer.apple.com/documentation/appstoreserverapi/inappownershiptype)
98- #[ serde( rename = "inAppOwnershipType" ) ]
9988 pub in_app_ownership_type : Option < InAppOwnershipType > ,
10089
10190 /// The UNIX time, in milliseconds, that the App Store signed the JSON Web Signature data.
10291 ///
10392 /// [signedDate](https://developer.apple.com/documentation/appstoreserverapi/signeddate)
104- #[ serde( rename = "signedDate" ) ]
10593 #[ serde_as( as = "Option<TimestampMilliSeconds<String, Flexible>>" ) ]
10694 pub signed_date : Option < DateTime < Utc > > ,
10795
10896 /// The reason that the App Store refunded the transaction or revoked it from Family Sharing.
10997 ///
11098 /// [revocationReason](https://developer.apple.com/documentation/appstoreserverapi/revocationreason)
111- #[ serde( rename = "revocationReason" ) ]
11299 pub revocation_reason : Option < RevocationReason > ,
113100
114101 /// The UNIX time, in milliseconds, that Apple Support refunded a transaction.
115102 ///
116103 /// [revocationDate](https://developer.apple.com/documentation/appstoreserverapi/revocationdate)
117- #[ serde( rename = "revocationDate" ) ]
118104 #[ serde_as( as = "Option<TimestampMilliSeconds<String, Flexible>>" ) ]
119105 pub revocation_date : Option < DateTime < Utc > > ,
120106
121107 /// The Boolean value that indicates whether the user upgraded to another subscription.
122108 ///
123109 /// [isUpgraded](https://developer.apple.com/documentation/appstoreserverapi/isupgraded)
124- #[ serde( rename = "isUpgraded" ) ]
125110 pub is_upgraded : Option < bool > ,
126111
127112 /// A value that represents the promotional offer type.
128113 ///
129114 /// [offerType](https://developer.apple.com/documentation/appstoreserverapi/offertype)
130- #[ serde( rename = "offerType" ) ]
131115 pub offer_type : Option < OfferType > ,
132116
133117 /// The identifier that contains the offer code or the promotional offer identifier.
134118 ///
135119 /// [offerIdentifier](https://developer.apple.com/documentation/appstoreserverapi/offeridentifier)
136- #[ serde( rename = "offerIdentifier" ) ]
137120 pub offer_identifier : Option < String > ,
138121
139122 /// The server environment, either sandbox or production.
@@ -149,13 +132,11 @@ pub struct JWSTransactionDecodedPayload {
149132 /// An Apple-defined value that uniquely identifies the App Store storefront associated with the purchase.
150133 ///
151134 /// [storefrontId](https://developer.apple.com/documentation/appstoreserverapi/storefrontid)
152- #[ serde( rename = "storefrontId" ) ]
153135 pub storefront_id : Option < String > ,
154136
155137 /// The reason for the purchase transaction, which indicates whether it’s a customer’s purchase or a renewal for an auto-renewable subscription that the system initiates.
156138 ///
157139 /// [transactionReason](https://developer.apple.com/documentation/appstoreserverapi/transactionreason)
158- #[ serde( rename = "transactionReason" ) ]
159140 pub transaction_reason : Option < TransactionReason > ,
160141
161142 /// The three-letter ISO 4217 currency code for the price of the product.
@@ -171,24 +152,20 @@ pub struct JWSTransactionDecodedPayload {
171152 /// The payment mode you configure for the offer.
172153 ///
173154 /// [offerDiscountType](https://developer.apple.com/documentation/appstoreserverapi/offerdiscounttype)
174- #[ serde( rename = "offerDiscountType" ) ]
175155 pub offer_discount_type : Option < OfferDiscountType > ,
176156
177157 /// The unique identifier of the app download transaction.
178158 ///
179159 /// [appTransactionId](https://developer.apple.com/documentation/appstoreserverapi/appTransactionId)
180- #[ serde( rename = "appTransactionId" ) ]
181160 pub app_transaction_id : Option < String > ,
182161
183162 /// The duration of the offer.
184163 ///
185164 /// [offerPeriod](https://developer.apple.com/documentation/appstoreserverapi/offerPeriod)
186- #[ serde( rename = "offerPeriod" ) ]
187165 pub offer_period : Option < String > ,
188166
189167 /// Transaction information that is present only for Advanced Commerce SKUs.
190168 ///
191169 /// [advancedCommerceTransactionInfo](https://developer.apple.com/documentation/appstoreserverapi/advancedcommercetransactioninfo)
192- #[ serde( rename = "advancedCommerceInfo" ) ]
193170 pub advanced_commerce_info : Option < AdvancedCommerceTransactionInfo > ,
194171}
0 commit comments