@superdurable/connector-adyen 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -1
- package/dex-connector.json +534 -2
- package/dist/chunk-P6IMRLQ6.js +489 -0
- package/dist/connection-DqqfBp8C.d.ts +300 -0
- package/dist/index.d.ts +503 -5
- package/dist/index.js +749 -17
- package/dist/mock.d.ts +157 -5
- package/dist/mock.js +391 -6
- package/package.json +3 -3
- package/dist/chunk-CHGEL2F6.js +0 -106
- package/dist/connection-ozFLV9Xy.d.ts +0 -72
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { SecretString, CredentialProvider, Query, Mutation, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { Codec } from '@superdurable/dex';
|
|
4
|
+
|
|
5
|
+
/** A signed 64-bit JSON integer. Values outside the safe number range retain their decimal token. */
|
|
6
|
+
type SignedInteger = number | Readonly<{
|
|
7
|
+
rawJSON: string;
|
|
8
|
+
}>;
|
|
9
|
+
/** Decode one signed Go integer from a safe number or a native raw JSON number token. */
|
|
10
|
+
declare function decodeSignedInteger(value: unknown): SignedInteger;
|
|
11
|
+
/** Read provider JSON with the original syntax of every numeric token for typed field validation. */
|
|
12
|
+
declare function parseJSONNumberTokens(text: string): unknown;
|
|
13
|
+
/** Decode JSON while retaining exact decimal tokens for integers outside JavaScript's safe range. */
|
|
14
|
+
declare function parseExactIntegerJSON(text: string): unknown;
|
|
15
|
+
/** JSON-wire codec for records with signed integer fields. An optional decoder validates the application type. */
|
|
16
|
+
declare function exactIntegerJSONCodec<T>(decode?: (value: unknown) => T): Codec<T>;
|
|
17
|
+
/** Connector configuration; omitted fields use manifest defaults. */
|
|
18
|
+
interface Config {
|
|
19
|
+
/** Checkout API root as an absolute HTTPS URL. Blank uses the displayed test endpoint. For live, find your company prefix in Customer Area > Developers > API URLs > Prefix and use https://{PREFIX}-checkout-live.adyenpayments.com/checkout/v72; override only for live or a trusted local test gateway. */
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
/** Maximum duration of one Checkout API request as a positive Go duration such as 15s. Blank uses the displayed default; increase for slow provider responses. Runtime value in milliseconds. */
|
|
22
|
+
timeoutMs?: number;
|
|
23
|
+
/** Maximum complete Checkout response in bytes as a positive integer. Blank uses the displayed default; increase only for unusually large provider metadata. */
|
|
24
|
+
maxResponseBytes?: number;
|
|
25
|
+
}
|
|
26
|
+
/** Runtime schema for manifest configuration. */
|
|
27
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
28
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
29
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
/** Private connector credentials resolved by the host. */
|
|
33
|
+
interface Credentials {
|
|
34
|
+
/** Secret server-side API key from Adyen Customer Area > Developers > API credentials > Payments > credential username > Server settings > Authentication > API key > Generate API key. Copy the complete opaque value when shown; blank prevents calls. Dex sends it only in the X-API-Key header. Use a key from the same test or live environment as baseUrl. */
|
|
35
|
+
apiKey: SecretString;
|
|
36
|
+
}
|
|
37
|
+
/** Stored credential material that fails the connector credential checks, so no retry can succeed. */
|
|
38
|
+
declare class CredentialMaterialError extends TypeError {
|
|
39
|
+
constructor(message: string);
|
|
40
|
+
}
|
|
41
|
+
/** Report malformed stored credential material, also behind the SDK provider's decoding TypeError. */
|
|
42
|
+
declare function isCredentialMaterialError(error: unknown): boolean;
|
|
43
|
+
/** Decode private credential fields for the connector. */
|
|
44
|
+
declare function decodeCredentials(value: unknown): Credentials;
|
|
45
|
+
/** Host-owned source of private connector credentials. */
|
|
46
|
+
type CredentialSource = CredentialProvider<Credentials>;
|
|
47
|
+
/** LookupCardBrandsByBINInput supplies only a six-digit issuer prefix, never a full card number. */
|
|
48
|
+
interface LookupCardBrandsByBINInput {
|
|
49
|
+
/** MerchantAccount is the account shown in Customer Area > Settings > Merchant accounts. */
|
|
50
|
+
"merchantAccount": string;
|
|
51
|
+
/** IssuerBIN is exactly the first six card digits; never supply the remaining digits. */
|
|
52
|
+
"issuerBin": string;
|
|
53
|
+
/** CountryCode optionally narrows supported brands to an uppercase two-letter shopper country. */
|
|
54
|
+
"countryCode"?: string | undefined;
|
|
55
|
+
}
|
|
56
|
+
/** CardBrand identifies one returned scheme and merchant support decision. */
|
|
57
|
+
interface CardBrand {
|
|
58
|
+
/** Type is the provider's scheme code. */
|
|
59
|
+
"type": string;
|
|
60
|
+
/** Supported reports whether this merchant can accept the brand. */
|
|
61
|
+
"supported": boolean;
|
|
62
|
+
}
|
|
63
|
+
/** CardBrands contains only sanitized brand and support information. */
|
|
64
|
+
interface CardBrands {
|
|
65
|
+
/** Brands is the returned brand list. */
|
|
66
|
+
"brands": Array<CardBrand> | null;
|
|
67
|
+
}
|
|
68
|
+
/** PaymentModificationInput identifies a payment and optional amount to modify. */
|
|
69
|
+
interface PaymentModificationInput {
|
|
70
|
+
/** MerchantAccount is the account in Customer Area > Settings > Merchant accounts. */
|
|
71
|
+
"merchantAccount": string;
|
|
72
|
+
/** PaymentPspReference is the payment reference from Customer Area > Payments > Payment list. */
|
|
73
|
+
"paymentPspReference": string;
|
|
74
|
+
/** Reference is an optional merchant reconciliation reference of at most 80 characters. */
|
|
75
|
+
"reference"?: string | undefined;
|
|
76
|
+
/** CurrencyCode is the original payment's three-letter ISO currency for amount operations. */
|
|
77
|
+
"currencyCode"?: string | undefined;
|
|
78
|
+
/** AmountMinorUnits is the positive capture/refund amount or replacement authorised amount. */
|
|
79
|
+
"amountMinorUnits"?: SignedInteger | undefined;
|
|
80
|
+
}
|
|
81
|
+
/** PaymentModificationReceipt confirms Adyen accepted a modification request, not its final outcome. */
|
|
82
|
+
interface PaymentModificationReceipt {
|
|
83
|
+
/** PaymentPspReference identifies the payment being modified. */
|
|
84
|
+
"paymentPspReference": string;
|
|
85
|
+
/** ModificationPspReference identifies this asynchronous modification request. */
|
|
86
|
+
"modificationPspReference": string;
|
|
87
|
+
/** Status is received; a later webhook determines the final outcome. */
|
|
88
|
+
"status": string;
|
|
89
|
+
}
|
|
90
|
+
/** PaymentReferenceModificationInput selects a payment for a full cancel or reversal. */
|
|
91
|
+
interface PaymentReferenceModificationInput {
|
|
92
|
+
/** MerchantAccount is the account in Customer Area > Settings > Merchant accounts. */
|
|
93
|
+
"merchantAccount": string;
|
|
94
|
+
/** PaymentPspReference is the payment reference from Customer Area > Payments > Payment list. */
|
|
95
|
+
"paymentPspReference": string;
|
|
96
|
+
/** Reference is an optional merchant reconciliation reference of at most 80 characters. */
|
|
97
|
+
"reference"?: string | undefined;
|
|
98
|
+
}
|
|
99
|
+
/** ListPaymentMethodsInput describes a checkout context without shopper identity. */
|
|
100
|
+
interface ListPaymentMethodsInput {
|
|
101
|
+
/** MerchantAccount is the account shown in Adyen Customer Area > Settings > Merchant accounts. */
|
|
102
|
+
"merchantAccount": string;
|
|
103
|
+
/** CurrencyCode is the three-letter ISO currency of the proposed payment. */
|
|
104
|
+
"currencyCode": string;
|
|
105
|
+
/** AmountMinorUnits is the positive proposed amount in currency minor units. */
|
|
106
|
+
"amountMinorUnits": SignedInteger;
|
|
107
|
+
/** CountryCode optionally narrows methods to an uppercase two-letter shopper country. */
|
|
108
|
+
"countryCode"?: string | undefined;
|
|
109
|
+
}
|
|
110
|
+
/** AvailablePaymentMethod has only the provider code and display name. */
|
|
111
|
+
interface AvailablePaymentMethod {
|
|
112
|
+
/** Type is the payment method code used by Adyen. */
|
|
113
|
+
"type": string;
|
|
114
|
+
/** Name is its shopper-facing display name. */
|
|
115
|
+
"name": string;
|
|
116
|
+
}
|
|
117
|
+
/** PaymentMethodPage excludes stored shopper methods and payment data. */
|
|
118
|
+
interface PaymentMethodPage {
|
|
119
|
+
/** Methods are available for this merchant, amount, currency, and country. */
|
|
120
|
+
"methods": Array<AvailablePaymentMethod> | null;
|
|
121
|
+
}
|
|
122
|
+
/** CreatePaymentLinkInput supplies the required Checkout fields and an optional shopper country. */
|
|
123
|
+
interface CreatePaymentLinkInput {
|
|
124
|
+
/** MerchantAccount is the account shown in Adyen Customer Area > Settings > Merchant accounts. */
|
|
125
|
+
"merchantAccount": string;
|
|
126
|
+
/** Reference identifies the payment in future Adyen status communications. */
|
|
127
|
+
"reference": string;
|
|
128
|
+
/** CurrencyCode is the three-letter ISO currency of the amount. */
|
|
129
|
+
"currencyCode": string;
|
|
130
|
+
/** AmountMinorUnits is the positive amount in the currency's minor units. */
|
|
131
|
+
"amountMinorUnits": SignedInteger;
|
|
132
|
+
/** CountryCode optionally narrows available payment methods to a two-letter shopper country. */
|
|
133
|
+
"countryCode"?: string | undefined;
|
|
134
|
+
}
|
|
135
|
+
/** CreatedPaymentLink contains the shopper-facing URL and non-secret payment link identity. */
|
|
136
|
+
interface CreatedPaymentLink {
|
|
137
|
+
/** ID identifies the link for later reads and expiry. */
|
|
138
|
+
"id": string;
|
|
139
|
+
/** Status is the link status at creation. */
|
|
140
|
+
"status": string;
|
|
141
|
+
/** CurrencyCode is the confirmed ISO currency. */
|
|
142
|
+
"currencyCode": string;
|
|
143
|
+
/** AmountMinorUnits is the confirmed amount in minor units. */
|
|
144
|
+
"amountMinorUnits": SignedInteger;
|
|
145
|
+
/** URL is the shopper-facing payment page; share it only with the intended shopper. */
|
|
146
|
+
"url": string;
|
|
147
|
+
}
|
|
148
|
+
/** ExpirePaymentLinkInput selects one link whose status should become expired. */
|
|
149
|
+
interface ExpirePaymentLinkInput {
|
|
150
|
+
/** PaymentLinkID is the non-secret Adyen link ID. */
|
|
151
|
+
"paymentLinkId": string;
|
|
152
|
+
}
|
|
153
|
+
/** PaymentLinkStatus excludes shopper identities and payment details. */
|
|
154
|
+
interface PaymentLinkStatus {
|
|
155
|
+
/** ID is the Adyen payment link ID. */
|
|
156
|
+
"id": string;
|
|
157
|
+
/** Status is a payment link state such as completed. */
|
|
158
|
+
"status": string;
|
|
159
|
+
/** CurrencyCode is the link amount's ISO 4217 currency. */
|
|
160
|
+
"currencyCode": string;
|
|
161
|
+
}
|
|
162
|
+
/** GetPaymentLinkInput selects a payment link by its non-secret Adyen ID. */
|
|
163
|
+
interface GetPaymentLinkInput {
|
|
164
|
+
/** PaymentLinkID is a payment link ID returned by Adyen Checkout API. */
|
|
165
|
+
"paymentLinkId": string;
|
|
166
|
+
}
|
|
167
|
+
/** Runtime validator for LookupCardBrandsByBINInput. */
|
|
168
|
+
declare const LookupCardBrandsByBINInputSchema: z.ZodObject<{
|
|
169
|
+
merchantAccount: z.ZodString;
|
|
170
|
+
issuerBin: z.ZodString;
|
|
171
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
/** Runtime validator for CardBrand. */
|
|
174
|
+
declare const CardBrandSchema: z.ZodObject<{
|
|
175
|
+
type: z.ZodString;
|
|
176
|
+
supported: z.ZodBoolean;
|
|
177
|
+
}, z.core.$strict>;
|
|
178
|
+
/** Runtime validator for CardBrands. */
|
|
179
|
+
declare const CardBrandsSchema: z.ZodObject<{
|
|
180
|
+
brands: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
181
|
+
type: z.ZodString;
|
|
182
|
+
supported: z.ZodBoolean;
|
|
183
|
+
}, z.core.$strict>>>;
|
|
184
|
+
}, z.core.$strict>;
|
|
185
|
+
/** Runtime validator for PaymentModificationInput. */
|
|
186
|
+
declare const PaymentModificationInputSchema: z.ZodObject<{
|
|
187
|
+
merchantAccount: z.ZodString;
|
|
188
|
+
paymentPspReference: z.ZodString;
|
|
189
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
190
|
+
currencyCode: z.ZodOptional<z.ZodString>;
|
|
191
|
+
amountMinorUnits: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodTransform<number | Readonly<{
|
|
192
|
+
rawJSON: string;
|
|
193
|
+
}>, unknown>>>;
|
|
194
|
+
}, z.core.$strict>;
|
|
195
|
+
/** Runtime validator for PaymentModificationReceipt. */
|
|
196
|
+
declare const PaymentModificationReceiptSchema: z.ZodObject<{
|
|
197
|
+
paymentPspReference: z.ZodString;
|
|
198
|
+
modificationPspReference: z.ZodString;
|
|
199
|
+
status: z.ZodString;
|
|
200
|
+
}, z.core.$strict>;
|
|
201
|
+
/** Runtime validator for PaymentReferenceModificationInput. */
|
|
202
|
+
declare const PaymentReferenceModificationInputSchema: z.ZodObject<{
|
|
203
|
+
merchantAccount: z.ZodString;
|
|
204
|
+
paymentPspReference: z.ZodString;
|
|
205
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
/** Runtime validator for ListPaymentMethodsInput. */
|
|
208
|
+
declare const ListPaymentMethodsInputSchema: z.ZodObject<{
|
|
209
|
+
merchantAccount: z.ZodString;
|
|
210
|
+
currencyCode: z.ZodString;
|
|
211
|
+
amountMinorUnits: z.ZodPipe<z.ZodUnknown, z.ZodTransform<number | Readonly<{
|
|
212
|
+
rawJSON: string;
|
|
213
|
+
}>, unknown>>;
|
|
214
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, z.core.$strict>;
|
|
216
|
+
/** Runtime validator for AvailablePaymentMethod. */
|
|
217
|
+
declare const AvailablePaymentMethodSchema: z.ZodObject<{
|
|
218
|
+
type: z.ZodString;
|
|
219
|
+
name: z.ZodString;
|
|
220
|
+
}, z.core.$strict>;
|
|
221
|
+
/** Runtime validator for PaymentMethodPage. */
|
|
222
|
+
declare const PaymentMethodPageSchema: z.ZodObject<{
|
|
223
|
+
methods: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
224
|
+
type: z.ZodString;
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
}, z.core.$strict>>>;
|
|
227
|
+
}, z.core.$strict>;
|
|
228
|
+
/** Runtime validator for CreatePaymentLinkInput. */
|
|
229
|
+
declare const CreatePaymentLinkInputSchema: z.ZodObject<{
|
|
230
|
+
merchantAccount: z.ZodString;
|
|
231
|
+
reference: z.ZodString;
|
|
232
|
+
currencyCode: z.ZodString;
|
|
233
|
+
amountMinorUnits: z.ZodPipe<z.ZodUnknown, z.ZodTransform<number | Readonly<{
|
|
234
|
+
rawJSON: string;
|
|
235
|
+
}>, unknown>>;
|
|
236
|
+
countryCode: z.ZodOptional<z.ZodString>;
|
|
237
|
+
}, z.core.$strict>;
|
|
238
|
+
/** Runtime validator for CreatedPaymentLink. */
|
|
239
|
+
declare const CreatedPaymentLinkSchema: z.ZodObject<{
|
|
240
|
+
id: z.ZodString;
|
|
241
|
+
status: z.ZodString;
|
|
242
|
+
currencyCode: z.ZodString;
|
|
243
|
+
amountMinorUnits: z.ZodPipe<z.ZodUnknown, z.ZodTransform<number | Readonly<{
|
|
244
|
+
rawJSON: string;
|
|
245
|
+
}>, unknown>>;
|
|
246
|
+
url: z.ZodString;
|
|
247
|
+
}, z.core.$strict>;
|
|
248
|
+
/** Runtime validator for ExpirePaymentLinkInput. */
|
|
249
|
+
declare const ExpirePaymentLinkInputSchema: z.ZodObject<{
|
|
250
|
+
paymentLinkId: z.ZodString;
|
|
251
|
+
}, z.core.$strict>;
|
|
252
|
+
/** Runtime validator for PaymentLinkStatus. */
|
|
253
|
+
declare const PaymentLinkStatusSchema: z.ZodObject<{
|
|
254
|
+
id: z.ZodString;
|
|
255
|
+
status: z.ZodString;
|
|
256
|
+
currencyCode: z.ZodString;
|
|
257
|
+
}, z.core.$strict>;
|
|
258
|
+
/** Runtime validator for GetPaymentLinkInput. */
|
|
259
|
+
declare const GetPaymentLinkInputSchema: z.ZodObject<{
|
|
260
|
+
paymentLinkId: z.ZodString;
|
|
261
|
+
}, z.core.$strict>;
|
|
262
|
+
|
|
263
|
+
/** Typed operations supplied by a client or mock. */
|
|
264
|
+
interface Operations {
|
|
265
|
+
/** Invoke lookupCardBrandsByBIN through this connection. */
|
|
266
|
+
lookupCardBrandsByBIN(): Query<LookupCardBrandsByBINInput, CardBrands>;
|
|
267
|
+
/** Invoke capturePayment through this connection. */
|
|
268
|
+
capturePayment(): Mutation<PaymentModificationInput, PaymentModificationReceipt>;
|
|
269
|
+
/** Invoke cancelPayment through this connection. */
|
|
270
|
+
cancelPayment(): Mutation<PaymentReferenceModificationInput, PaymentModificationReceipt>;
|
|
271
|
+
/** Invoke refundPayment through this connection. */
|
|
272
|
+
refundPayment(): Mutation<PaymentModificationInput, PaymentModificationReceipt>;
|
|
273
|
+
/** Invoke reversePayment through this connection. */
|
|
274
|
+
reversePayment(): Mutation<PaymentReferenceModificationInput, PaymentModificationReceipt>;
|
|
275
|
+
/** Invoke updateAuthorisedAmount through this connection. */
|
|
276
|
+
updateAuthorisedAmount(): Mutation<PaymentModificationInput, PaymentModificationReceipt>;
|
|
277
|
+
/** Invoke listPaymentMethods through this connection. */
|
|
278
|
+
listPaymentMethods(): Query<ListPaymentMethodsInput, PaymentMethodPage>;
|
|
279
|
+
/** Invoke createPaymentLink through this connection. */
|
|
280
|
+
createPaymentLink(): Mutation<CreatePaymentLinkInput, CreatedPaymentLink>;
|
|
281
|
+
/** Invoke expirePaymentLink through this connection. */
|
|
282
|
+
expirePaymentLink(): Mutation<ExpirePaymentLinkInput, PaymentLinkStatus>;
|
|
283
|
+
/** Invoke getPaymentLink through this connection. */
|
|
284
|
+
getPaymentLink(): Query<GetPaymentLinkInput, PaymentLinkStatus>;
|
|
285
|
+
}
|
|
286
|
+
/** Named connector connection kept outside Flow state. */
|
|
287
|
+
declare class Connection<BoundOperations = Operations> {
|
|
288
|
+
/** Stable provider and connection name. */
|
|
289
|
+
readonly reference: ConnectionRef;
|
|
290
|
+
/** Bound provider operations. */
|
|
291
|
+
readonly operations: BoundOperations;
|
|
292
|
+
/** Validate a reference and bind operations. */
|
|
293
|
+
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
294
|
+
}
|
|
295
|
+
/** Bind a client to a named connection. */
|
|
296
|
+
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
297
|
+
/** Bind scripted operations to a named connection. */
|
|
298
|
+
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
299
|
+
|
|
300
|
+
export { type AvailablePaymentMethod as A, PaymentModificationReceiptSchema as B, Connection as C, PaymentReferenceModificationInputSchema as D, type ExpirePaymentLinkInput as E, decodeCredentials as F, type GetPaymentLinkInput as G, decodeSignedInteger as H, exactIntegerJSONCodec as I, isCredentialMaterialError as J, newConnection as K, type ListPaymentMethodsInput as L, newConnectionWithOperations as M, parseExactIntegerJSON as N, type Operations as O, type PaymentReferenceModificationInput as P, parseJSONNumberTokens as Q, type SignedInteger as S, type PaymentModificationReceipt as a, type PaymentModificationInput as b, type CreatePaymentLinkInput as c, type CreatedPaymentLink as d, type PaymentLinkStatus as e, type PaymentMethodPage as f, type LookupCardBrandsByBINInput as g, type CardBrands as h, type Config as i, type Credentials as j, AvailablePaymentMethodSchema as k, type CardBrand as l, CardBrandSchema as m, CardBrandsSchema as n, ConfigSchema as o, CreatePaymentLinkInputSchema as p, CreatedPaymentLinkSchema as q, CredentialMaterialError as r, type CredentialSource as s, ExpirePaymentLinkInputSchema as t, GetPaymentLinkInputSchema as u, ListPaymentMethodsInputSchema as v, LookupCardBrandsByBINInputSchema as w, PaymentLinkStatusSchema as x, PaymentMethodPageSchema as y, PaymentModificationInputSchema as z };
|