Skip to content

add new types for upcoming surcharging support #74

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 3 commits into from
Apr 29, 2024
Merged
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
14 changes: 13 additions & 1 deletion types/terminal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export interface ICollectConfig {

// the ID of the payment intent to return back.
payment_intent_id?: string | null;

// Optional notice to display on the payment collection screen to inform the customer of a surcharge.
surcharge_notice?: string | null;
}

// Contains per-transaction configuration information relevant to collecting tips
Expand All @@ -114,6 +117,12 @@ export interface ITippingConfig {
eligible_amount?: number | null;
}

// Contains configuration information relevant to processing/confirming a payment method.
export interface IProcessConfig {
// Surcharge amount to be applied to the payment.
amount_surcharge?: number | null;
}

export declare type ConnectOptions = Pick<
IActivateTerminalRequest,
'fail_if_in_use'
Expand Down Expand Up @@ -239,7 +248,10 @@ export class Terminal {
* @param request Object containing the payment intent to confirm.
*/
processPayment(
request: ISdkManagedPaymentIntent
request: ISdkManagedPaymentIntent,
options?: {
config_override?: IProcessConfig;
}
): Promise<
| ErrorResponse
| {
Expand Down