Skip to content

Commit

Permalink
Merge pull request #173 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Temple changes
  • Loading branch information
barrucadu authored Jan 10, 2024
2 parents 9f71578 + 0e87c1a commit ffe6830
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 61 deletions.
118 changes: 59 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "3.19.0",
"version": "3.20.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": {
Expand Down
11 changes: 11 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ScenarioSimulatorService } from './services/scenarioSimulatorService';
import { SchemeIdentifierService } from './services/schemeIdentifierService';
import { SubscriptionService } from './services/subscriptionService';
import { TaxRateService } from './services/taxRateService';
import { TransferredMandateService } from './services/transferredMandateService';
import { VerificationDetailService } from './services/verificationDetailService';
import { WebhookService } from './services/webhookService';

Expand Down Expand Up @@ -68,6 +69,7 @@ export class GoCardlessClient {
private _schemeIdentifiers: SchemeIdentifierService;
private _subscriptions: SubscriptionService;
private _taxRates: TaxRateService;
private _transferredMandates: TransferredMandateService;
private _verificationDetails: VerificationDetailService;
private _webhooks: WebhookService;

Expand Down Expand Up @@ -104,6 +106,7 @@ export class GoCardlessClient {
this._schemeIdentifiers = undefined;
this._subscriptions = undefined;
this._taxRates = undefined;
this._transferredMandates = undefined;
this._verificationDetails = undefined;
this._webhooks = undefined;
}
Expand Down Expand Up @@ -350,6 +353,14 @@ export class GoCardlessClient {
return this._taxRates;
}

get transferredMandates(): TransferredMandateService {
if (!this._transferredMandates) {
this._transferredMandates = new TransferredMandateService(this._api);
}

return this._transferredMandates;
}

get verificationDetails(): VerificationDetailService {
if (!this._verificationDetails) {
this._verificationDetails = new VerificationDetailService(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 = '3.19.0';
const CLIENT_VERSION = '3.20.0';
const API_VERSION = '2015-07-06';

export { Environments, CLIENT_VERSION, API_VERSION };
6 changes: 6 additions & 0 deletions src/services/bankDetailsLookupService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ 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.

account_holder_name?: string;

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

Expand Down
4 changes: 4 additions & 0 deletions src/services/billingRequestFlowService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ interface BillingRequestFlowCreateRequest {

auto_fulfil?: boolean;

// 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.

Expand Down
5 changes: 5 additions & 0 deletions src/services/billingRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ interface BillingRequestCollectBankAccountRequest {
// to 50 characters and values up to 500 characters.

metadata?: Types.JsonMap;

// A unique record such as an email address, mobile number or company number,
// that can be used to make and accept payments.

pay_id?: string;
}

interface BillingRequestConfirmPayerDetailsRequest {
Expand Down
7 changes: 7 additions & 0 deletions src/services/paymentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ interface PaymentCreateRequest {

description?: string;

// Set this to true or false in the request to create an ACH payment to
// explicitly choose whether the payment should be processed through Faster
// ACH or standard ACH, rather than relying on the presence or absence of the
// charge date to indicate that.

faster_ach?: boolean;

// Resources linked to this Payment.
links: Types.PaymentCreateRequestLinks;

Expand Down
41 changes: 41 additions & 0 deletions src/services/transferredMandateService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict';

import { Api } from '../api/api';
import * as Types from '../types/Types';

interface TransferredMandateResponse
extends Types.TransferredMandate,
Types.APIResponse {}

interface TransferredMandateListResponse extends Types.APIResponse {
transferred_mandates: Types.TransferredMandate[];
meta: Types.ListMeta;
}

export class TransferredMandateService {
private api: Api;

constructor(api) {
this.api = api;
}

async find(identity: string): Promise<TransferredMandateResponse> {
const urlParameters = [{ key: 'identity', value: identity }];
const requestParams = {
path: '/transferred_mandates/:identity',
method: 'get',
urlParameters,

payloadKey: null,
fetch: null,
};

const response = await this.api.request(requestParams);
const formattedResponse: TransferredMandateResponse = {
...response.body['transferred_mandates'],
__response__: response.__response__,
};

return formattedResponse;
}
}
Loading

0 comments on commit ffe6830

Please sign in to comment.