@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 2.36 kB
JavaScript
import{createElement as t,Fragment as e}from"../../external/preact/dist/preact.js";import{UIElement as o}from"../internal/UIElement/UIElement.js";import{CoreProvider as s}from"../../core/Context/CoreProvider.js";import{TxVariants as n}from"../tx-variants.js";import a from"./components/PreAuthorizedDebitCanadaComponent.js";import{SettlementInfo as r}from"./components/SettlementInfo.js";import i from"../internal/RedirectButton/RedirectButton.js";import"../internal/Button/Button.js";import{payAmountLabel as p}from"../internal/PayButton/utils.js";class m extends o{formatData(){return!!this.props.storedPaymentMethodId?{paymentMethod:{type:m.type,storedPaymentMethodId:this.props.storedPaymentMethodId}}:{paymentMethod:{type:m.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:""}render(){return t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},this.props.storedPaymentMethodId?t(e,null,t(r,null),t(i,{showPayButton:this.props.showPayButton,icon:this.resources?.getImage({imageFolder:"components/"})("bento_lock"),label:p(this.props.i18n,this.props.amount),name:this.displayName,amount:this.props.amount,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 h,d,l;h=m,d="type",l=n.eft_directdebit_CA,d in h?Object.defineProperty(h,d,{value:l,enumerable:!0,configurable:!0,writable:!0}):h[d]=l;export{m as PreAuthorizedDebitCanada,m as default};
//# sourceMappingURL=PreAuthorizedDebitCanada.js.map