;(function() { var d = document; var _p_ew = window._p_ew = { _f : null, _ff : function() { var f; if(d.forms.length == 1) { f = d.forms[0]; } else { f = d.getElementById('paga_epay'); if(!f) { for(i in document.forms) { var af = document.forms[i]; if(af.elements['return_url'] && af.elements['subtotal']) { f = af; break; } } } } return f; }, _ch : function(n, v){ var i = document.createElement('input'); i.type='hidden'; i.name=n; i.value=v; return i; }, _ic : function(){ var h = document.getElementsByTagName('head')[0]; var c = document.createElement('link'); c.type = 'text/css'; c.rel = 'stylesheet'; c.href = 'https://www.mypaga.com/paga-web/epay/../style/pc/ewidget.css'; c.media = 'screen'; h.appendChild(c); }, _s : function(paymentMethod){ var f = document.getElementById('paga_epay'); if(!f){}; f.action='https://www.mypaga.com:443/paga-web/epay/ePay.paga?method='+ paymentMethod; f.method='post'; f.submit(); }, _i: function() { //this._ic(); var f = this._ff(); if(!f) { alert('Could not find epay form on page'); return; } f.id = 'paga_epay'; if(!f.elements['request_locale']) { f.appendChild(this._ch('request_locale','en')); } if(!f.elements['key']) { f.appendChild(this._ch('key','285e7058-2c95-422f-9c9f-eea9fbc090bc')); } //layout var dv = document.createElement('div'); var dv_moreoptions = document.createElement('div'); dv_moreoptions.setAttribute('style','border: 1px solid #aaa; border-radius: 3px; padding: 0 20px;'); var dv_paga = document.createElement('div'); dv_paga.setAttribute('style','text-align: center; margin:10px;'); var b = document.createElement('a'); b.setAttribute('onclick','_p_ew._s("paga");'); b.setAttribute('style','margin: auto; padding: 5px 15px; border: 1px solid #aaa; display: block; background-repeat : no-repeat; width: 75px; height: 40px; border-radius: 5px; cursor: pointer; background: center no-repeat url(https://www.mypaga.com/paga-web/epay/../image/epay/epay_paga.png)'); b.title='Pay with Paga'; dv_paga.appendChild(b); dv_moreoptions.appendChild(dv_paga); var dv_mastercards = document.createElement('div'); dv_mastercards.setAttribute('style','clear: both; text-align: center; margin:10px;'); var b_mastercard = document.createElement('a'); b_mastercard.setAttribute('onclick','_p_ew._s("mastercard");'); b_mastercard.setAttribute('style','margin: auto;padding: 5px 15px; border: 1px solid #aaa;display: block; background-repeat : no-repeat; width: 75px; height: 40px; border-radius: 5px; cursor: pointer; background: center no-repeat url(https://www.mypaga.com/paga-web/epay/../image/epay/mastercard@1x.png)'); b_mastercard.title='Pay with Mastercard'; dv_mastercards.appendChild(b_mastercard); dv_moreoptions.appendChild(dv_mastercards); var dv_visacards = document.createElement('div'); dv_visacards.setAttribute('style','clear: both; text-align: center; margin:10px;'); var b_visa = document.createElement('a'); b_visa.setAttribute('onclick','_p_ew._s("visa");'); b_visa.setAttribute('style','margin: auto;padding: 5px 15px; border: 1px solid #aaa;display: block; background-repeat : no-repeat; width: 75px; height: 40px; border-radius: 5px; cursor: pointer; background: center no-repeat url(https://www.mypaga.com/paga-web/epay/../image/epay/visa@1x.png)'); b_visa.title='Pay with Visa'; dv_visacards.appendChild(b_visa); dv_moreoptions.appendChild(dv_visacards); var dv_vervecards = document.createElement('div'); dv_vervecards.setAttribute('style','clear: both; text-align: center; margin:10px;'); var b_verve = document.createElement('a'); b_verve.setAttribute('onclick','_p_ew._s("verve");'); b_verve.setAttribute('style','margin: auto;padding: 5px 15px; border: 1px solid #aaa;display: block;background-repeat : no-repeat; width: 75px; height: 40px; border-radius: 5px; cursor: pointer; background: center no-repeat url(https://www.mypaga.com/paga-web/epay/../image/epay/verve@1x.png)'); b_verve.title='Pay with Verve'; dv_vervecards.appendChild(b_verve); dv_moreoptions.appendChild(dv_vervecards); dv.appendChild(dv_moreoptions); f.appendChild(dv); } }; _p_ew._i(); })();