-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,34 @@ | ||
package adapter | ||
|
||
import ( | ||
"craftgate-go-client/adapter/rest" | ||
"craftgate-go-client/model" | ||
"fmt" | ||
"net/http" | ||
) | ||
|
||
type Wallet struct { | ||
Opts model.RequestOptions | ||
} | ||
|
||
type RetrieveMemberWalletRequest struct { | ||
MemberId int64 `schema:"memberId"` | ||
} | ||
|
||
type RetrieveMemberWalletResponse struct { | ||
Id int64 `schema:"id"` | ||
CreatedDate Time `schema:"createdDate"` | ||
UpdatedDate Time `schema:"updatedDate"` | ||
Amount float64 `schema:"amount"` | ||
WithdrawalAmount float64 `schema:"withdrawalAmount"` | ||
Currency model.Currency `schema:"currency"` | ||
MemberId int64 `schema:"memberId"` | ||
} | ||
|
||
func (api *Wallet) RetrieveMemberWallet(request RetrieveMemberWalletRequest) (interface{}, error) { | ||
req, _ := http.NewRequest("GET", fmt.Sprintf("%s/wallet/v1/members/%d/wallet", api.Opts.BaseURL, request.MemberId), nil) | ||
|
||
res := model.Response[RetrieveMemberWalletResponse]{} | ||
resErr := rest.SendRequest(req, &res, api.Opts) | ||
return &res, resErr | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters