-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes generated by c55b5b124f1deab3efd5df00101041ded4cf8e14
- Loading branch information
1 parent
47d9db9
commit 1c578de
Showing
5 changed files
with
188 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use strict'; | ||
|
||
import { Api } from '../api/api'; | ||
import * as Types from '../types/Types'; | ||
|
||
interface LogoResponse extends Types.Logo, Types.APIResponse {} | ||
|
||
interface LogoListResponse extends Types.APIResponse { | ||
logos: Types.Logo[]; | ||
meta: Types.ListMeta; | ||
} | ||
|
||
interface LogoCreateForCreditorRequest { | ||
// Base64 encoded string. | ||
|
||
image: string; | ||
|
||
// Resources linked to this Logo. | ||
links?: Types.LogoCreateForCreditorRequestLinks; | ||
} | ||
|
||
export class LogoService { | ||
private api: Api; | ||
|
||
constructor(api) { | ||
this.api = api; | ||
} | ||
|
||
async createForCreditor( | ||
requestParameters: LogoCreateForCreditorRequest, | ||
idempotencyKey = '', | ||
customHeaders: Types.JsonMap = {} | ||
): Promise<LogoResponse> { | ||
const urlParameters = []; | ||
const requestParams = { | ||
path: '/branding/logos', | ||
method: 'post', | ||
urlParameters, | ||
requestParameters, | ||
payloadKey: 'logos', | ||
idempotencyKey, | ||
customHeaders, | ||
fetch: undefined, | ||
}; | ||
|
||
const response = await this.api.request(requestParams); | ||
const formattedResponse: LogoResponse = { | ||
...(response.body?.['logos'] ?? response), | ||
__response__: response.__response__, | ||
}; | ||
|
||
return formattedResponse; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
'use strict'; | ||
|
||
import { Api } from '../api/api'; | ||
import * as Types from '../types/Types'; | ||
|
||
interface PayerThemeResponse extends Types.PayerTheme, Types.APIResponse {} | ||
|
||
interface PayerThemeListResponse extends Types.APIResponse { | ||
payer_themes: Types.PayerTheme[]; | ||
meta: Types.ListMeta; | ||
} | ||
|
||
interface PayerThemeCreateForCreditorRequest { | ||
// Colour for buttons background (hexcode) | ||
|
||
button_background_colour?: string; | ||
|
||
// Colour for content box border (hexcode) | ||
|
||
content_box_border_colour?: string; | ||
|
||
// Colour for header background (hexcode) | ||
|
||
header_background_colour?: string; | ||
|
||
// Colour for text links (hexcode) | ||
|
||
link_text_colour?: string; | ||
|
||
// Resources linked to this PayerTheme. | ||
links?: Types.PayerThemeCreateForCreditorRequestLinks; | ||
} | ||
|
||
export class PayerThemeService { | ||
private api: Api; | ||
|
||
constructor(api) { | ||
this.api = api; | ||
} | ||
|
||
async createForCreditor( | ||
requestParameters: PayerThemeCreateForCreditorRequest, | ||
idempotencyKey = '', | ||
customHeaders: Types.JsonMap = {} | ||
): Promise<PayerThemeResponse> { | ||
const urlParameters = []; | ||
const requestParams = { | ||
path: '/branding/payer_themes', | ||
method: 'post', | ||
urlParameters, | ||
requestParameters, | ||
payloadKey: 'payer_themes', | ||
idempotencyKey, | ||
customHeaders, | ||
fetch: undefined, | ||
}; | ||
|
||
const response = await this.api.request(requestParams); | ||
const formattedResponse: PayerThemeResponse = { | ||
...(response.body?.['payer_themes'] ?? response), | ||
__response__: response.__response__, | ||
}; | ||
|
||
return formattedResponse; | ||
} | ||
} |
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