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) 2.15 kB
import{createElement as t,Fragment as e}from"../../external/preact/dist/preact.js";import{UIElement as o}from"../internal/UIElement/UIElement.js";import{TxVariants as s}from"../tx-variants.js";import a from"./components/PreAuthorizedDebitCanadaComponent.js";import{SettlementInfo as n}from"./components/SettlementInfo.js";import r from"../internal/RedirectButton/RedirectButton.js";import{payAmountLabel as i}from"../internal/PayButton/utils.js";class p extends o{formatData(){return!!this.props.storedPaymentMethodId?{paymentMethod:{type:p.type,storedPaymentMethodId:this.props.storedPaymentMethodId}}:{paymentMethod:{type:p.type,ownerName:this.state.data.ownerName,bankAccountNumber:this.state.data.bankAccountNumber,bankCode:this.state.data.bankCode,bankLocationId:this.state.data.bankLocationId},...this.state.storePaymentMethod&&{storePaymentMethod:this.state.storePaymentMethod}}}formatProps(t){return{enableStoreDetails:t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,...t}}get isValid(){return!!this.props.storedPaymentMethodId||!!this.state.isValid}get displayName(){return this.props.storedPaymentMethodId&&this.props.lastFour?`•••• ${this.props.lastFour}`:this.props.name}get additionalInfo(){return this.props.storedPaymentMethodId?this.props.label:""}componentToRender(){return this.props.storedPaymentMethodId?t(e,null,t(n,null),t(r,{showPayButton:this.props.showPayButton,icon:this.resources?.getImage({imageFolder:"components/"})("bento_lock"),label:i(this.props.i18n,this.props.amount),name:this.displayName,payButton:this.payButton,onSubmit:this.submit,ref:t=>{this.componentRef=t}})):t(a,{onChange:this.setState,payButton:this.payButton,showPayButton:this.props.showPayButton,placeholders:this.props.placeholders,setComponentRef:this.setComponentRef,showContextualElement:this.props.showContextualElement,enableStoreDetails:this.props.enableStoreDetails})}}var m,d,h;m=p,d="type",h=s.eft_directdebit_CA,d in m?Object.defineProperty(m,d,{value:h,enumerable:!0,configurable:!0,writable:!0}):m[d]=h;export{p as PreAuthorizedDebitCanada,p as default}; //# sourceMappingURL=PreAuthorizedDebitCanada.js.map