Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ for await (const payment of client.payments.all()) {
### Available client options

- `raiseOnIdempotencyConflict`: set to `true` to raise exceptions on [idempotency](https://developer.gocardless.com/api-reference/#making-requests-idempotency-keys) conflicts. Defaults to `false`.

275 changes: 134 additions & 141 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gocardless-nodejs",
"version": "7.0.0",
"version": "7.1.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 <client-libraries@gocardless.com>",
"repository": {
Expand Down
11 changes: 11 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { CustomerBankAccountService } from './services/customerBankAccountServic
import { CustomerNotificationService } from './services/customerNotificationService';
import { EventService } from './services/eventService';
import { ExportService } from './services/exportService';
import { FundsAvailabilityService } from './services/fundsAvailabilityService';
import { InstalmentScheduleService } from './services/instalmentScheduleService';
import { InstitutionService } from './services/institutionService';
import { LogoService } from './services/logoService';
Expand Down Expand Up @@ -67,6 +68,7 @@ export class GoCardlessClient {
private _customerNotifications: CustomerNotificationService;
private _events: EventService;
private _exports: ExportService;
private _fundsAvailabilities: FundsAvailabilityService;
private _instalmentSchedules: InstalmentScheduleService;
private _institutions: InstitutionService;
private _logos: LogoService;
Expand Down Expand Up @@ -114,6 +116,7 @@ export class GoCardlessClient {
this._customerNotifications = undefined;
this._events = undefined;
this._exports = undefined;
this._fundsAvailabilities = undefined;
this._instalmentSchedules = undefined;
this._institutions = undefined;
this._logos = undefined;
Expand Down Expand Up @@ -285,6 +288,14 @@ export class GoCardlessClient {
return this._exports;
}

get fundsAvailabilities(): FundsAvailabilityService {
if (!this._fundsAvailabilities) {
this._fundsAvailabilities = new FundsAvailabilityService(this._api);
}

return this._fundsAvailabilities;
}

get instalmentSchedules(): InstalmentScheduleService {
if (!this._instalmentSchedules) {
this._instalmentSchedules = new InstalmentScheduleService(this._api);
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enum Environments {
Sandbox = 'SANDBOX',
}

const CLIENT_VERSION = '7.0.0';
const CLIENT_VERSION = '7.1.0';
const API_VERSION = '2015-07-06';

export { Environments, CLIENT_VERSION, API_VERSION };
8 changes: 4 additions & 4 deletions src/services/balanceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ interface BalanceListResponse extends Types.APIResponse {
}

interface BalanceListRequest {
// Cursor pointing to the start of the desired set.
// Cursor pointing to the start of the desired set.

after?: string;

// Cursor pointing to the end of the desired set.
// Cursor pointing to the end of the desired set.

before?: string;

// ID of a [creditor](#core-endpoints-creditors).
// ID of a [creditor](#core-endpoints-creditors).

creditor: string;

// Number of records to return.
// Number of records to return.

limit?: string;
}
Expand Down
6 changes: 3 additions & 3 deletions src/services/bankAccountHolderVerificationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ interface BankAccountHolderVerificationCreateRequest {
// Resources linked to this BankAccountHolderVerification.
links: Types.BankAccountHolderVerificationCreateRequestLinks;

// Type of the verification that has been performed
// eg. [Confirmation of
// Payee](https://www.wearepay.uk/what-we-do/overlay-services/confirmation-of-payee/)
// Type of the verification that has been performed
// eg. [Confirmation of
// Payee](https://www.wearepay.uk/what-we-do/overlay-services/confirmation-of-payee/)

type: Types.BankAccountHolderVerificationType;
}
Expand Down
36 changes: 18 additions & 18 deletions src/services/bankAuthorisationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ interface BankAuthorisationCreateRequest {
// Resources linked to this BankAuthorisation.
links: Types.BankAuthorisationCreateRequestLinks;

// URL that the payer can be redirected to after authorising the payment.
// URL that the payer can be redirected to after authorising the payment.
//
// On completion of bank authorisation, the query parameter of either
// `outcome=success` or `outcome=failure` will be
// appended to the `redirect_uri` to indicate the result of the bank
// authorisation. If the bank authorisation is
// expired, the query parameter `outcome=timeout` will be appended to the
// `redirect_uri`, in which case you should
// prompt the user to try the bank authorisation step again.
// On completion of bank authorisation, the query parameter of either
// `outcome=success` or `outcome=failure` will be
// appended to the `redirect_uri` to indicate the result of the bank
// authorisation. If the bank authorisation is
// expired, the query parameter `outcome=timeout` will be appended to the
// `redirect_uri`, in which case you should
// prompt the user to try the bank authorisation step again.
//
// Please note: bank authorisations can still fail despite an `outcome=success`
// on the `redirect_uri`. It is therefore recommended to wait for the relevant
// bank authorisation event, such as
// [`BANK_AUTHORISATION_AUTHORISED`](#billing-request-bankauthorisationauthorised),
// [`BANK_AUTHORISATION_DENIED`](#billing-request-bankauthorisationdenied), or
// [`BANK_AUTHORISATION_FAILED`](#billing-request-bankauthorisationfailed) in
// order to show the correct outcome to the user.
// Please note: bank authorisations can still fail despite an `outcome=success`
// on the `redirect_uri`. It is therefore recommended to wait for the relevant
// bank authorisation event, such as
// [`BANK_AUTHORISATION_AUTHORISED`](#billing-request-bankauthorisationauthorised),
// [`BANK_AUTHORISATION_DENIED`](#billing-request-bankauthorisationdenied), or
// [`BANK_AUTHORISATION_FAILED`](#billing-request-bankauthorisationfailed) in
// order to show the correct outcome to the user.
//
// The BillingRequestFlow ID will also be appended to the `redirect_uri` as
// query parameter `id=BRF123`.
// The BillingRequestFlow ID will also be appended to the `redirect_uri` as
// query parameter `id=BRF123`.
//
// Defaults to `https://pay.gocardless.com/billing/static/thankyou`.
// Defaults to `https://pay.gocardless.com/billing/static/thankyou`.

redirect_uri?: string;
}
Expand Down
28 changes: 14 additions & 14 deletions src/services/bankDetailsLookupService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ interface BankDetailsLookupListResponse extends Types.APIResponse {
}

interface BankDetailsLookupCreateRequest {
// The account holder name associated with the account number (if available). If
// provided and the country code is GB, a payer name verification will be
// performed.
// The account holder name associated with the account number (if available).
// If provided and the country code is GB, a payer name verification will be
// performed.

account_holder_name?: string;

// Bank account number - see [local details](#appendix-local-bank-details) for
// more information. Alternatively you can provide an `iban`.
// Bank account number - see [local details](#appendix-local-bank-details) for
// more information. Alternatively you can provide an `iban`.

account_number?: string;

// Bank code - see [local details](#appendix-local-bank-details) for more
// information. Alternatively you can provide an `iban`.
// Bank code - see [local details](#appendix-local-bank-details) for more
// information. Alternatively you can provide an `iban`.

bank_code?: string;

// Branch code - see [local details](#appendix-local-bank-details) for more
// information. Alternatively you can provide an `iban`.
// Branch code - see [local details](#appendix-local-bank-details) for more
// information. Alternatively you can provide an `iban`.

branch_code?: string;

// [ISO
// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
// alpha-2 code. Must be provided if specifying local details.
// [ISO
// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
// alpha-2 code. Must be provided if specifying local details.

country_code?: string;

// International Bank Account Number. Alternatively you can provide [local
// details](#appendix-local-bank-details).
// International Bank Account Number. Alternatively you can provide [local
// details](#appendix-local-bank-details).

iban?: string;
}
Expand Down
89 changes: 45 additions & 44 deletions src/services/billingRequestFlowService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,91 +11,92 @@ interface BillingRequestFlowListResponse extends Types.APIResponse {
}

interface BillingRequestFlowCreateRequest {
// (Experimental feature) Fulfil the Billing Request on completion of the flow
// (true by default). Disabling the auto_fulfil is not allowed currently.
// (Experimental feature) Fulfil the Billing Request on completion of the flow
// (true by default). Disabling the auto_fulfil is not allowed currently.

auto_fulfil?: boolean;

// Identifies whether a Billing Request belongs to a specific customer
// Identifies whether a Billing Request belongs to a specific customer

customer_details_captured?: boolean;

// URL that the payer can be taken to if there isn't a way to progress ahead in
// flow.
// URL that the payer can be taken to if there isn't a way to progress ahead in
// flow, for example if the customer searches for a bank that doesn't exist or
// isn't supported on the scheme.

exit_uri?: string;

// Sets the default language of the Billing Request Flow and the customer. [ISO
// 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code.
// Sets the default language of the Billing Request Flow and the customer. [ISO
// 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code.

language?: string;

// Resources linked to this BillingRequestFlow.
links: Types.BillingRequestFlowCreateRequestLinks;

// If true, the payer will not be able to change their bank account within the
// flow. If the bank_account details are collected as part of bank_authorisation
// then GC will set this value to true mid flow.
// If true, the payer will not be able to change their bank account within the
// flow. If the bank_account details are collected as part of
// bank_authorisation then GC will set this value to true mid flow.
//
// You can only lock bank account if these have already been completed as a part
// of the billing request.
// You can only lock bank account if these have already been completed as a
// part of the billing request.
//

lock_bank_account?: boolean;

// If true, the payer will not be able to change their currency/scheme manually
// within the flow. Note that this only applies to the mandate only flows -
// currency/scheme can never be changed when there is a specified subscription
// or payment.
// If true, the payer will not be able to change their currency/scheme manually
// within the flow. Note that this only applies to the mandate only flows -
// currency/scheme can never be changed when there is a specified subscription
// or payment.

lock_currency?: boolean;

// If true, the payer will not be able to edit their customer details within the
// flow. If the customer details are collected as part of bank_authorisation
// then GC will set this value to true mid flow.
// If true, the payer will not be able to edit their customer details within
// the flow. If the customer details are collected as part of
// bank_authorisation then GC will set this value to true mid flow.
//
// You can only lock customer details if these have already been completed as a
// part of the billing request.
// You can only lock customer details if these have already been completed as a
// part of the billing request.
//

lock_customer_details?: boolean;

// Bank account information used to prefill the payment page so your customer
// doesn't have to re-type details you already hold about them. It will be
// stored unvalidated and the customer will be able to review and amend it
// before completing the form.
// Bank account information used to prefill the payment page so your customer
// doesn't have to re-type details you already hold about them. It will be
// stored unvalidated and the customer will be able to review and amend it
// before completing the form.
prefilled_bank_account?: Types.BillingRequestFlowPrefilledBankAccount;

// Customer information used to prefill the payment page so your customer
// doesn't have to re-type details you already hold about them. It will be
// stored unvalidated and the customer will be able to review and amend it
// before completing the form.
// Customer information used to prefill the payment page so your customer
// doesn't have to re-type details you already hold about them. It will be
// stored unvalidated and the customer will be able to review and amend it
// before completing the form.
prefilled_customer?: Types.BillingRequestFlowPrefilledCustomer;

// URL that the payer can be redirected to after completing the request flow.
// URL that the payer can be redirected to after completing the request flow.

redirect_uri?: string;

// If true, the payer will be able to see redirect action buttons on Thank You
// page. These action buttons will provide a way to connect back to the billing
// request flow app if opened within a mobile app. For successful flow, the
// button will take the payer back the billing request flow where they will see
// the success screen. For failure, button will take the payer to url being
// provided against exit_uri field.
// If true, the payer will be able to see redirect action buttons on Thank You
// page. These action buttons will provide a way to connect back to the billing
// request flow app if opened within a mobile app. For successful flow, the
// button will take the payer back the billing request flow where they will see
// the success screen. For failure, button will take the payer to url being
// provided against exit_uri field.

show_redirect_buttons?: boolean;

// If true, the payer will be able to see a redirect action button on the
// Success page. This action button will provide a way to redirect the payer to
// the given redirect_uri. This functionality is helpful when merchants do not
// want payers to be automatically redirected or on Android devices, where
// automatic redirections are not possible.
// If true, the payer will be able to see a redirect action button on the
// Success page. This action button will provide a way to redirect the payer to
// the given redirect_uri. This functionality is helpful when merchants do not
// want payers to be automatically redirected or on Android devices, where
// automatic redirections are not possible.

show_success_redirect_button?: boolean;

// If true, the payer will not be redirected to the success screen after
// completing the flow. A redirect_uri needs to be provided for this parameter
// to be taken into account.
// If true, the payer will not be redirected to the success screen after
// completing the flow. A redirect_uri needs to be provided for this parameter
// to be taken into account.

skip_success_screen?: boolean;
}
Expand Down
Loading