UNPKG

@adyen/adyen-web

Version:

[![npm](https://img.shields.io/npm/v/@adyen/adyen-web.svg)](https://www.npmjs.com/package/@adyen/adyen-web)

3 lines (2 loc) 1.8 kB
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import{CoreProvider as s}from"../../core/Context/CoreProvider.js";import r from"../internal/RedirectButton/RedirectButton.js";import n from"./components/BankTransferResult/BankTransferResult.js";import a from"./components/BankTransferInput/BankTransferInput.js";import{TxVariants as o}from"../tx-variants.js";function i(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class p extends e{get isValid(){return!!this.state.isValid}formatData(){const{shopperEmail:t}=this.state.data,e=this.type!==o.bankTransfer_IBAN?{subtype:"embedded"}:{};return{paymentMethod:{type:this.type,...e},...t&&{shopperEmail:t}}}render(){return this.props.reference?t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{...this.props,onActionHandled:this.onActionHandled})):t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.showEmailAddress&&t(a,{setComponentRef:this.setComponentRef,...this.props,onChange:this.setState}),t(r,{...this.props,showPayButton:this.props.showPayButton,name:this.displayName,onSubmit:this.submit,payButton:this.payButton}))}constructor(...t){super(...t),i(this,"state",{isValid:!this.props.showEmailAddress,data:{}})}}i(p,"type",o.bankTransfer_IBAN),i(p,"txVariants",[o.bankTransfer_IBAN,o.bankTransfer_BE,o.bankTransfer_NL,o.bankTransfer_PL,o.bankTransfer_FR,o.bankTransfer_CH,o.bankTransfer_IE,o.bankTransfer_GB,o.bankTransfer_DE]),i(p,"defaultProps",{showEmailAddress:!0,showContextualElement:!0,data:{shopperEmail:""}});export{p as BankTransferElement,p as default}; //# sourceMappingURL=BankTransfer.js.map