UNPKG

@stripe/ui-extension-sdk

Version:

The suite of functionality available to UI extensions in Stripe apps

31 lines (30 loc) 1.44 kB
/** * This module provides a HttpClient that can be plugged into stripe-node * that will allow the user to use stripe-node in extensions if the Dashboard * provides a `stripeApiFetch` function that will relay API calls through the * Dashboard and piggy back on the user's Dashboard session. */ import type Stripe from 'stripe'; import type { SerializableResponse, StripeApiFetch } from './apiFetch'; declare class StripeAppsHttpResponse implements Stripe.HttpClientResponse { _resp: SerializableResponse; constructor(resp: SerializableResponse); getHeaders(): { [key: string]: string; }; getStatusCode(): number; getRawResponse(): SerializableResponse; toStream(): void; toJSON(): Promise<Object>; } export declare class StripeAppsHttpClient implements Stripe.HttpClient { _fetch: StripeApiFetch; constructor(fetch: StripeApiFetch); getClientName(): string; makeRequest(host: string, port: string | number, path: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', headers?: object, requestData?: string | null, protocol?: 'http' | 'https', timeout?: number): Promise<StripeAppsHttpResponse>; } export declare const STRIPE_API_KEY = "DO_NOT_PASS_A_REAL_API_KEY"; export declare const createHttpClient: () => StripeAppsHttpClient; export declare const AUTHORIZATION_HEADER = "Authorization"; export declare const AUTHORIZATION_VALUE = "Bearer DO_NOT_PASS_A_REAL_API_KEY"; export {};