@square/web-payments-sdk-types
Version:
Types for Square's Web Payments SDK
55 lines (54 loc) • 2.35 kB
TypeScript
/**
* Occurs when a developer sets up an onTokenize callback and then tries to use tokenize.
*/
import type { ApplicationError } from './types';
import { SqError } from './types';
declare class AfterpayOnTokenizeListenerError extends SqError {
constructor();
}
/**
* Exception thrown when a method was called on a payment method before a needed listener was added
*/
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.
*/
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.
*/
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.
*/
declare class AfterpayUnsupportedCurrencyError extends SqError {
constructor();
}
/**
* Exception thrown when Afterpay/Clearpay is not enabled for a merchant.
* This exception will be thrown on initialization.
*/
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.
*/
declare class AfterpayInvalidPaymentRequestError extends SqError {
constructor(message: string);
}
export { AfterpayAmountOutsideLimitsError, AfterpayInvalidPaymentRequestError, AfterpayMerchantError, AfterpayRequestError, AfterpayUnsupportedCurrencyError, AfterpayOnTokenizeListenerError, PaymentMethodMissingListener, };