@square/web-payments-sdk-types
Version:
Types for Square's Web Payments SDK
60 lines (59 loc) • 2.32 kB
TypeScript
import type { ApplicationError } from './types';
import { SqError } from './types';
/**
* Occurs when a developer sets up an onTokenize callback and then tries to use tokenize.
*/
export declare class AfterpayOnTokenizeListenerError extends SqError {
constructor();
}
/**
* Exception thrown when a method was called on a payment method before a needed listener was added
*/
export declare class PaymentMethodMissingListener extends SqError {
constructor(paymentMethod: string, missingMethod: string);
}
/**
* Exception thrown when the PaymentRequest used with Afterpay/Clearpay causes a failure during
* initialization of the payment method, or tokenization of the payment method.
*/
export declare class AfterpayRequestError extends SqError {
readonly errors: ApplicationError[];
constructor(errors?: ApplicationError[]);
}
/**
* Exception thrown when the total amount is greater than, or less than, the allowed Afterpay/Clearpay transaction limits.
* This exception will be thrown on initialization of the Afterpay/Clearpay payment method and on tokenization
* if the total amount for the PaymentRequest was updated.
*
* Deprecated in favor of AfterpayRequestError.
*/
export declare class AfterpayAmountOutsideLimitsError extends SqError {
constructor();
}
/**
* Exception thrown when the currency provided is not supported for use by Afterpay/Clearpay.
* This exception will be thrown on initialization of the Afterpay/Clearpay payment method and on tokenization
* if the currency for the PaymentRequest was updated.
*
* Deprecated in favor of AfterpayRequestError.
*/
export declare class AfterpayUnsupportedCurrencyError extends SqError {
constructor();
}
/**
* Exception thrown when Afterpay/Clearpay is not enabled for a merchant.
* This exception will be thrown on initialization.
*
* Deprecated in favor of AfterpayRequestError.
*/
export declare class AfterpayMerchantError extends SqError {
constructor();
}
/**
* Exception thrown when a Payment Request is invalid for Afterpay/Clearpay specifically.
* These are cases where a field/value combination is expected for Afterpay/Clearpay which would not be required for
* other payment methods.
*/
export declare class AfterpayInvalidPaymentRequestError extends SqError {
constructor(message: string);
}