From 43979967166d164658a40eba6ad420ee45b00a2f Mon Sep 17 00:00:00 2001 From: Wei Zang Date: Fri, 15 Nov 2024 17:03:37 +0800 Subject: [PATCH] feat(appstore): change the response of api server from interface to specific response --- appstore/api/validator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appstore/api/validator.go b/appstore/api/validator.go index 4d1e6ae..86f8538 100644 --- a/appstore/api/validator.go +++ b/appstore/api/validator.go @@ -7,7 +7,7 @@ import ( // IAPAPIClient is an interface to call validation API in App Store Server API type IAPAPIClient interface { - Verify(ctx context.Context, transactionId string) (interface{}, error) + Verify(ctx context.Context, transactionId string) (*TransactionInfoResponse, error) } type APIClient struct { @@ -23,7 +23,7 @@ func NewAPIClient(config StoreConfig) *APIClient { return &APIClient{productionCli: NewStoreClient(&prodConf), sandboxCli: NewStoreClient(&sandboxConf)} } -func (c *APIClient) Verify(ctx context.Context, transactionId string) (interface{}, error) { +func (c *APIClient) Verify(ctx context.Context, transactionId string) (*TransactionInfoResponse, error) { result, err := c.productionCli.GetTransactionInfo(ctx, transactionId) if err != nil && errors.Is(err, TransactionIdNotFoundError) { result, err = c.sandboxCli.GetTransactionInfo(ctx, transactionId)