@paytomorrow/pt-transition-plugin
v1.0.0
Published
PayTomorrow Financing Transition Plugin
Downloads
3
Readme
PayTomorrow Transition Plugin
Try MPE demo here http://transition-demo.paytomorrow.com
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();
}
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.