Пример всплывающего виджета
Как выглядит виджет:
Код:
<input type="button" value="Оплатить" onclick="makePayment()">
<script type="text/javascript">
function makePayment() {
var WidgetRequestData = {
"LMI_MERCHANT_ID":"1412",
"LMI_PAYMENT_NO":"o-2193987",
"LMI_PAYMENT_AMOUNT":"10.99",
"LMI_PAYMENT_DESC":"Order description"
};
PMWidget
.init({
mode: 'popup',
params: WidgetRequestData,
closeOnFail: true
})
.on('ready', function() {
console.log('READY');
})
.on('success', function() {
if('undefined' !== typeof WidgetRequestData.LMI_SUCCESS_URL) {
window.location = WidgetRequestData.LMI_SUCCESS_URL;
}
})
.on('fail', function(params) {
console.log('FAIL ' + params.message);
})
.on('close', function() {
console.log('CLOSE');
})
.on('error', function() {
console.log('ERROR');
})
;
};
</script>
<script type="text/javascript" src="https://lmi.paysoft.solutions/js/widget/initScript.js" async></script>