Transition Plugin

Try Transition Plugin demo here http://transition-demo.paytomorrow.com/

Checkout the source code here https://bitbucket.org/paytomorrow/transition-plugin/src/master/

NPM Setup

Installation

Via npm:

npm install @paytomorrow/pt-transition

Usage

Import the module:

import {
addTransitionIframe,
openTransitionIframe
} from "@paytomorrow/pt-transition";
addTransitionIframe("your_paytomorrow_public_id");
function onPrimaryFinanceRejection() {
openTransitionIframe();
}

HTML tag setup

Installation

Copy and paste this on your website:

<!-- Paste in body tag -->
<script type="text/javascript" src="https://cdn.paytomorrow.com/plugins/transition-plugin/pt-transition.min.js"></script>

Usage

<script>
ptTransition.addTransitionIframe("your_paytomorrow_public_id");
function onPrimeFinanceRejection() {
ptTransition.openTransitionIframe();
}
// Listen to confirmation and close events.
// When the user clicks on the submit button on the popup, we emit a "pt-confirmation" event.
// When the user clicks on the close button on the popup, we emit a "pt-close" event.
document.addEventListener("pt-confirmation", function () {
createPayTomorrowApplication();
});
document.addEventListener("pt-close", function () {
redirectToCartPage();
});
</script>

PayTomorrow Transition API

Public Methods

addTransitionIframe(publicId: string): void;

Appends PayTomorrow's Transition iframe to the bottom of your page and is hidden by default.

openTransitionIframe(): void;

Displays PayTomorrow's Transition iframe.

Events

"pt-confirmation"

Event triggered when consumer clicks the confirm button in the iframe.

"pt-close"

Event triggered when consumer clicks the close button in the iframe.