Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(appstore): correct the parameter of GetTransactionHistory #313

Merged
merged 1 commit into from
Mar 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions appstore/api/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
HostProduction = "https://api.storekit.itunes.apple.com"

PathLookUp = "/inApps/v1/lookup/{orderId}"
PathTransactionHistory = "/inApps/v2/history/{originalTransactionId}"
PathTransactionHistory = "/inApps/v2/history/{transactionId}"
PathTransactionHistoryV1 = "/inApps/v1/history/{originalTransactionId}"
PathTransactionInfo = "/inApps/v1/transactions/{transactionId}"
PathRefundHistory = "/inApps/v2/refund/lookup/{originalTransactionId}"
Expand Down Expand Up @@ -66,7 +66,7 @@ type (
GetALLSubscriptionStatuses(ctx context.Context, originalTransactionId string, query *url.Values) (rsp *StatusResponse, err error)
GetRefundHistory(ctx context.Context, originalTransactionId string) (responses []*RefundLookupResponse, err error)
GetSubscriptionRenewalDataStatus(ctx context.Context, productId, requestIdentifier string) (statusCode int, rsp *MassExtendRenewalDateStatusResponse, err error)
GetTransactionHistory(ctx context.Context, originalTransactionId string, query *url.Values) (responses []*HistoryResponse, err error)
GetTransactionHistory(ctx context.Context, transactionId string, query *url.Values) (responses []*HistoryResponse, err error)
GetTransactionInfo(ctx context.Context, transactionId string) (rsp *TransactionInfoResponse, err error)
LookupOrderID(ctx context.Context, orderId string) (rsp *OrderLookupResponse, err error)
}
Expand Down Expand Up @@ -190,9 +190,9 @@ func (a *StoreClient) LookupOrderID(ctx context.Context, orderId string) (rsp *O
}

// GetTransactionHistory https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history
func (a *StoreClient) GetTransactionHistory(ctx context.Context, originalTransactionId string, query *url.Values) (responses []*HistoryResponse, err error) {
func (a *StoreClient) GetTransactionHistory(ctx context.Context, transactionId string, query *url.Values) (responses []*HistoryResponse, err error) {
URL := a.host + PathTransactionHistory
URL = strings.Replace(URL, "{originalTransactionId}", originalTransactionId, -1)
URL = strings.Replace(URL, "{transactionId}", transactionId, -1)

if query == nil {
query = &url.Values{}
Expand Down