Skip to content

Commit

Permalink
Merge pull request #304 from richzw/master
Browse files Browse the repository at this point in the history
feat(appstore): change the response of api server from interface to specific response
  • Loading branch information
takecy authored Nov 15, 2024
2 parents 0f61393 + 4397996 commit 195f7cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions appstore/api/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 195f7cf

Please sign in to comment.