-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgocardless.ts
86 lines (66 loc) · 1.98 KB
/
gocardless.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../../resource';
import * as Core from '../../../core';
import * as AgreementAPI from './agreement';
import { Agreement, AgreementCreateParams, GocardlessAgreement } from './agreement';
export class Gocardless extends APIResource {
agreement: AgreementAPI.Agreement = new AgreementAPI.Agreement(this._client);
/**
* Exchange token (GoCardLess)
*/
exchange(
body: GocardlessExchangeParams,
options?: Core.RequestOptions,
): Core.APIPromise<GocardlessExchange> {
return this._client.post('/auth/gocardless/exchange', { body, ...options });
}
/**
* Auth link (GoCardLess)
*/
link(body: GocardlessLinkParams, options?: Core.RequestOptions): Core.APIPromise<GocardlessLink> {
return this._client.post('/auth/gocardless/link', { body, ...options });
}
}
export interface GocardlessExchange {
data: GocardlessExchange.Data;
}
export namespace GocardlessExchange {
export interface Data {
id: string;
access_valid_for_days: number;
institution_id: string;
max_historical_days: number;
}
}
export interface GocardlessLink {
data: GocardlessLink.Data;
}
export namespace GocardlessLink {
export interface Data {
link: string;
}
}
export interface GocardlessExchangeParams {
institutionId: string;
transactionTotalDays: number;
}
export interface GocardlessLinkParams {
agreement: string | null;
institutionId: string;
redirect: string;
reference?: string;
}
Gocardless.Agreement = Agreement;
export declare namespace Gocardless {
export {
type GocardlessExchange as GocardlessExchange,
type GocardlessLink as GocardlessLink,
type GocardlessExchangeParams as GocardlessExchangeParams,
type GocardlessLinkParams as GocardlessLinkParams,
};
export {
Agreement as Agreement,
type GocardlessAgreement as GocardlessAgreement,
type AgreementCreateParams as AgreementCreateParams,
};
}