diff --git a/assets/js/checkout.js b/assets/js/checkout.js index 816031ad7..00aa49e64 100644 --- a/assets/js/checkout.js +++ b/assets/js/checkout.js @@ -79,6 +79,12 @@ jQuery(function($) { } const configuration = $.parseJSON( configurationElement.dataset.configuration ); + + if ( 'string' === typeof configuration.url && 0 === configuration.url.indexOf( 'https://' ) ) { + window.location.href = configuration.url; + return false; + } + const stripe = Stripe( configuration.key, { stripeAccount: configuration.accountId } ); stripe.redirectToCheckout({ diff --git a/assets/js/checkout.min.js b/assets/js/checkout.min.js index 1446b7f6d..b0b2a830d 100644 --- a/assets/js/checkout.min.js +++ b/assets/js/checkout.min.js @@ -1 +1 @@ -jQuery(function($){({init:function(){var self,$form=$("form#wpbdp-checkout-form");0!=$form.length&&((self=this).$form=$form,this.$container=this.$form.find("#wpbdp-checkout-form-fields"),this.payment_key=this.$form.find('input[name="payment"]').val(),this.nonce=this.$form.find('input[name="_wpnonce"]').val(),this.working=!1,this.$form.find('input[name="gateway"]').change(function(){var gateway;self.working||(gateway=self.$form.find('input[name="gateway"]:checked').val())&&self.load_gateway(gateway)}),this.$form.find('input[name="gateway"]').trigger("change"))},load_gateway:function(gateway_id){var self=this,url=(self.$container.html(""),self.working=!0,wpbdp_global.ajaxurl),url=(url+=0"),mywindow.document.write($("head").html()),mywindow.document.write(""),mywindow.document.write($(e).wrap("

").parent().html()),mywindow.document.write(""),mywindow.document.close(),mywindow.focus(),mywindow.onload=function(){mywindow.print(),mywindow.close()}})}); \ No newline at end of file +jQuery(function($){({init:function(){var self,$form=$("form#wpbdp-checkout-form");0!=$form.length&&((self=this).$form=$form,this.$container=this.$form.find("#wpbdp-checkout-form-fields"),this.payment_key=this.$form.find('input[name="payment"]').val(),this.nonce=this.$form.find('input[name="_wpnonce"]').val(),this.working=!1,this.$form.find('input[name="gateway"]').change(function(){var gateway;self.working||(gateway=self.$form.find('input[name="gateway"]:checked').val())&&self.load_gateway(gateway)}),this.$form.find('input[name="gateway"]').trigger("change"))},load_gateway:function(gateway_id){var self=this,url=(self.$container.html(""),self.working=!0,wpbdp_global.ajaxurl),url=(url+=0"),mywindow.document.write($("head").html()),mywindow.document.write(""),mywindow.document.write($(e).wrap("

").parent().html()),mywindow.document.write(""),mywindow.document.close(),mywindow.focus(),mywindow.onload=function(){mywindow.print(),mywindow.close()}})}); \ No newline at end of file diff --git a/includes/gateways/class-stripe-gateway.php b/includes/gateways/class-stripe-gateway.php index 07ad99d29..abd373db8 100644 --- a/includes/gateways/class-stripe-gateway.php +++ b/includes/gateways/class-stripe-gateway.php @@ -213,6 +213,7 @@ private function configure_stripe( $payment ) { } $stripe['sessionId'] = $session->id; + $stripe['url'] = esc_url_raw( $session->url ?? '', array( 'https' ) ); return $stripe; }