Additional Checkout Functions

This section details the additional functions available in the Paysafe Checkout SDK, along with associated errors.

Is Open

Returns the closure state of the payment overlay. The function signature is as follows:

Parameter Required Type Description
{return} true boolean

true if the overlay has not been closed yet.

false if the overlay has been closed.

Example usage:

...
instance.isOpen();
...

Close

Closes the payment overlay.

Example Usage:

...
instance.close();
...

Show Success Screen

Displays a payment success page within the overlay iframe with a configurable message of up to 200 characters.

You must ensure that you have checked that tokenization has been successful (result.token is not null) before using this function.

Example usage:

...
instance.showSuccessScreen("Your goods are purchased");
...

Show Failure Screen

Displays a payment failed page within the overlay iframe with a configurable message of up to 200 characters.

Example usage:

...
instance.showFailureScreen("Payment was declined. Try again with the same or another payment method.");
...

Errors

Directly Thrown From Instance Is Open Function

Code

Display Message Detailed Message Description
9012 There was an error (9012), please contact our support. Invalid number of arguments. Used when isOpen is invoked with the wrong number of arguments.

Directly Thrown From Instance Close Function

Code Display Message Detailed Message Description
9012 There was an error (9012), please contact our support. Invalid number of arguments. Used when close is invoked with the wrong number of arguments.

Directly Thrown From Instance Show Success Screen Function

Code Display Message Detailed Message Description
9012 There was an error (9012), please contact our support. Invalid number of arguments. Used when show success is invoked with more than 1 argument.
9056 There was an error (9056), please contact our support Details should be string no longer than 200 characters. Used when the supplied message is not a string or is longer than 200 characters.

Directly Thrown From Instance Show Failure Screen Function

Code Display Message Detailed Message Description
9012 There was an error (9012), please contact our support. Invalid number of arguments. Used when show failure screen is invoked with more than 1 argument.
9056 There was an error (9056), please contact our support Details should be string no longer than 200 characters. Used when the supplied message is not a string or is longer than 200 characters.
Did you find this page useful?