@atlas-kitchen/adyen-web
Version:
3 lines (2 loc) • 2.22 kB
JavaScript
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import o from"./components/BlikInput.js";import s from"../internal/Await/Await.js";import{CoreProvider as r}from"../../core/Context/CoreProvider.js";import i from"./config.js";import n from"../internal/RedirectButton/RedirectButton.js";import a from"../../core/Errors/SRPanelProvider.js";import{TxVariants as p}from"../tx-variants.js";class m extends e{formatData(){const t=!!this.props.storedPaymentMethodId;return{paymentMethod:{type:m.type,...!t&&{blikCode:this.state?.data?.blikCode},...t&&{storedPaymentMethodId:this.props.storedPaymentMethodId}}}}get isValid(){return!!this.props.storedPaymentMethodId||!!this.state.isValid}get displayName(){return this.props.storedPaymentMethodId&&this.props.label?this.props.label:this.props.name}get additionalInfo(){return this.props.storedPaymentMethodId&&this.props.label?this.props.name:null}render(){return this.props.paymentData?t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(a,{srPanel:this.props.modules.srPanel},t(s,{ref:t=>{this.componentRef=t},clientKey:this.props.clientKey,paymentData:this.props.paymentData,onError:this.handleError,onComplete:this.onComplete,brandLogo:this.icon,type:i.type,messageText:this.props.i18n.get(i.messageTextId),awaitText:this.props.i18n.get(i.awaitTextId),showCountdownTimer:i.showCountdownTimer,delay:i.STATUS_INTERVAL,countdownTime:i.COUNTDOWN_MINUTES,throttleTime:i.THROTTLE_TIME,throttleInterval:i.THROTTLE_INTERVAL,onActionHandled:this.onActionHandled}))):t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.storedPaymentMethodId?t(n,{showPayButton:this.props.showPayButton,name:this.displayName,amount:this.props.amount,payButton:this.payButton,onSubmit:this.submit,ref:t=>{this.componentRef=t}}):t(o,{ref:t=>{this.componentRef=t},...this.props,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton}))}}var d,h,l;d=m,h="type",l=p.blik,h in d?Object.defineProperty(d,h,{value:l,enumerable:!0,configurable:!0,writable:!0}):d[h]=l;export{m as default};
//# sourceMappingURL=Blik.js.map