@@ -21,6 +21,7 @@ const (
21
21
HostSandBox = "https://api.storekit-sandbox.itunes.apple.com"
22
22
HostProduction = "https://api.storekit.itunes.apple.com"
23
23
24
+ PathTransactionInfo = "/inApps/v1/transactions/{transactionId}"
24
25
PathLookUp = "/inApps/v1/lookup/{orderId}"
25
26
PathTransactionHistory = "/inApps/v1/history/{originalTransactionId}"
26
27
PathRefundHistory = "/inApps/v2/refund/lookup/{originalTransactionId}"
@@ -113,6 +114,26 @@ func (c *StoreClient) GetALLSubscriptionStatuses(ctx context.Context, originalTr
113
114
return rsp , nil
114
115
}
115
116
117
+ // GetTransactionInfo https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info
118
+ func (c * StoreClient ) GetTransactionInfo (ctx context.Context , transactionId string ) (* TransactionInfoResponse , error ) {
119
+ URL := c .hostUrl + PathTransactionInfo
120
+ URL = strings .Replace (URL , "{transactionId}" , transactionId , - 1 )
121
+
122
+ var client HTTPClient
123
+ client = c .httpCli
124
+ client = SetInitializer (client , c .initHttpClient )
125
+ client = RequireResponseStatus (client , http .StatusOK )
126
+ client = SetRequest (ctx , client , http .MethodGet , URL )
127
+ rsp := & TransactionInfoResponse {}
128
+ client = SetResponseBodyHandler (client , json .Unmarshal , rsp )
129
+
130
+ _ , err := client .Do (nil )
131
+ if err != nil {
132
+ return nil , err
133
+ }
134
+ return rsp , nil
135
+ }
136
+
116
137
// LookupOrderID https://developer.apple.com/documentation/appstoreserverapi/look_up_order_id
117
138
func (c * StoreClient ) LookupOrderID (ctx context.Context , orderId string ) (* OrderLookupResponse , error ) {
118
139
URL := c .hostUrl + PathLookUp
0 commit comments