Skip to content

Commit

Permalink
Rearrange functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sanducb committed Oct 2, 2024
1 parent 70d1f15 commit fcfc76b
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions packages/wallet/backend/src/gatehub/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,40 +405,6 @@ export class GateHubClient {
return this.request<IGetTransactionsResponse>('GET', url)
}

async lockCard(
cardId: string,
reasonCode: LockReasonCode,
requestBody: ICardLockRequest
): Promise<ICardResponse> {
let url = `${this.apiUrl}/v1/cards/${cardId}/lock`
url += `?reasonCode=${encodeURIComponent(reasonCode)}`

return this.request<ICardResponse>(
'PUT',
url,
JSON.stringify(requestBody),
{
cardAppId: this.env.GATEHUB_CARD_APP_ID
}
)
}

async unlockCard(
cardId: string,
requestBody: ICardUnlockRequest
): Promise<ICardResponse> {
const url = `${this.apiUrl}/v1/cards/${cardId}/unlock`

return this.request<ICardResponse>(
'PUT',
url,
JSON.stringify(requestBody),
{
cardAppId: this.env.GATEHUB_CARD_APP_ID
}
)
}

async getPin(
requestBody: ICardDetailsRequest
): Promise<ICardDetailsResponse> {
Expand Down Expand Up @@ -503,6 +469,40 @@ export class GateHubClient {
)
}

async lockCard(
cardId: string,
reasonCode: LockReasonCode,
requestBody: ICardLockRequest
): Promise<ICardResponse> {
let url = `${this.apiUrl}/v1/cards/${cardId}/lock`
url += `?reasonCode=${encodeURIComponent(reasonCode)}`

return this.request<ICardResponse>(
'PUT',
url,
JSON.stringify(requestBody),
{
cardAppId: this.env.GATEHUB_CARD_APP_ID
}
)
}

async unlockCard(
cardId: string,
requestBody: ICardUnlockRequest
): Promise<ICardResponse> {
const url = `${this.apiUrl}/v1/cards/${cardId}/unlock`

return this.request<ICardResponse>(
'PUT',
url,
JSON.stringify(requestBody),
{
cardAppId: this.env.GATEHUB_CARD_APP_ID
}
)
}

async permanentlyBlockCard(
cardId: string,
reasonCode: BlockReasonCode
Expand Down

0 comments on commit fcfc76b

Please sign in to comment.