-
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.
Merge pull request #186 from gocardless/template-changes
Template changes
- Loading branch information
Showing
8 changed files
with
191 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 +1,6 @@ | ||
{ | ||
"name": "gocardless-nodejs", | ||
"version": "3.24.0", | ||
"version": "3.25.0", | ||
"description": "Node.js client for the GoCardless API - a powerful, simple solution for the collection of recurring bank-to-bank payments", | ||
"author": "GoCardless Ltd <[email protected]>", | ||
"repository": { | ||
|
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 |
---|---|---|
@@ -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