Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
deryacakmak committed Jul 3, 2024
1 parent f252f3d commit ad1b9a6
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions adapter/bkm_express.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,16 @@ func (api *BkmExpress) Complete(ctx context.Context, request CompleteBkmExpressR
return response.Data, nil
}

func (api *BkmExpress) RetrievePayment(ctx context.Context, ticketId string) error {
newRequest, err := api.Client.NewRequest(ctx, http.MethodGet, fmt.Sprintf("/payment/v1/bkm-express/payments/%s", ticketId), nil)
func (api *BkmExpress) RetrievePayment(ctx context.Context, ticketId string) (*PaymentResponse, error) {
newRequest, err := api.Client.NewRequest(ctx, http.MethodGet, fmt.Sprintf("/payment/v1/card-payments/%s", ticketId), nil)
if err != nil {
return fmt.Errorf("failed to create new request: %w", err)
return nil, err
}
response := &Void{}

response := &Response[PaymentResponse]{}
err = api.Client.Do(ctx, newRequest, response)
if err != nil {
return fmt.Errorf("request failed: %w", err)
}
if response == nil {
return fmt.Errorf("empty response")
return nil, err
}

return nil
return response.Data, nil
}

0 comments on commit ad1b9a6

Please sign in to comment.