@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 1.84 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{Await as s}from"../internal/Await/Await.js";import n from"./config.js";import i from"../internal/RedirectButton/RedirectButton.js";import{TxVariants as r}from"../tx-variants.js";class a extends e{formatData(){const t=!!this.props.storedPaymentMethodId;return{paymentMethod:{type:a.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}componentToRender(){return this.props.paymentData?t(s,{clientKey:this.props.clientKey,paymentData:this.props.paymentData,onError:this.handleError,onComplete:this.onComplete,brandLogo:this.icon,type:n.type,messageText:this.props.i18n.get(n.messageTextId),awaitText:this.props.i18n.get(n.awaitTextId),showCountdownTimer:n.showCountdownTimer,delay:n.STATUS_INTERVAL,countdownTime:n.COUNTDOWN_MINUTES,throttleTime:n.THROTTLE_TIME,throttleInterval:n.THROTTLE_INTERVAL,onActionHandled:this.onActionHandled}):this.props.storedPaymentMethodId?t(i,{showPayButton:this.props.showPayButton,name:this.displayName,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 p,m,d;p=a,m="type",d=r.blik,m in p?Object.defineProperty(p,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):p[m]=d;export{a as default};
//# sourceMappingURL=Blik.js.map