IPP Europe

Pay.JS – Payment Hooks

You are here:

Listen to payment notifications

Enabling the Payment Hook js-notifications gives you the instant and optimal feedback as the consumer is going through the Payment process.

js-notifications requires a local function called PaymentListener to send the feedback back to you.

When the payment hook is added and the function is in place, you are ready to activate the PaymentStatus feedback.

This is done with the function BackToBackActivatePaymentstatus and registering the status field.

				
					var payment_hooks = {
    'js-notifications' : '1'
};
function PaymentListener(status) {
    console.log(status);
}
BackToBackActivatePaymentStatus();
BackToBackPaymentListener.register('status',BackToBackPaymentStatus);
				
			

The full Payment Window sample will be as following

				
					<script>var payment_settings={"payw_failed_payment":"Payment Failed. Try again.","payw_cardholder":"Local Card holder text","payw_cardno":"Local Card number text","payw_expmonth":"Local expiry month","payw_expyear":"Local expiry year","payw_cvv":"Local CVV button text","payw_confirmPayment":"Local Confirm Payment Text","payw_confirmPayment_btn":"Local Confirm Payment Button Text","waiting_icon":"https://icon-library.com/images/waiting-icon-png/waiting-icon-png-19.jpg",};</script> <script src=https://pay.ippeurope.com/payment_status.js></script> <script src='https://pay.ippeurope.com/pay.js?checkoutId={data_url}&cryptogram={cryptogram}'></script><form action=# class='search-form paymentWidgets' data-brands='VISA MASTER' data-theme=divs></form> <script>var payment_hooks={'js-notifications':'1'};function PaymentListener(status){console.log(status);}
BackToBackActivatePaymentStatus();BackToBackPaymentListener.register('status',BackToBackPaymentStatus);</script>