AuthHttpClient
Extends:
Client for making authenticated requests to the Token gateway.
Constructor Summary
Public Constructor | ||
public |
constructor(options: *) |
Method Summary
Public Methods | ||
public |
async cancelToken(token: Object): Object Cancels a token. |
|
public |
async createCustomization(logo: Object, colors: Object, consentText: string, name: string, appName: string): Promise Creates customization. |
|
public |
Gets a blob from the server. |
|
public |
async getProfile(id: string): Object Gets a member's public profile. |
|
public |
async getProfilePicture(id: string, size: Object): Object Gets a member's public profile picture. |
|
public |
Gets a token by its ID. |
|
public |
Gets all tokens of the member, of a certain type. |
|
public |
async getTransfer(transferId: string): Object Gets a transfer by ID. |
|
public |
async getTransfers(tokenId: string, offset: string, limit: Number): Object Gets all transfers on a token. |
|
public |
async redeemToken(transferToken: Object, amount: Number, currency: string, description: string, destinations: Array, refId: string): Object Redeems a transfer token. |
|
public |
async setProfile(profile: Object): Object Replaces the authenticated member's public profile. |
|
public |
async setProfilePicture(type: string, data: Buffer): Object Uploads member's public profile picture. |
|
public |
async storeTokenRequest(tokenRequest: Object): Promise Stores a request for a token. |
|
public |
useAccessToken(accessTokenId: string, customerInitiated: boolean) Uses the given access token. |
Private Methods | ||
private |
async _tokenOperation(token: *, operation: *, suffix: *): * |
|
private |
async _tokenOperationRequest(token: *, suffix: *): {"tokenId": *, "signature": *} |
|
private |
async _tokenOperationSignature(tokenPayload: *, suffix: *): {"memberId": *, "keyId": *, "signature": *} |
Public Constructors
public constructor(options: *) source
Params:
Name | Type | Attribute | Description |
options | * |
Public Methods
public async cancelToken(token: Object): Object source
Cancels a token.
Params:
Name | Type | Attribute | Description |
token | Object | token to cancel |
public async createCustomization(logo: Object, colors: Object, consentText: string, name: string, appName: string): Promise source
Creates customization.
public async getBlob(blobId: string): Object source
Gets a blob from the server.
Params:
Name | Type | Attribute | Description |
blobId | string | ID of the blob |
public async getProfile(id: string): Object source
Gets a member's public profile.
Params:
Name | Type | Attribute | Description |
id | string | member ID whose profile to get |
public async getProfilePicture(id: string, size: Object): Object source
Gets a member's public profile picture.
public async getToken(tokenId: string): Object source
Gets a token by its ID.
Params:
Name | Type | Attribute | Description |
tokenId | string | ID of the token to get |
public async getTokens(type: string, offset: string, limit: Number): Object source
Gets all tokens of the member, of a certain type.
public async getTransfer(transferId: string): Object source
Gets a transfer by ID.
Params:
Name | Type | Attribute | Description |
transferId | string | ID of the transfer |
public async getTransfers(tokenId: string, offset: string, limit: Number): Object source
Gets all transfers on a token.
public async redeemToken(transferToken: Object, amount: Number, currency: string, description: string, destinations: Array, refId: string): Object source
Redeems a transfer token.
public async setProfile(profile: Object): Object source
Replaces the authenticated member's public profile.
Params:
Name | Type | Attribute | Description |
profile | Object | profile to set |
public async setProfilePicture(type: string, data: Buffer): Object source
Uploads member's public profile picture.
Params:
Name | Type | Attribute | Description |
type | string | MIME type |
|
data | Buffer | data in bytes |
public async storeTokenRequest(tokenRequest: Object): Promise source
Stores a request for a token. Called by a merchant or a TPP that wants access from a user.
Params:
Name | Type | Attribute | Description |
tokenRequest | Object | token request to store |
public useAccessToken(accessTokenId: string, customerInitiated: boolean) source
Uses the given access token.
Private Methods
private async _tokenOperation(token: *, operation: *, suffix: *): * source
Params:
Name | Type | Attribute | Description |
token | * | ||
operation | * | ||
suffix | * |
Return:
* |
private async _tokenOperationRequest(token: *, suffix: *): {"tokenId": *, "signature": *} source
Params:
Name | Type | Attribute | Description |
token | * | ||
suffix | * |
Return:
{"tokenId": *, "signature": *} |
private async _tokenOperationSignature(tokenPayload: *, suffix: *): {"memberId": *, "keyId": *, "signature": *} source
Params:
Name | Type | Attribute | Description |
tokenPayload | * | ||
suffix | * |
Return:
{"memberId": *, "keyId": *, "signature": *} |