@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 1.45 kB
JavaScript
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/DragonpayInput/DragonpayInput.js";import o from"./components/DragonpayVoucherResult/DragonpayVoucherResult.js";import{CoreProvider as s}from"../../core/Context/CoreProvider.js";import{TxVariants as n}from"../tx-variants.js";function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class a extends e{get isValid(){return!!this.state.isValid}formatData(){const{issuer:t,shopperEmail:e}=this.state.data;return{...e&&{shopperEmail:e},paymentMethod:{...t&&{issuer:t},type:this.type}}}formatProps(t){return{...t,issuers:t.details?.find((t=>"issuer"===t.key))?.items??t.issuers}}render(){return t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.reference?t(o,{ref:t=>{this.componentRef=t},icon:this.icon,...this.props,onActionHandled:this.onActionHandled}):t(r,{ref:t=>{this.componentRef=t},items:this.props.issuers,...this.props,showPayButton:this.props.showPayButton,onChange:this.setState,onSubmit:this.submit,payButton:this.payButton}))}}i(a,"type",n.dragonpay),i(a,"txVariants",[n.dragonpay,n.dragonpay_ebanking,n.dragonpay_otc_banking,n.dragonpay_otc_non_banking,n.dragonpay_otc_philippines]);export{a as DragonpayElement,a as default};
//# sourceMappingURL=Dragonpay.js.map