Wybierz jedną z poniższych metod płatności.
// check agreements - bylaw
CheckBylawStandard = function(){
jQuery(document).ready(function(){
if(jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length >0){
jQuery("label.dotpay_agreements > input[name=bylaw]:checked").parents('li.payment_method_dotpay').change(function(){
if (jQuery("label.dotpay_agreements > input[name=bylaw]:checked").parents('li.payment_method_dotpay').length > 0) {
console.log('Dotpay: Payment regulations accepted (1)');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({
"background-color": "",
"padding": "",
"border-style": "",
"border-width": "0px",
"border-color": ""
});
if( jQuery('div.channel-container.selected.dp_cloned').length > 0){
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', false);
if(jQuery('div#payment div.form-row button#place_order').length > 0 && jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length > 0){
jQuery('div#payment div.form-row button#place_order').prop('disabled', false);
}
}else{
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', true);
if(jQuery('div#payment div.form-row button#place_order').length > 0){
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
}
}
} else {
console.log('%cDotpay: Select first PayPro S.A. Regulations of Payments!', 'background:red;color:#fff');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({
"background-color": "#ffeeed",
"padding": "3px",
"border-style": "solid",
"border-width": "1px",
"border-color": "#fd0c0c"
});
if (jQuery("button[name='woocommerce_checkout_place_order']").length > 0) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', true);
} else if (jQuery('div#payment div.form-row button#place_order').length > 0) {
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
}
}
});
}
});
}
var dp_empty_channel = '
- Nie wybrano kanału płatności!
Musisz wybrać jeden z dostępnych kanałów płatności aby kontynuować płatność.
';
var dp_channels_choose_info = '
Wybierz jedną z poniższych metod płatności.
';
var dotpayWidgetConfig = {
sellerAccountId: '401898',
amount: '89.00',
currency: 'PLN',
lang: 'pl',
widgetFormContainerClass: 'dotpay-form-widget-container',
offlineChannel: 'mark',
offlineChannelTooltip: true,
channelNameVisibility: '0',
disabledChannels: [73],
host: 'https://dproxy.przelewy24.pl/t2/payment_api/v1/channels/'
};
dotpayWidgetConfig.disabledChannels.push(channel_apple);
// when only 1 channel available, select it automatically
jQueryDotpayWidget1channel = function(){
// if (jQuery('div.dotpay-channels-selection > div.channel-container').length == 1) {
setTimeout(function(){
createCookieDP("dp_channel_selected", "", "-1");
jQuery('div.dotpay-channels-selection > div.channel-container').trigger('click');
jQuery('.channels-wrapper').css('text-align','center');
if (jQuery('.channelSelectTXT').length < 1){
jQuery('
Wybrano: ' + jQuery('div.channel-container.selected> div.image-container > img').attr("title") + '
').insertBefore('div.channel-container.selected').addClass('channelSelectTXT');
}
jQuery('p.SelectChennelInfo').hide();
// jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', false);
if(jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length >0 && jQuery('div#payment div.form-row button#place_order').length > 0){
jQuery('input#dp_agreements_bylaw').prop( "checked", false );
console.log('%cSelect first PayPro S.A. Regulations of Payments 2!','background:red;color:#fff');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({"background-color": "#ffeeed", "padding": "3px", "border-style": "solid", "border-width": "1px", "border-color": "#fd0c0c"});
if(jQuery( "button[name='woocommerce_checkout_place_order']" ).length > 0) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', true);
}else if(jQuery('div#payment div.form-row button#place_order').length > 0) {
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
}
}else{
jQuery('input#dp_agreements_bylaw').prop( "checked", false );
if(jQuery( "button[name='woocommerce_checkout_place_order']" ).length > 0) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', false);
}else if(jQuery('div#payment div.form-row button#place_order').length > 0) {
jQuery('div#payment div.form-row button#place_order').prop('disabled', false);
}
}
jQuery(function($) {
$('input#dp_agreements_bylaw').change(function(){
if($(this).is(":checked")) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', false);
console.log('Payment regulations accepted (3)');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({"background-color": "", "padding": "", "border-style": "", "border-width": "0px", "border-color": ""});
} else {
console.log('%cSelect first PayPro S.A. Regulations of Payments 3!','background:red;color:#fff');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({"background-color": "#ffeeed", "padding": "3px", "border-style": "solid", "border-width": "1px", "border-color": "#fd0c0c"});
if(jQuery( "button[name='woocommerce_checkout_place_order']" ).length > 0) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', true);
}else if(jQuery('div#payment div.form-row button#place_order').length > 0) {
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
}
}
});
});
if(jQuery('div#payment div.form-row button#place_order').length > 0 && jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length > 0 && jQuery('input#dp_agreements_bylaw').is(":checked") == 'true'){
jQuery('div#payment div.form-row button#place_order').prop('disabled', false);
}
if(jQuery('div#payment div.form-row button#place_order').length > 0 &&
jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length > 0 &&
jQuery('input#dp_agreements_bylaw').is(":checked") == 'true'){
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
}
jQuery('#dotpay_empty_channel').remove();
console.log('The only one available channel is selected (channel: '+jQuery('.dp_channel-input').attr("value")+')');
createCookieDP("dp_channel_selected", jQuery('.dp_channel-input').attr("value"), "0.08");
}, 1000);
// }
};
jQueryDotpayWidgetSelectChannel = function(){
if( jQuery('div.channel-container.selected.dp_cloned').length < 1){
if(jQuery("ul.wc_payment_methods input[type=radio]:checked").val() == 'dotpay') {
console.log('loaded main Dotpay payment method: waiting for payment channel selection...');
createCookieDP("dp_channel_selected", "", "-1");
if(jQuery('input#dp_agreements_bylaw').is(":checked")){
console.log('Payment regulations accepted (2)');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({"background-color": "", "padding": "", "border-style": "", "border-width": "0px", "border-color": ""});
}else{
console.log('%cSelect first PayPro S.A. Regulations of Payments 4!','background:red;color:#fff');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({"background-color": "#ffeeed", "padding": "3px", "border-style": "solid", "border-width": "1px", "border-color": "#fd0c0c"});
}
if(jQuery( "button[name='woocommerce_checkout_place_order']" ).length > 0) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', true);
if(jQuery('ul#dotpay_empty_channel').length < 1 ) {
jQuery( "button[name='woocommerce_checkout_place_order']" ).before(dp_empty_channel);
}
}else if(jQuery('div#payment div.form-row button#place_order').length > 0) {
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
if(jQuery('ul#dotpay_empty_channel').length < 1 ) {
jQuery( "button[name='woocommerce_checkout_place_order']" ).before(dp_empty_channel);
}
}
}
jQuery("ul.wc_payment_methods input[type=radio]").on("change", function () {
if (this.checked) {
if (this.value == 'dotpay') {
console.log('%Przelewy24 (Dotpay) main method is checked manually.','background: #cfcfcf; color: green;');
console.log('loaded main Przelewy24 (Dotpay) payment method: waiting for payment channel selection...1');
if(jQuery( "button[name='woocommerce_checkout_place_order']" ).length > 0 ) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', true);
console.log('%cSelect first PayPro S.A. Regulations of Payments !','background:red;color:#fff');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({"background-color": "#ffeeed", "padding": "3px", "border-style": "solid", "border-width": "1px", "border-color": "#fd0c0c"});
if(jQuery('ul#dotpay_empty_channel').length < 1 && jQuery('div.channel-container.selected.dp_cloned').length < 1) {
jQuery( "button[name='woocommerce_checkout_place_order']" ).before(dp_empty_channel);
}
}else if(jQuery('div#payment div.form-row button#place_order').length > 0 ) {
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
if(jQuery('ul#dotpay_empty_channel').length < 1 && jQuery('div.channel-container.selected.dp_cloned').length < 1) {
jQuery( "button[name='woocommerce_checkout_place_order']" ).before(dp_empty_channel);
}
}
if(jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length >0 && jQuery("label.dotpay_agreements > input[name=bylaw]:checked").parents('li.payment_method_dotpay').length > 0 && jQuery('div.channel-container.selected.dp_cloned').length > 0){
if(jQuery( "button[name='woocommerce_checkout_place_order']" ).length > 0 ) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', false);
}
if(jQuery('div#payment div.form-row button#place_order').length > 0 && jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length > 0){
jQuery('div#payment div.form-row button#place_order').prop('disabled', false);
}
}
}
jQuery(function ($) {
$('input#dp_agreements_bylaw').parents('li.payment_method_dotpay').change(function () {
if ($("label.dotpay_agreements > input[name=bylaw]:checked").parents('li.payment_method_dotpay').length > 0 && jQuery('div.channel-container.selected.dp_cloned').length > 0) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', false);
console.log('Payment regulations accepted (4)');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({
"background-color": "",
"padding": "",
"border-style": "",
"border-width": "0px",
"border-color": ""
});
} else {
console.log('%cSelect first PayPro S.A. Regulations of Payments!', 'background:red;color:#fff');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({
"background-color": "#ffeeed",
"padding": "3px",
"border-style": "solid",
"border-width": "1px",
"border-color": "#fd0c0c"
});
if (jQuery("button[name='woocommerce_checkout_place_order']").length > 0) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', true);
} else if (jQuery('div#payment div.form-row button#place_order').length > 0) {
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
}
}
});
});
}
});
}
if(jQuery("ul.wc_payment_methods input[type=radio]:checked").val() == 'dotpay'){
console.log('%cDotpay main method is checked.','background: #cfcfcf; color: green;');
}
setTimeout(function(){
jQuery('input#dp_agreements_bylaw').parents('li.payment_method_dotpay').change(function () {
if (jQuery("label.dotpay_agreements > input[name=bylaw]:checked").parents('li.payment_method_dotpay').length > 0 ) {
console.log('Payment regulations accepted 5');
jQuery('li.payment_method_dotpay').find("label#agreements_bylaw").css({
"background-color": "",
"padding": "",
"border-style": "",
"border-width": "0px",
"border-color": ""
});
}
});
if(jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length >0 && jQuery("label.dotpay_agreements > input[name=bylaw]:checked").parents('li.payment_method_dotpay').length > 0 && jQuery('div.channel-container.selected.dp_cloned').length > 0){
if(jQuery( "button[name='woocommerce_checkout_place_order']" ).length > 0 ) {
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', false);
}
if(jQuery('div#payment div.form-row button#place_order').length > 0 && jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length > 0){
jQuery('div#payment div.form-row button#place_order').prop('disabled', false);
}
}
}, 200);
setTimeout(function(){
jQuery('.channel-container').on('click', function () {
jQuery('.channels-wrapper').css('text-align','center');
jQuery('.selected').clone().insertBefore('.dotpay-channels-selection').addClass('dp_cloned');
jQuery('.dotpay-channels-selection').slideUp('600', 'swing');
jQuery('
Aby wybrać inny kanał płatności kliknij powyższą ikonę kanału
').insertAfter('.dp_cloned').addClass('channelSelect');
if (jQuery('.channelSelectTXT').length < 1){
jQuery('
Wybrano: ' + jQuery('div.channel-container.selected.dp_cloned > div.image-container > img').attr("title") + '
').insertBefore('.dp_cloned').addClass('channelSelectTXT');
}
jQuery('.channelSelect').not(':last').remove();
jQuery('.channelSelectTXT').not(':last').remove();
jQuery('.dp_cloned').not(':last').remove();
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', false);
if(jQuery('div#payment div.form-row button#place_order').length > 0 && jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length > 0 && jQuery("label.dotpay_agreements > input[name=bylaw]:checked").parents('li.payment_method_dotpay').length < 1){
jQuery('div#payment div.form-row button#place_order').prop('disabled', false);
}
console.log('%cselected: ' + jQuery('div.channel-container.selected.dp_cloned > div.image-container > img').attr("title"), 'background: #cfcfcf; color: blue;');
jQuery('#dotpay_empty_channel').remove();
if(jQuery('li.payment_method_dotpay > input#payment_method_dotpay:checked').length >0 && jQuery("label.dotpay_agreements > input[name=bylaw]:checked").parents('li.payment_method_dotpay').length < 1){
console.log('%cSelect first PayPro S.A. Regulations of Payments 6!','background:red;color:#fff');
jQuery("button[name='woocommerce_checkout_place_order']").prop('disabled', true);
if(jQuery('div#payment div.form-row button#place_order').length > 0 ){
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
}
}
CheckBylawStandard();
createCookieDP("dp_channel_selected", jQuery('.dp_channel-input').attr("value"), "0.08");
if (jQuery('p.SelectChennelInfo').length > 0) {
jQuery('p.SelectChennelInfo').hide();
}else{
createCookieDP("dp_channel_selected", "", "-1");
}
});
}, 1200);
setTimeout(function() {
jQuery('.dotpay-channels').on('click', '.dp_cloned', function(){
jQuery('.dotpay-channels-selection').slideDown('600','swing');
jQuery('.dp_cloned').toggle().remove();
jQuery('.selected').removeClass('selected');
jQuery('.channelSelect').remove();
jQuery('.channelSelectTXT').remove();
jQuery('html, body').animate({scrollTop: (jQuery('.payment_method_dotpay').offset().top -100)}, 'fast');
jQuery('.channels-wrapper').css('text-align','left');
if( jQuery('div.channel-container.selected.dp_cloned').length < 1){
console.log('... waiting for payment channel selection');
createCookieDP("dp_channel_selected", "", "-1");
jQuery( "button[name='woocommerce_checkout_place_order']" ).prop('disabled', true);
if(jQuery('div#payment div.form-row button#place_order').length > 0){
jQuery('div#payment div.form-row button#place_order').prop('disabled', true);
}
if (jQuery('div.dotpay-channels-selection > div.channel-container').length > 1) {
jQuery('p.SelectChennelInfo').show();
createCookieDP("dp_channel_selected", "", "-1");
}
if(jQuery( "button[name='woocommerce_checkout_place_order']" ).length > 0) {
if(jQuery('ul#dotpay_empty_channel').length < 1 ) {
jQuery( "button[name='woocommerce_checkout_place_order']" ).before(dp_empty_channel);
createCookieDP("dp_channel_selected", "", "-1");
}
}else if(jQuery('div#payment div.form-row button#place_order').length > 0) {
if(jQuery('ul#dotpay_empty_channel').length < 1 ) {
jQuery( "button[name='woocommerce_checkout_place_order']" ).before(dp_empty_channel);
createCookieDP("dp_channel_selected", "", "-1");
}
}
}
});
}, 1200);
};