Skip to content

[v0.19.0] update types for release #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stripe/terminal-js",
"version": "0.14.0",
"version": "0.19.0",
"description": "Stripe Terminal loading utility",
"main": "dist/terminal.js",
"module": "dist/terminal.esm.js",
Expand Down
23 changes: 20 additions & 3 deletions types/terminal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export enum OutputLogLevel {
VERBOSE = 'verbose',
}

export enum AllowRedisplay {
ALWAYS = 'always',
LIMITED = 'limited',
UNSPECIFIED = 'unspecified',
}

export declare type ConnectionToken = string;
export declare type FetchConnectionTokenFn = () => Promise<ConnectionToken>;

Expand Down Expand Up @@ -112,6 +118,10 @@ export interface ICollectConfig {

// Request ability to offer dynamic currency conversion (DCC) if the card is eligible.
request_dynamic_currency_conversion?: boolean | null;

// Required if `setup_future_usage` is set; otherwise, it defaults to `unspecified`.
// An enum value indicating whether future checkout flows can show this payment method to its customer.
allow_redisplay?: AllowRedisplay | null;
}

// Contains per-transaction configuration information relevant to collecting tips
Expand All @@ -127,6 +137,12 @@ export interface IProcessConfig {
amount_surcharge?: number | null;
}

// Contains configuration information relevant to collecting a setup intent.
export interface ISetupIntentConfig {
// Whether to show a cancel button in transaction UI on Stripe smart readers.
enable_customer_cancellation?: boolean | null;
}

export declare type ConnectOptions = Pick<
IActivateTerminalRequest,
'fail_if_in_use'
Expand Down Expand Up @@ -450,12 +466,13 @@ export class Terminal {
* Requests the Terminal object to collect a card source from the reader that
* can be saved via a SetupIntent.
* @param clientSecret Request object containing the setup intent secret of the intent to attach The
* @param customerConsentCollected boolean indicating whether or not customer consent to save their card was collected
* source to.
* @param customerConsentCollectedOrAllowRedisplay field indicating whether this payment method can be shown again to its customer in a checkout flow.
* @param config an optional object containing collection configuration.
*/
collectSetupIntentPaymentMethod(
clientSecret: string,
customerConsentCollected: boolean
customerConsentCollectedOrAllowRedisplay: boolean | AllowRedisplay,
config: ISetupIntentConfig | null
): Promise<ErrorResponse | {setupIntent: ISetupIntent}>;

/**
Expand Down