File "seamless-checkout.min.js.map"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/swedbank-pay-checkout/assets/js/seamless-checkout.min.js.map
File size: 6.05 KB
MIME-type: application/json
Charset: utf-8

{"version":3,"file":"seamless-checkout.min.js","names":["jQuery","$","document","ajaxComplete","event","xhr","settings","url","wc_checkout_params","checkout_url","indexOf","data","responseText","result","JSON","parse","hasOwnProperty","wc_sb_checkout","setJsUrl","js_url","e","window","payment_url","WC_Gateway_Swedbank_Pay_Checkout","init","form","this","form_submit","on","obj","onSubmit","checkPaymentUrl","initPaymentMenu","id","callback","console","log","paymentMenu","payex","hostedView","container","culture","style","paymentMenuStyle","onApplicationConfigured","onPaymentCreated","onPaymentCompleted","self","location","href","redirectUrl","onPaymentCanceled","onPaymentFailed","onError","open","wc_sb_checkout_seamless","extend","ready"],"sources":["seamless-checkout.js"],"sourcesContent":["/* global wc_checkout_params */\njQuery( function( $ ) {\n    'use strict';\n\n    $( document ).ajaxComplete( function ( event, xhr, settings ) {\n        if ( ( settings.url === wc_checkout_params.checkout_url ) || ( settings.url.indexOf( 'wc-ajax=complete_order' ) > -1 ) ) {\n            const data = xhr.responseText;\n\n            // Parse\n            try {\n                const result = JSON.parse( data );\n\n                // Check is response from payment gateway\n                if ( ! result.hasOwnProperty( 'is_swedbank_pay_checkout' ) ) {\n                    return false;\n                }\n\n                // Save js_url value\n                wc_sb_checkout.setJsUrl( result.js_url );\n            } catch ( e ) {\n                return false;\n            }\n        }\n    } );\n\n    /**\n     * Object to handle Swedbank Pay checkout payment forms.\n     */\n    window.wc_sb_checkout = {\n        xhr: false,\n        payment_url: WC_Gateway_Swedbank_Pay_Checkout.payment_url,\n\n        /**\n         * Initialize e handlers and UI state.\n         */\n        init: function (form) {\n            this.form = form;\n            this.form_submit = false;\n\n            $(this.form)\n                // We need to bind directly to the click (and not checkout_place_order_payex_checkout) to avoid popup blockers\n                // especially on mobile devices (like on Chrome for iOS) from blocking payex_checkout(payment_id, {}, 'open'); from opening a tab\n                .on( 'click', '#place_order', { 'obj': window.wc_sb_checkout }, this.onSubmit )\n\n                // WooCommerce lets us return a false on checkout_place_order_{gateway} to keep the form from submitting\n                .on( 'submit checkout_place_order_payex_checkout' );\n\n            this.checkPaymentUrl();\n        },\n\n        /**\n         * Initiate Payment Menu.\n         * Payment Javascript must be loaded.\n         *\n         * @param id\n         * @param callback\n         */\n        initPaymentMenu: function ( id, callback ) {\n            console.log( 'initPaymentMenu' );\n\n            if ( typeof callback === 'undefined' ) {\n                callback = function () {};\n            }\n\n            // Load payment frame\n            this.paymentMenu = window.payex.hostedView.paymentMenu( {\n                container: id,\n                culture: WC_Gateway_Swedbank_Pay_Checkout.culture,\n                style: WC_Gateway_Swedbank_Pay_Checkout.paymentMenuStyle ? JSON.parse( WC_Gateway_Swedbank_Pay_Checkout.paymentMenuStyle ) : null,\n                onApplicationConfigured: function( data ) {\n                    console.log( 'onApplicationConfigured' );\n                    console.log( data );\n                    callback( null );\n                },\n                onPaymentCreated: function () {\n                    console.log( 'onPaymentCreated' );\n                },\n                onPaymentCompleted: function ( data ) {\n                    console.log( 'onPaymentCompleted' );\n                    console.log( data );\n\n                    self.location.href = data.redirectUrl;\n                },\n                onPaymentCanceled: function ( data ) {\n                    console.log( 'onPaymentCanceled' );\n                    console.log( data );\n                },\n                onPaymentFailed: function ( data ) {\n                    console.log( 'onPaymentFailed' );\n                    console.log( data );\n\n                    self.location.href = data.redirectUrl;\n                },\n                onError: function ( data ) {\n                    console.log( data );\n                    callback( data );\n                }\n            } );\n\n            this.paymentMenu.open();\n        },\n    }\n\n    delete window.wc_sb_checkout_seamless.init;\n    $.extend( window.wc_sb_checkout, window.wc_sb_checkout_seamless );\n\n    $(document).ready( function () {\n        wc_sb_checkout.init( $( \"form.checkout, form#order_review, form#add_payment_method\" ) );\n    } );\n});\n"],"mappings":"AACAA,QAAQ,SAAUC,GACd,aAEAA,EAAGC,UAAWC,cAAc,SAAWC,EAAOC,EAAKC,GAC/C,GAAOA,EAAS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