@justifi/webcomponents 6.13.1 → 6.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-DMppKXYI.js → Analytics-F9eGV4SU.js} +1 -1
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-DcgenUqU.js → check-pkg-version--A_rGEJu.js} +1 -1
- package/dist/cjs/dispute-notification_2.cjs.entry.js +3 -3
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +3 -3
- package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +3 -3
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +10 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-qr-terminal.cjs.entry.js +3 -3
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +3 -3
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
- package/dist/cjs/{package-CS22fAzw.js → package-Cuwhrp-b.js} +1 -1
- package/dist/collection/components/payout-transactions-list/payout-transactions-table.js +7 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{Analytics-CTY3Jgn8.js → Analytics-CQwgYl2v.js} +1 -1
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-BOQqkWpf.js → check-pkg-version-2VZtm0yL.js} +1 -1
- package/dist/esm/dispute-notification_2.entry.js +3 -3
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/justifi-apple-pay_11.entry.js +3 -3
- package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +3 -3
- package/dist/esm/justifi-bank-account-form.entry.js +3 -3
- package/dist/esm/justifi-business-details.entry.js +3 -3
- package/dist/esm/justifi-business-form.entry.js +3 -3
- package/dist/esm/justifi-card-form.entry.js +3 -3
- package/dist/esm/justifi-checkout-qr-code.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list.entry.js +3 -3
- package/dist/esm/justifi-dispute-management.entry.js +3 -3
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
- package/dist/esm/justifi-order-terminals.entry.js +3 -3
- package/dist/esm/justifi-payment-details.entry.js +3 -3
- package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
- package/dist/esm/justifi-payment-transactions-list.entry.js +3 -3
- package/dist/esm/justifi-payments-list.entry.js +3 -3
- package/dist/esm/justifi-payout-details.entry.js +3 -3
- package/dist/esm/justifi-payout-transactions-list.entry.js +10 -4
- package/dist/esm/justifi-payouts-list.entry.js +3 -3
- package/dist/esm/justifi-qr-terminal.entry.js +3 -3
- package/dist/esm/justifi-refund-payment.entry.js +3 -3
- package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list.entry.js +3 -3
- package/dist/esm/justifi-terminals-list.entry.js +3 -3
- package/dist/esm/{package-DNd24RUQ.js → package-BtzgeLyZ.js} +1 -1
- package/dist/module/justifi-payout-transactions-list.js +7 -1
- package/dist/module/package.js +1 -1
- package/dist/types/components/payout-transactions-list/payout-transactions-table.d.ts +6 -0
- package/dist/webcomponents/{p-fca0ca4d.entry.js → p-10f3b8df.entry.js} +1 -1
- package/dist/webcomponents/{p-f52fe722.entry.js → p-1ac357f9.entry.js} +1 -1
- package/dist/webcomponents/{p-1737a7fc.entry.js → p-4821c092.entry.js} +1 -1
- package/dist/webcomponents/p-4bb9d772.entry.js +1 -0
- package/dist/webcomponents/{p-ac08992c.entry.js → p-5111a9f5.entry.js} +1 -1
- package/dist/webcomponents/{p-2bab43ac.entry.js → p-54e343d3.entry.js} +3 -3
- package/dist/webcomponents/{p-5d9d6dd5.entry.js → p-5e59e283.entry.js} +1 -1
- package/dist/webcomponents/{p-e8875186.entry.js → p-64840a3d.entry.js} +1 -1
- package/dist/webcomponents/{p-f60bfe16.entry.js → p-648c6cb1.entry.js} +1 -1
- package/dist/webcomponents/{p-e711f221.entry.js → p-7d04803e.entry.js} +1 -1
- package/dist/webcomponents/p-85b155b0.entry.js +1 -0
- package/dist/webcomponents/{p-e63cd41f.entry.js → p-87427a4f.entry.js} +1 -1
- package/dist/webcomponents/{p-c47db9f5.entry.js → p-9c1a0efc.entry.js} +1 -1
- package/dist/webcomponents/{p-2757b61e.entry.js → p-9c7bce35.entry.js} +1 -1
- package/dist/webcomponents/p-BtzgeLyZ.js +1 -0
- package/dist/webcomponents/{p-CQqmTKij.js → p-C_SQBHCI.js} +1 -1
- package/dist/webcomponents/{p-_GBnYSuR.js → p-DYL3RR2S.js} +1 -1
- package/dist/webcomponents/p-a125318a.entry.js +1 -0
- package/dist/webcomponents/{p-a5913b33.entry.js → p-a404b995.entry.js} +1 -1
- package/dist/webcomponents/{p-b73c5779.entry.js → p-b08c76da.entry.js} +1 -1
- package/dist/webcomponents/{p-fb2e1557.entry.js → p-bd882260.entry.js} +1 -1
- package/dist/webcomponents/{p-2ebc862f.entry.js → p-c2de24fe.entry.js} +1 -1
- package/dist/webcomponents/{p-ec845aa4.entry.js → p-d1cbeb65.entry.js} +1 -1
- package/dist/webcomponents/{p-0dc3c605.entry.js → p-d5197891.entry.js} +1 -1
- package/dist/webcomponents/{p-ebd1c09f.entry.js → p-d93d9d58.entry.js} +1 -1
- package/dist/webcomponents/{p-863daddf.entry.js → p-d9fd1c50.entry.js} +1 -1
- package/dist/webcomponents/{p-6d1299db.entry.js → p-e4bc8c7c.entry.js} +1 -1
- package/dist/webcomponents/{p-2092b278.entry.js → p-ebf178d2.entry.js} +1 -1
- package/dist/webcomponents/{p-a7bd5651.entry.js → p-ee97795a.entry.js} +1 -1
- package/dist/webcomponents/{p-a5cc55af.entry.js → p-f0961751.entry.js} +1 -1
- package/dist/webcomponents/{p-32ee9101.entry.js → p-fa21fe56.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-5984e9df.entry.js +0 -1
- package/dist/webcomponents/p-70a2f59a.entry.js +0 -1
- package/dist/webcomponents/p-90c5af69.entry.js +0 -1
- package/dist/webcomponents/p-DNd24RUQ.js +0 -1
|
@@ -26,6 +26,12 @@ export declare const payoutTransactionTypes: {
|
|
|
26
26
|
seller_payment: string;
|
|
27
27
|
transfer: string;
|
|
28
28
|
partner_platform_proceeds_credit: string;
|
|
29
|
+
processing_fee: string;
|
|
30
|
+
refund_processing_fee: string;
|
|
31
|
+
fee_rounding_adjustment: string;
|
|
32
|
+
platform_fee: string;
|
|
33
|
+
processing_fee_return: string;
|
|
34
|
+
platform_fee_return: string;
|
|
29
35
|
};
|
|
30
36
|
export declare const payoutTransactionTableCells: {
|
|
31
37
|
id: (transaction: PayoutBalanceTransaction) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{c as r,a as i,F as n}from"./p-D9sqTVmd.js";import{f as o}from"./p-BSs-2JKu.js";import"./p-DVJaoI_m.js";import{R as a,C as u,b as h,q as l}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{B as c}from"./p-CHo7TfsM.js";import{S as d}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{P as m}from"./p-NzPaWKbY.js";import{m as p}from"./p-BB8Ce9rp.js";import{J as f}from"./p-
|
|
1
|
+
import{h as t,r as e,c as s}from"./p-CV0Pyo1O.js";import{c as r,a as i,F as n}from"./p-D9sqTVmd.js";import{f as o}from"./p-BSs-2JKu.js";import"./p-DVJaoI_m.js";import{R as a,C as u,b as h,q as l}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{B as c}from"./p-CHo7TfsM.js";import{S as d}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{P as m}from"./p-NzPaWKbY.js";import{m as p}from"./p-BB8Ce9rp.js";import{J as f}from"./p-DYL3RR2S.js";import{c as y}from"./p-C_SQBHCI.js";import{g as v,a as j}from"./p-CdwzNfP1.js";import{A as b}from"./p-De4Pig-y.js";import{S as w}from"./p-uZ5KAseb.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-D8GTwl9v.js";import"./p-CPKMvyV_.js";import"./p-BtzgeLyZ.js";const T=t=>{const e=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${o(e)}`,(function(t){return+t<=+e})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:T(t),description:i().optional(),reason:i().optional().oneOf([a.customerRequest,a.duplicate,a.fraudulent],"Select a reason")})},g=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],S=b();class I{async postRefund(t,e,s,r){return S.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":e},body:r,authToken:s})}}const P=b();class R{async postVoid(t,e,s){return P.post({endpoint:`payments/${t}/void`,headers:{"Sub-Account":e},authToken:s})}}const A=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),k=()=>t(d,null,t("div",{class:"row gap-5"},t(A,null),t(A,null),t(A,null))),x=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event",7),this.submitEvent=s(this,"submit-event",7),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,e)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:e}))}}componentWillLoad(){y(),this.analytics=new f(this),this.initializeApi(),this.formController=new n(C())}handleError(t,e,s){this.errorEvent.emit({errorCode:t,message:e,severity:s})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(h.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",u.ERROR)}isPaymentCreatedWithin25Minutes(){var t;if(!this.payment||!(null===(t=this.payment)||void 0===t?void 0:t.created_at))return!1;const e=new Date(this.payment.created_at);return((new Date).getTime()-e.getTime())/6e4<=25}initializeFormController(){const t=this.refundPayload.amount,e=t?t.toString():"0";this.formController=new n(C(e)),this.formController.setInitialValues({amount:e}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?p({id:this.paymentId,authToken:this.authToken,service:new m})({onSuccess:({payment:t})=>{this.payment=t,this.refundPayload=new l({amount:t.amount_refundable})},onError:({error:t,code:e,severity:s})=>{this.handleError(e,t,s)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(h.MISSING_PROPS,"Payment ID and Auth Token are required",u.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const e=this.formController.values.getValue();return this.refundLoading=!0,this.isPaymentCreatedWithin25Minutes()?this.tryVoidPayment():this.processRefund(e)}async tryVoidPayment(){const t=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({onSuccess:i,onError:n,final:o})=>{var a;try{const o=await r.postVoid(s,e,t);if(o.error)return n({error:j(o.error),code:v(null===(a=o.error)||void 0===a?void 0:a.code),severity:u.ERROR});i(o)}catch(t){const e=v(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:u.ERROR})}finally{o()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new R});return new Promise((e=>{let s,r=!1;const i=this.formController.values.getValue();t({onSuccess:t=>{s=t,r=!0},onError:({error:t,code:s,severity:n})=>{r=!0,this.handleError(t,s,n),this.processRefund(i).then(e)},final:()=>{s&&!s.error&&r&&(this.submitEvent.emit({response:s}),this.submitDisabled=!0,this.refundLoading=!1,e(s.data))}})}))}async processRefund(t){const e=(({authToken:t,accountId:e,paymentId:s,service:r})=>async({refundBody:i,onSuccess:n,onError:o,final:a})=>{var h;try{const a=await r.postRefund(s,e,t,i);if(a.error)return o({error:j(a.error),code:v(null===(h=a.error)||void 0===h?void 0:h.code),severity:u.ERROR});n(a)}catch(t){const e=v(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:u.ERROR})}finally{a()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new I});return new Promise((s=>{let r;e({refundBody:t,onSuccess:t=>{r=t},onError:({error:t,code:e,severity:s})=>{r=t,this.handleError(t,e,s)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,s(r.data)}})}))}render(){if(this.paymentLoading)return t(k,null);const e=this.formController.getInitialValues(),s=this.refundPayload.amount;return t(d,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:e.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:e.reason,inputHandler:this.inputHandler,options:g,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:e.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(c,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${o(+s)}`))))))}};export{x as justifi_refund_payment}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c as d}from"./p-DVJaoI_m.js";import{e as c}from"./p-BSs-2JKu.js";import{c as s}from"./p-
|
|
1
|
+
import{h as i,r as e}from"./p-CV0Pyo1O.js";import{S as a}from"./p-uZ5KAseb.js";import{w as t,c as d}from"./p-DVJaoI_m.js";import{e as c}from"./p-BSs-2JKu.js";import{c as s}from"./p-C_SQBHCI.js";import"./p-CPKMvyV_.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";import"./p-BtzgeLyZ.js";const n=e=>{const{isReady:t}=e;return t?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(a,{height:"18px",width:"100px"}),i(a,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"80px"}),i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(a,{height:"18px",width:"30px"}),i(a,{height:"36px"}))))},r=class{constructor(i){e(this,i),this.isReady=!1}async componentWillLoad(){await t(),this.iframeOrigin=d.iframeOrigin,this.tabId=c(),s()}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((i=>new Promise((e=>{i.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}async validate(){const i=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),a=await this.expirationYearIframeElement.validate(),t=await this.cvvIframeElement.validate();return i&&e&&a&&t}async tokenize({clientId:i,paymentMethodMetadata:e,account:a}){return await this.cardNumberIframeElement.tokenize(i,e,a)}render(){return i("div",{key:"d3cb1fca6595f60e5f5f122b73d3d6c11a826423"},i(n,{key:"f83dcbbc214d460bb21c015ec051436ed5cf6670",isReady:this.isReady}),i("hidden-input",{key:"5fad0d06303d0ddb55c30c2cd94014255f2a8cec"}),i("div",{key:"68440756a1aad69b5c95245e7a2a5feb16899dca",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"b39eab56c79463935f1a1bb15cc867997f026e7b",class:"mb-3"},i("iframe-input",{key:"25a2390a8c3c92d5e6eceafe6b821202ecb22d76",inputId:"cardNumber",ref:i=>this.cardNumberIframeElement=i,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"68766798d954a0b3d093ae13c3c2955f819da4f2",class:"row"},i("div",{key:"05539f1ac8ebb0397574d55b4b76d7acdb7d2dca",class:"col-4 align-content-end"},i("iframe-input",{key:"4c437a4384e6c301e18824d799784c1133e70ee3",inputId:"expirationMonth",ref:i=>this.expirationMonthIframeElement=i,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"b9a5b8b5dda1d8ab6305c9dc1ef9b655eb02fb3d",class:"col-4 align-content-end"},i("iframe-input",{key:"c1a412c20e75d21c1084a4b93f22362c367c1907",inputId:"expirationYear",ref:i=>this.expirationYearIframeElement=i,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"abdfdbd7eb784871011397a7c5fdf371e3c6baf0",class:"col-4 align-content-end"},i("iframe-input",{key:"08dff072e785846d7543018c194b4df6ce5b343e",inputId:"CVV",ref:i=>this.cvvIframeElement=i,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}};export{r as card_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,r as s,c as t}from"./p-CV0Pyo1O.js";import{a9 as e,a8 as r,a1 as o,t as l}from"./p-CPKMvyV_.js";import{S as d}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{c as
|
|
1
|
+
import{h as i,r as s,c as t}from"./p-CV0Pyo1O.js";import{a9 as e,a8 as r,a1 as o,t as l}from"./p-CPKMvyV_.js";import{S as d}from"./p-DzEdYT8R.js";import"./p-CZfYo5-1.js";import{c as a}from"./p-C_SQBHCI.js";import{J as n}from"./p-DYL3RR2S.js";import{o as h,C as c,p as v,f as u,b as p}from"./p-DXTa04jn.js";import{B as m}from"./p-R_0S69Pr.js";import{B as f}from"./p-BcNb9bVO.js";import{m as w}from"./p-CPJC6tlj.js";import{S as y}from"./p-uZ5KAseb.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import{g as b,a as g}from"./p-CdwzNfP1.js";import{T as x}from"./p-CxBrydeX.js";import{l as j}from"./p-BSs-2JKu.js";import"./p-BtzgeLyZ.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";const S=()=>i("div",{class:"row gap-3"},i("div",{class:"col-12"},i(y,{width:"25%"})),i("div",{class:"col-12"},i(y,{width:"100%"})),i("div",{class:"col-12 d-flex gap-3"},i(y,{width:"50%"}),i(y,{width:"50%"})),i("div",{class:"col-12 d-flex gap-3"},i(y,{width:"65%"}),i(y,{width:"35%"}))),C=()=>i("div",{class:"row gap-5"},i("div",{class:"col-12"},i(y,{width:"40%",height:"40px"})),i(S,null)),k=()=>i("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},i("div",{class:"d-flex align-items-center gap-3"},i(y,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),i("div",{class:"flex-grow-1"},i("div",{class:"d-flex row flex-row"},i("div",{class:"col-6 flex-column"},i(y,null),i(y,{width:"60%"})),i("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},i(y,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),i(y,{width:"80px",height:"32px"}),i(y,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),i("div",{class:"mt-4"},i("div",{class:"d-flex flex-column gap-2"},i(y,null),i(y,null)))))),T=class{constructor(i){s(this,i),this.errorEvent=t(this,"error-event",7),this.submitted=t(this,"submit-event",7),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new v({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?u.boardingShipping:u.boardingOnly}),a(),this.analytics=new n(this),this.loadData()}disconnectedCallback(){var i;null===(i=this.analytics)||void 0===i||i.cleanup()}handleError(i,s,t){this.error={message:i,code:s,severity:t},this.errorEvent.emit({errorCode:s,message:i,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",p.MISSING_PROPS,c.ERROR)}initializeGetBusiness(){w({id:this.businessId,authToken:this.authToken,service:new m})({onSuccess:({business:i})=>{this.business=new f(i)},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t)},final:()=>{this.loading.business=!1}})}initializeGetTerminalModels(){(({id:i,authToken:s,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,a;try{const n=await t.fetchTerminalModels(i,s);if(n.error)return r({error:g(n.error),code:b(null===(a=n.error)||void 0===a?void 0:a.code),severity:c.ERROR});e({terminals:(null===(l=null===(o=n.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((i=>new h(i))))||[],orderLimit:null===(d=n.data)||void 0===d?void 0:d.order_limit})}catch(i){const s=b(null==i?void 0:i.code);return r({error:i.message||i,code:s,severity:c.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new x})({onSuccess:({terminals:i,orderLimit:s})=>{this.terminalModels=i,this.orderLimit=s,this.loading.terminals=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.loading.terminals=!1}})}submitOrder(){const i=(({authToken:i,service:s,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await s.orderTerminals(i,e,t);if(d.error)return o({error:g(d.error),code:b(null===(l=d.error)||void 0===l?void 0:l.code),severity:c.ERROR});{const{data:i}=d;r({data:i})}}catch(i){const s=b(null==i?void 0:i.code);return o({error:i.message||i,code:s,severity:c.ERROR})}})({authToken:this.authToken,service:new x});this.submitting=!0,i({terminalOrder:this.order.payload,onSuccess:({data:i})=>{this.submitted.emit(i),this.submitting=!1},onError:({error:i,code:s,severity:t})=>{this.handleError(i,s,t),this.submitting=!1}})}onSelectedQuantityChange(i){this.order.updateTerminal(i.detail.modelName,i.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return i("div",null,this.loading.business&&i(C,null),this.loading.terminals&&i("div",{class:"mt-5"},i(k,null),i(k,null),i(k,null)))}renderBusinessDetails(){var s,t,o,l,d,a,n,h;if(!this.loading.business&&this.business)return i("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},i("div",{class:"row"},i("div",{class:"col-12"},i("h2",{part:r},this.business.legal_name))),i("div",{class:"row"},i("div",{class:"col-6"},i("h5",{part:e},"Representative:"),i("div",null,i("div",null,null===(t=null===(s=this.business)||void 0===s?void 0:s.representative)||void 0===t?void 0:t.name),i("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),i("div",null,null===(a=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===a?void 0:a.email),i("div",null,j(null===(h=null===(n=this.business)||void 0===n?void 0:n.representative)||void 0===h?void 0:h.phone)))),i("div",{class:"col-6"},i("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),i("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",i("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return i("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((s=>i("terminal-quantity-selector",{modelName:s.model_name,description:s.description,imageUrl:s.image_url,helpUrl:s.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return i("div",{class:"mt-3"},i("div",{class:"text-end"},"Order limit: ",this.orderLimit),i("div",{class:"d-flex justify-content-end mt-3"},i("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return i(d,{key:"1fd8c50ac4e22bb2aac46ed0379f4740737e9760"},i("div",{key:"caed839c05af25c7bcd6599c45cd5058491a1ba9",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{T as justifi_order_terminals}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,r as t,c as i}from"./p-CV0Pyo1O.js";import{c as e,F as r}from"./p-D9sqTVmd.js";import{b as o,i as a,a as h,c as n,d as p,e as l,f as m}from"./p-C1gr32IS.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as d,b as c}from"./p-DXTa04jn.js";import"./p-CLHwhyvu.js";import{C as u,B as j,b as f}from"./p-BcNb9bVO.js";import{J as v}from"./p-DYL3RR2S.js";import{B as b}from"./p-CHo7TfsM.js";import{S as w}from"./p-DzEdYT8R.js";import{H as g}from"./p-jIDKmNHy.js";import"./p-CZfYo5-1.js";import{c as C}from"./p-C_SQBHCI.js";import{S as y}from"./p-uZ5KAseb.js";import{B}from"./p-XYgDHrVL.js";import{m as D,a as S}from"./p-Da3fPDxu.js";import{B as _}from"./p-R_0S69Pr.js";import"./p-BFTU3MAI.js";import"./p-z3RFjy9B.js";import"./p-DPA5TKvQ.js";import"./p-BBSnDYJw.js";import"./p-D8GTwl9v.js";import"./p-BSs-2JKu.js";import"./p-BtzgeLyZ.js";import"./p-De4Pig-y.js";import"./p-CPKMvyV_.js";import"./p-CdwzNfP1.js";const x=e(Object.assign(Object.assign({},o().fields),{legal_address:n(),additional_questions:h(),representative:a("representative")}));e(Object.assign(Object.assign({},p().fields),{legal_address:m(),additional_questions:h(),representative:l("representative")}));const O=x,T=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(y,{width:"25%"})),s("div",{class:"col-12"},s(y,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"50%"}),s(y,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(y,{width:"65%"}),s(y,{width:"35%"}))),I=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(y,{width:"40%",height:"40px"})),s(T,null),s(T,null),s(T,null)),H=class{constructor(s){t(this,s),this.submitEvent=i(this,"submit-event",7),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.isLoading=!1,this.isSaving=!1,this.country=u.USA,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const t=new j(s);this.country=t.country_of_establishment,this.formController.setInitialValues(Object.assign({},t))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),t=this.formController.getInitialValues(),i=new j(Object.assign(Object.assign({},t),s)).payload;this.patchBusiness({payload:i,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:t,severity:i})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:t,message:s.message,severity:i})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){C(),this.analytics=new v(this),this.formController=new r(O),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=D({authToken:this.authToken,businessId:this.businessId,service:new _}),this.patchBusiness=S({authToken:this.authToken,businessId:this.businessId,service:new _}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:t,severity:i})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:t,message:s.message,severity:i})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:c.MISSING_PROPS,severity:d.ERROR})}handleReponse(s){s.error&&(this.errorMessage=f.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(w,null,this.isLoading?s(I,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(g,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("business-core-info",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("legal-address-form",{formController:this.formController,country:this.country})),s("div",{class:"col-12 mb-4"},s("additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("business-representative",{formController:this.formController,country:this.country})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(b,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:B.submit}),isLoading:this.isSaving},"Submit")))))}};export{H as justifi_business_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-NzPaWKbY.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{e as i,C as r,b as o}from"./p-DXTa04jn.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as c,a as p}from"./p-CdwzNfP1.js";import{J as h}from"./p-
|
|
1
|
+
import{h as t,r as e,c as a}from"./p-CV0Pyo1O.js";import{P as s}from"./p-NzPaWKbY.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{e as i,C as r,b as o}from"./p-DXTa04jn.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as c,a as p}from"./p-CdwzNfP1.js";import{J as h}from"./p-DYL3RR2S.js";import{c as d}from"./p-C_SQBHCI.js";import{S as m}from"./p-DzEdYT8R.js";import{T as l,a as f,b as u,c as y,d as b,e as g,f as v,g as j,h as C,i as _,j as k,k as w,l as T}from"./p-BICxxa69.js";import{T as D}from"./p-CZfYo5-1.js";import{M as P}from"./p-D1_eip6x.js";import{a as S}from"./p-BSs-2JKu.js";import{a6 as O,a7 as I}from"./p-CPKMvyV_.js";import{o as x,g as A}from"./p-Dm07nLGs.js";import"./p-De4Pig-y.js";import"./p-D8GTwl9v.js";import"./p-BtzgeLyZ.js";import"./p-CqiVXthx.js";import"./p-CHw7tICr.js";const B={created_at:()=>t("th",{part:O,scope:"col",title:"The date and time each payment was made"},"Date"),amount:()=>t("th",{part:O,scope:"col",title:"The dollar amount of each payment"},"Amount"),status:()=>t("th",{part:O,scope:"col",title:"The current status of each payment"},"Status"),payment_type:()=>t("th",{part:O,scope:"col",title:"The type of each payment"},"Type"),description:()=>t("th",{part:O,scope:"col",title:"The payment description, if you provided one"},"Description"),payers_name:()=>t("th",{part:O,scope:"col",title:"The name associated with the payment method"},"Account Holder"),last_four_digits:()=>t("th",{part:O,scope:"col",title:"The brand and last 4 digits of the payment method"},"Payment Method"),card_brand:()=>t("th",{part:O,scope:"col",title:"The brand of the payment method"},"Card Brand")},E={created_at:(e,a)=>t("td",{part:I(a)},t("div",{class:"fw-bold"},S(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.created_at,{showTime:!0}))),amount:(e,a)=>t("td",{part:I(a)},e.formattedPaymentAmount(e.amount)),status:(e,a)=>t("td",{part:I(a)},P(e.status)),payment_type:(e,a)=>t("td",{part:I(a)},e.payment_type),description:(e,a)=>t("td",{part:I(a)},e.description),payers_name:(e,a)=>t("td",{part:I(a)},e.payers_name),last_four_digits:(e,a)=>t("td",{part:I(a)},e.last_four_digits),card_brand:(e,a)=>{var s,i,r;return t("td",{part:I(a)},(r=(null===(s=e.payment_method.card)||void 0===s?void 0:s.brand)||(null===(i=e.payment_method.bank_account)||void 0===i?void 0:i.brand))?{visa:"VISA",mastercard:"Mastercard",american_express:"American Express",discover:"Discover",diners_club:"Diners Club",jcb:"JCB",china_unionpay:"China UnionPay",unknown:"Unknown"}[r.toLowerCase()]||r:"N/A")}},L=class{constructor(t){e(this,t),this.errorEvent=a(this,"error-event",7),this.clickEvent=a(this,"click-event",7),this.errorMessage=null,this.payments=[],this.loading=!0,this.paging=n,this.pagingParams={},this.columns="created_at,amount,status,payment_type,description,payers_name,last_four_digits,card_brand",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.payments.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){d(),this.analytics=new h(this),this.paymentsTable=new l(this.payments,this.columns,B,E),this.initializeGetPayments(),x("set",(()=>{this.pagingParams={},this.errorMessage=""})),x("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPayments()}updateOnPropChange(){this.fetchData()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:t,authToken:e,service:a})=>async({params:s,onSuccess:o,onError:n,final:h})=>{var d,m;try{const h=await a.fetchPayments(t,e,s);if(h.error)return n({error:p(h.error),code:c(null===(m=h.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},h.page_info);o({payments:(null===(d=h.data)||void 0===d?void 0:d.map((t=>new i(t))))||[],pagingInfo:t})}}catch(t){const e=c(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:r.ERROR})}finally{h()}})({id:this.accountId,authToken:this.authToken,service:new s}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}fetchData(){this.getPayments&&(this.loading=!0,this.getPayments({params:this.paymentParams,onSuccess:({payments:t,pagingInfo:e})=>{this.payments=t,this.paging=e,this.paymentsTable.collectionData=this.payments},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:a})},final:()=>{this.loading=!1}}))}get paymentParams(){const t=A();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.payments.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.paymentsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(m,{key:"b2c7bd7573c3a2cdc683e6ea0b22bc625eaddbc6"},t(f,{key:"edcc04c18ae762b75aab3cebe31a5aab824843ef"},t(u,{key:"98b6e699948ac65667497b59b0ac23e36d7ea212"},t(y,{key:"06830e440c2f5ea23acd0109f58dd6e11f6495bf"},t(b,{key:"8a29564e85eb5a870c37c58cc57a149327f5405d"},this.paymentsTable.columnData.map((t=>t)))),t(g,{key:"a03ffd7422fbf7f364a6f7545a0158fb0cd38691"},t(v,{key:"6f48d9791c28a3407edddf97fc54a1a92c5e7dbc",columnSpan:this.paymentsTable.columnData.length,isLoading:this.loading}),t(j,{key:"ab948e22cf74e5db93835df17f93c200f0caf698",isEmpty:this.showEmptyState,columnSpan:this.paymentsTable.columnData.length}),t(C,{key:"28064e964a0db825ba7d78bc84e55c88b5c8e0c3",columnSpan:this.paymentsTable.columnData.length,errorMessage:this.errorMessage}),this.showRowData&&this.paymentsTable.rowData.map(((e,a)=>t(_,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"036c71025fb6d150a3bdaa370e84e955ecf79b66"},t(w,{key:"373d7ac9f89a226a32a26a5ee7bb2a2246f8a454"},t(T,{key:"a74ee4a4f5004dfe5e0513cfeea66c3b34b8d610",colSpan:this.paymentsTable.columnData.length},t("pagination-menu",{key:"438d49d2094bb17488b8e2aa90fd0dbce100d920",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getPayments:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{L as justifi_payments_list}
|