1import{o as t,k as a,m as e,d as i}from"./vendor-CV6ISSGl.js";import{g as n}from"./adyen-2xVWhjfd.js";import{_ as o}from"./index-DSlA2-3H.js";const s={name:"MBWayPayment",data:()=>({checkout:null,mbwayComp:null}),computed:{...i("config",["getDefaultConfig"]),...e("payments",["adyen"]),...e("config",["payButtonWasClicked"]),adyenCoreConfiguration(){return{locale:this.getDefaultConfig("localeId"),environment:this.adyen.environment,clientKey:this.adyen.clientKey,onAdditionalDetails:this.handleOnAdditionalDetails,onError:this.handleOnError}}},watch:{payButtonWasClicked(){this.payButtonWasClicked&&this.validateCard()}},async mounted(){const t=await n(this.adyenCoreConfiguration);this.checkout=t,this.mbwayComp=t.create("mbway",this.getCardFormConfiguration()).mount(this.$refs.mbway),this._on("adyenmbwaycall",this.adyenMBWayCall)},unmounted(){this._off("adyenmbwaycall",this.adyenMBWayCall)},methods:{adyenMBWayCall(t){this.mbwayComp=this.checkout.create("mbway",this.getCardFormConfiguration()).mount(this.$refs.mbway),this.mbwayComp.handleAction(t)},validateCard(){this.mbwayComp.showValidation()},handleOnAdditionalDetails(t){t?.data?.details?.payload?window.location.href=`${this.getDefaultConfig("orderConfirmationUrl")}?mbwayResult=${t.data.details.payload}`:(this.$store.dispatch("notification/updateErrorNotifications",{text:this.i18n("checkoutoverview.payment.failed.title")},{root:!0}),this.$store.dispatch("payments/updateIsPayButtonDisabled",!1),this._emit("disablePaymentMethods",!1))},handleOnError(){this.$store.dispatch("notification/updateErrorNotifications",{text:this.i18n("checkoutoverview.payment.failed.title")},{root:!0})},onChangeHandler(t){this.$store.commit("payments/updateBankCardDetails",{...t.data.paymentMethod}),this.$store.dispatch("payments/updateOtherPaymentSelected",!1),this.$store.dispatch("payments/updateAdyenWebComponentValidated",t.isValid)},getCardFormConfiguration(){return{onChange:this.onChangeHandler}}}},d={ref:"mbway",class:"pv-margin--20 p-ec01-checkout-mbway"};const r=o(s,[["render",function(e,i,n,o,s,r){return t(),a("div",d,null,512)}]]);export{r as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.