|
| 1 | +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +import { APIResource } from '../core/resource'; |
| 4 | +import { APIPromise } from '../core/api-promise'; |
| 5 | +import { RequestOptions } from '../internal/request-options'; |
| 6 | + |
| 7 | +/** |
| 8 | + * Endpoints for discovering available payment rails, banks, and providers for a given country and currency corridor. |
| 9 | + */ |
| 10 | +export class Discoveries extends APIResource { |
| 11 | + /** |
| 12 | + * Retrieve available payment institution names for a given country and currency. |
| 13 | + * Use this endpoint to look up supported banks and payment providers for a |
| 14 | + * specific corridor. If no country and currency parameter are provided, all |
| 15 | + * payment institutions will be returned |
| 16 | + * |
| 17 | + * The `bankName` field in each result is the value to pass as `bankName` when |
| 18 | + * creating an external account via `POST /customers/external-accounts`. |
| 19 | + */ |
| 20 | + list( |
| 21 | + query: DiscoveryListParams | null | undefined = {}, |
| 22 | + options?: RequestOptions, |
| 23 | + ): APIPromise<DiscoveryListResponse> { |
| 24 | + return this._client.get('/discoveries', { query, ...options }); |
| 25 | + } |
| 26 | +} |
| 27 | + |
| 28 | +export interface DiscoveryListResponse { |
| 29 | + /** |
| 30 | + * List of payment rails matching the filter criteria |
| 31 | + */ |
| 32 | + data?: Array<DiscoveryListResponse.Data>; |
| 33 | +} |
| 34 | + |
| 35 | +export namespace DiscoveryListResponse { |
| 36 | + export interface Data { |
| 37 | + /** |
| 38 | + * Canonical name for this payment rail. Pass this value as `bankName` when |
| 39 | + * creating an external account. |
| 40 | + */ |
| 41 | + bankName: string; |
| 42 | + |
| 43 | + /** |
| 44 | + * ISO 3166-1 alpha-2 country code. |
| 45 | + */ |
| 46 | + country: string; |
| 47 | + |
| 48 | + /** |
| 49 | + * ISO 4217 currency code. |
| 50 | + */ |
| 51 | + currency: string; |
| 52 | + |
| 53 | + /** |
| 54 | + * Human-friendly display name for this payment rail. |
| 55 | + */ |
| 56 | + displayName: string; |
| 57 | + } |
| 58 | +} |
| 59 | + |
| 60 | +export interface DiscoveryListParams { |
| 61 | + /** |
| 62 | + * ISO 3166-1 alpha-2 country code (e.g. PH) |
| 63 | + */ |
| 64 | + country?: string; |
| 65 | + |
| 66 | + /** |
| 67 | + * ISO 4217 currency code (e.g. PHP) |
| 68 | + */ |
| 69 | + currency?: string; |
| 70 | +} |
| 71 | + |
| 72 | +export declare namespace Discoveries { |
| 73 | + export { |
| 74 | + type DiscoveryListResponse as DiscoveryListResponse, |
| 75 | + type DiscoveryListParams as DiscoveryListParams, |
| 76 | + }; |
| 77 | +} |
0 commit comments