@stripe/terminal-js
Advanced tools
Comparing version 0.13.0 to 0.18.0
@@ -5,5 +5,5 @@ 'use strict'; | ||
// `"0.12.0"` will be rewritten by `@rollup/plugin-replace` as a string literal | ||
// `"0.14.0"` will be rewritten by `@rollup/plugin-replace` as a string literal | ||
// containing the package.json version | ||
// declare const "0.12.0": string; | ||
// declare const "0.14.0": string; | ||
var V1_URL = 'https://js.stripe.com/terminal/v1'; | ||
@@ -28,3 +28,3 @@ | ||
// | ||
// stripe._registerWrapper({name: 'terminal-js', version: "0.12.0"}); | ||
// stripe._registerWrapper({name: 'terminal-js', version: "0.14.0"}); | ||
// }; | ||
@@ -31,0 +31,0 @@ |
@@ -1,4 +0,4 @@ | ||
// `"0.12.0"` will be rewritten by `@rollup/plugin-replace` as a string literal | ||
// `"0.14.0"` will be rewritten by `@rollup/plugin-replace` as a string literal | ||
// containing the package.json version | ||
// declare const "0.12.0": string; | ||
// declare const "0.14.0": string; | ||
var V1_URL = 'https://js.stripe.com/terminal/v1'; | ||
@@ -23,3 +23,3 @@ | ||
// | ||
// stripe._registerWrapper({name: 'terminal-js', version: "0.12.0"}); | ||
// stripe._registerWrapper({name: 'terminal-js', version: "0.14.0"}); | ||
// }; | ||
@@ -26,0 +26,0 @@ |
@@ -5,5 +5,5 @@ 'use strict'; | ||
// `"0.12.0"` will be rewritten by `@rollup/plugin-replace` as a string literal | ||
// `"0.14.0"` will be rewritten by `@rollup/plugin-replace` as a string literal | ||
// containing the package.json version | ||
// declare const "0.12.0": string; | ||
// declare const "0.14.0": string; | ||
var V1_URL = 'https://js.stripe.com/terminal/v1'; | ||
@@ -28,3 +28,3 @@ | ||
// | ||
// stripe._registerWrapper({name: 'terminal-js', version: "0.12.0"}); | ||
// stripe._registerWrapper({name: 'terminal-js', version: "0.14.0"}); | ||
// }; | ||
@@ -31,0 +31,0 @@ |
{ | ||
"name": "@stripe/terminal-js", | ||
"version": "0.13.0", | ||
"version": "0.18.0", | ||
"description": "Stripe Terminal loading utility", | ||
@@ -64,4 +64,4 @@ "main": "dist/terminal.js", | ||
"stripe": "^8.184.0", | ||
"ws": "6.2.2" | ||
"ws": "6.2.3" | ||
} | ||
} |
@@ -311,2 +311,5 @@ /** Properties of a RequestedCardPresent. */ | ||
interac_present?: ICardPresent | null; | ||
/** PaymentMethodDetails wechat_pay */ | ||
wechat_pay?: IWechatPay | null; | ||
} | ||
@@ -478,3 +481,19 @@ /** Properties of a Refund. */ | ||
authorization_code?: string | null; | ||
/** CardPresent location */ | ||
location?: string | null; | ||
} | ||
interface IWechatPay { | ||
/** WechatPay reader */ | ||
reader?: string | null; | ||
/** WechatPay location */ | ||
location?: string | null; | ||
/** WeChat Pay transactionId */ | ||
transactionId?: string | null; | ||
} | ||
/** Properties of a Source. */ | ||
@@ -542,2 +561,5 @@ export interface ISource { | ||
payment_method?: string | null; | ||
/** PaymentMethod types supported on the payment intent */ | ||
payment_method_types?: (string[]|null); | ||
} | ||
@@ -840,1 +862,19 @@ | ||
"automatic"| "manual"; | ||
type ITextToSpeechStatus = 'off' | 'headphones' | 'speakers'; | ||
export interface IAccessibilitySettings { | ||
textToSpeechStatus: ITextToSpeechStatus; | ||
} | ||
export interface IReaderSettings { | ||
accessibilitySettings: IAccessibilitySettings | IErrorResponse; | ||
} | ||
export interface IAccessibilityParameters { | ||
enableTextToSpeechSpeakers: boolean; | ||
} | ||
export interface ISetReaderSettingsRequest { | ||
accessibility_parameters?: null | IAccessibilityParameters; | ||
} |
@@ -14,2 +14,3 @@ /* eslint-disable no-unused-vars */ | ||
IPaymentIntentExpandedMethod, | ||
IReaderSettings, ISetReaderSettingsRequest, | ||
} from './proto'; | ||
@@ -112,2 +113,5 @@ | ||
surcharge_notice?: string | null; | ||
// Request ability to offer dynamic currency conversion (DCC) if the card is eligible. | ||
request_dynamic_currency_conversion?: boolean | null; | ||
} | ||
@@ -177,2 +181,165 @@ | ||
// Contains information about the inputs to collect from the reader | ||
export interface ICollectInputsParameters { | ||
inputs: Array<IInput>; | ||
} | ||
export enum FormType { | ||
SELECTION = 'selection', | ||
SIGNATURE = 'signature', | ||
PHONE = 'phone', | ||
EMAIL = 'email', | ||
NUMERIC = 'numeric', | ||
TEXT = 'text', | ||
} | ||
// Represents a single input form | ||
export interface IInput { | ||
// Set the type of the form | ||
formType: FormType; | ||
// Set whether this form is required | ||
required?: boolean | null; | ||
// Set the title of the form | ||
title: string; | ||
// Set the description of the form | ||
description?: string | null; | ||
// Set the toggles to display on the form | ||
toggles?: IToggle[] | null; | ||
// Modify the skip button text | ||
skipButtonText?: string | null; | ||
} | ||
// Represents the toggle state | ||
export enum ToggleValue { | ||
// Toggle is checked or on | ||
ENABLED = 'enabled', | ||
// Toggle is unchecked or off | ||
DISABLED = 'disabled', | ||
} | ||
// Contains information for a collect inputs toggle | ||
export interface IToggle { | ||
// Set the main, larger style text. | ||
title?: string | null; | ||
// Set the secondary, smaller style text. | ||
description?: string | null; | ||
// Set the initial value to be set for the toggle. | ||
defaultValue: ToggleValue; | ||
} | ||
// Represents the style of a selection form button | ||
export enum SelectionButtonStyle { | ||
// Button will use a highlighted, accent color | ||
PRIMARY = 'primary', | ||
// Button will use a subdued, secondary color | ||
SECONDARY = 'secondary', | ||
} | ||
// Contains information for a selection form button | ||
export interface ISelectionButton { | ||
// Set the style of a selection button | ||
style: SelectionButtonStyle; | ||
// Set the button text | ||
text: string; | ||
} | ||
// Contains information about a selection form to display on the reader | ||
export interface SelectionInput extends IInput { | ||
// Set the button choices to display on the form | ||
selectionButtons: ISelectionButton[]; | ||
} | ||
// Contains information about a signature form to display on the reader | ||
export interface SignatureInput extends IInput { | ||
// Modify the submit button text | ||
submitButtonText?: string | null; | ||
} | ||
// Contains information about a phone form to display on the reader | ||
export interface PhoneInput extends IInput { | ||
// Modify the submit button text | ||
submitButtonText?: string | null; | ||
} | ||
// Contains information about an email form to display on the reader | ||
export interface EmailInput extends IInput { | ||
// Modify the submit button text | ||
submitButtonText?: string | null; | ||
} | ||
// Contains information about a text form to display on the reader | ||
export interface TextInput extends IInput { | ||
// Modify the submit button text | ||
submitButtonText?: string | null; | ||
} | ||
// Contains information about a numeric form to display on the reader | ||
export interface NumericInput extends IInput { | ||
// Modify the submit button text | ||
submitButtonText?: string | null; | ||
} | ||
// Contains data collected for a toggle | ||
export enum ToggleResult { | ||
// Toggle is unchecked or off | ||
DISABLED = 'disabled', | ||
// Toggle is checked or on | ||
ENABLED = 'enabled', | ||
// Input form is skipped, no value | ||
SKIPPED = 'skipped', | ||
} | ||
// Contains the common fields for all input result types | ||
export interface ICollectInputsResult { | ||
// the type of the form | ||
formType: FormType; | ||
// if true, the skip button was pressed to skip the form. | ||
skipped: boolean; | ||
// array of toggles and selected value. Values are `ToggleResult.SKIPPED` if form was skipped. | ||
toggles: ToggleResult[]; | ||
} | ||
// Contains data collected from a selection form | ||
export interface SelectionResult extends ICollectInputsResult { | ||
// selected button. Null if the form was skipped. | ||
selection?: string | null; | ||
} | ||
// Contains data collected from a signature form | ||
export interface SignatureResult extends ICollectInputsResult { | ||
// signature in svg format. Null if the form was skipped. | ||
signatureSvg?: string | null; | ||
} | ||
// Contains data collected from a phone form | ||
export interface PhoneResult extends ICollectInputsResult { | ||
// the submitted phone number in E.164 format. Null if the form was skipped. | ||
phone?: string | null; | ||
} | ||
// Contains data collected from an email form | ||
export interface EmailResult extends ICollectInputsResult { | ||
// the submitted email. Null if the form was skipped. | ||
email?: string | null; | ||
} | ||
// Contains data collected from a text form | ||
export interface TextResult extends ICollectInputsResult { | ||
// the submitted text. Null if the form was skipped. | ||
text?: string | null; | ||
} | ||
// Contains data collected from an email form | ||
export interface NumericResult extends ICollectInputsResult { | ||
// the submitted number as a string. Null if the form was skipped. | ||
numericString?: string | null; | ||
} | ||
export class Terminal { | ||
@@ -232,2 +399,13 @@ /** | ||
/** | ||
* Display forms and collect information from customers. Available for BBPOS WisePOS E and Stripe S700. | ||
* @param collectInputsParameters Parameters to configure forms | ||
*/ | ||
collectInputs( | ||
collectInputsParameters: ICollectInputsParameters | ||
): Promise<ErrorResponse | Array<ICollectInputsResult>>; | ||
/** | ||
* Cancels an in-flight request made by collectInputs | ||
*/ | ||
cancelCollectInputs(): Promise<ErrorResponse | ICancelResponse>; | ||
/** | ||
* Requests the Terminal object to collect a card source from the reader that | ||
@@ -322,2 +500,14 @@ * can be charged. | ||
overrideBaseURL(url: string): void; | ||
/** | ||
* Changes settings on the connected reader. | ||
* | ||
* @param request The request with the values to set on the reader. | ||
*/ | ||
setReaderSettings(request: ISetReaderSettingsRequest): Promise<IReaderSettings>; | ||
/** | ||
* Retrieves current settings from the connected reader. | ||
*/ | ||
getReaderSettings(): Promise<IReaderSettings>; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64666
1528
1