From 0be0f61de93a8184910029895fb81089bd0dccea Mon Sep 17 00:00:00 2001 From: Andrew Beaven Date: Wed, 6 Mar 2024 16:00:13 +1300 Subject: [PATCH] Add a method and associated response models to hit the Get Transaction Info endpoint referenced here: https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info --- AppStoreServerApi/AppleAppstoreClient.cs | 6 ++++++ AppStoreServerApi/Models/TransactionInfoResponse.cs | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 AppStoreServerApi/Models/TransactionInfoResponse.cs diff --git a/AppStoreServerApi/AppleAppstoreClient.cs b/AppStoreServerApi/AppleAppstoreClient.cs index 28c4ff5..fa13fbd 100644 --- a/AppStoreServerApi/AppleAppstoreClient.cs +++ b/AppStoreServerApi/AppleAppstoreClient.cs @@ -80,6 +80,12 @@ private bool TokenExpired return await this.MakeRequest($"{this.BaseUrl}/inApps/v1/history/{originalTransactionId}{query}"); } + + // https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info + public async Task GetTransactionInfo(string transactionId) + { + return await this.MakeRequest($"{this.BaseUrl}/inApps/v1/transactions/{transactionId}"); + } // https://developer.apple.com/documentation/appstoreserverapi/get_all_subscription_statuses public async Task GetSubscriptionStatuses(string originalTransactionId) diff --git a/AppStoreServerApi/Models/TransactionInfoResponse.cs b/AppStoreServerApi/Models/TransactionInfoResponse.cs new file mode 100644 index 0000000..f375cf2 --- /dev/null +++ b/AppStoreServerApi/Models/TransactionInfoResponse.cs @@ -0,0 +1,11 @@ +namespace AppStoreServerApi.Models +{ + // https://developer.apple.com/documentation/appstoreserverapi/transactioninforesponse + public class TransactionInfoResponse + { + /// + /// JWSTransaction + /// + public string SignedTransactionInfo { get; set; } = null!; + } +} \ No newline at end of file