@justifi/webcomponents 5.7.6-rc-14 → 5.7.6-rc-16
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/bank-account-document-form-inputs_4.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-C1ULIaUs.js → check-pkg-version-BkzyzJ71.js} +1 -1
- package/dist/cjs/custom-popper.cjs.entry.js +2 -2
- package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/form-control-date.cjs.entry.js +2 -2
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
- package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number-masked_2.cjs.entry.js +2 -2
- package/dist/cjs/form-control-number.cjs.entry.js +2 -2
- package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
- package/dist/cjs/form-control-select_3.cjs.entry.js +2 -2
- package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
- package/dist/cjs/justifi-apple-pay.cjs.entry.js +10 -6
- package/dist/cjs/justifi-bank-account-form_5.cjs.entry.js +8 -8
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-button_5.cjs.entry.js +6 -6
- package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +3 -3
- package/dist/cjs/{package-DVb8pAyF.js → package-e83u_82Y.js} +1 -1
- package/dist/cjs/payment-details-core.cjs.entry.js +8 -8
- package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
- package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
- package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
- package/dist/cjs/terminal-orders-list-core.cjs.entry.js +1 -1
- package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
- package/dist/cjs/terminals-list-core.cjs.entry.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +10 -6
- package/dist/collection/components/modular-checkout/sub-components/bank-account.js +2 -2
- package/dist/collection/components/modular-checkout/sub-components/billing-information-form.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/card-form.js +2 -2
- package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/postal-code-form.js +1 -1
- package/dist/collection/components/modular-checkout/sub-components/summary.js +1 -1
- package/dist/collection/components/order-terminals/order-terminals.js +1 -1
- package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
- package/dist/collection/components/payment-details/payment-details-core.js +8 -8
- package/dist/collection/components/payment-transactions-list/payment-transactions-list.js +1 -1
- package/dist/collection/components/payments-list/payments-list-core.js +1 -1
- package/dist/collection/components/payments-list/payments-list-filters.js +2 -2
- package/dist/collection/components/payments-list/payments-list.js +1 -1
- package/dist/collection/components/payout-details/payout-details-core.js +3 -3
- package/dist/collection/components/payout-transactions-list/payout-transactions-list.js +1 -1
- package/dist/collection/components/payouts-list/payouts-list-core.js +1 -1
- package/dist/collection/components/payouts-list/payouts-list-filters.js +2 -2
- package/dist/collection/components/payouts-list/payouts-list.js +1 -1
- package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +1 -1
- package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +2 -2
- package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +1 -1
- package/dist/collection/components/terminals-list/terminals-list-core.js +1 -1
- package/dist/collection/components/terminals-list/terminals-list-filters.js +1 -1
- package/dist/collection/components/terminals-list/terminals-list.js +1 -1
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +1 -1
- package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
- package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
- package/dist/collection/ui-components/form/form-control-date.js +2 -2
- package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
- package/dist/collection/ui-components/form/form-control-file.js +2 -2
- package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
- package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
- package/dist/collection/ui-components/form/form-control-number.js +2 -2
- package/dist/collection/ui-components/form/form-control-radio.js +2 -2
- package/dist/collection/ui-components/form/form-control-text.js +2 -2
- package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
- package/dist/collection/ui-components/form/hidden-input.js +1 -1
- package/dist/collection/ui-components/form/iframe-input.js +3 -3
- package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
- package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/bank-account-document-form-inputs_4.entry.js +2 -2
- package/dist/esm/{check-pkg-version-C1rI0NVZ.js → check-pkg-version-Ddp_kLM5.js} +1 -1
- package/dist/esm/custom-popper.entry.js +2 -2
- package/dist/esm/form-control-checkbox.entry.js +2 -2
- package/dist/esm/form-control-date.entry.js +2 -2
- package/dist/esm/form-control-file-v2_2.entry.js +3 -3
- package/dist/esm/form-control-monetary.entry.js +2 -2
- package/dist/esm/form-control-number-masked_2.entry.js +2 -2
- package/dist/esm/form-control-number.entry.js +2 -2
- package/dist/esm/form-control-radio.entry.js +2 -2
- package/dist/esm/form-control-select_3.entry.js +2 -2
- package/dist/esm/hidden-input_2.entry.js +5 -5
- package/dist/esm/justifi-apple-pay.entry.js +10 -6
- package/dist/esm/justifi-bank-account-form_5.entry.js +8 -8
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-button_5.entry.js +6 -6
- package/dist/esm/justifi-checkout.entry.js +2 -2
- package/dist/esm/justifi-checkouts-list.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-order-terminals.entry.js +3 -3
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +3 -3
- package/dist/esm/justifi-payments-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +3 -3
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payout-transactions-list.entry.js +3 -3
- package/dist/esm/justifi-payouts-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +3 -3
- package/dist/esm/justifi-refund-payment.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/justifi-skeleton.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +2 -2
- package/dist/esm/justifi-terminal-orders-list.entry.js +3 -3
- package/dist/esm/justifi-terminals-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminals-list.entry.js +3 -3
- package/dist/esm/justifi-tokenize-payment-method.entry.js +3 -3
- package/dist/esm/{package-D2Cx_K3D.js → package-HMZ8vsvN.js} +1 -1
- package/dist/esm/payment-details-core.entry.js +8 -8
- package/dist/esm/payments-list-core.entry.js +1 -1
- package/dist/esm/payout-details-core.entry.js +3 -3
- package/dist/esm/payouts-list-core.entry.js +1 -1
- package/dist/esm/terminal-orders-list-core.entry.js +1 -1
- package/dist/esm/terminal-quantity-selector.entry.js +1 -1
- package/dist/esm/terminals-list-core.entry.js +1 -1
- package/dist/module/bank-account.js +2 -2
- package/dist/module/billing-information-form.js +1 -1
- package/dist/module/card-form2.js +2 -2
- package/dist/module/custom-popper2.js +2 -2
- package/dist/module/form-control-checkbox2.js +2 -2
- package/dist/module/form-control-date2.js +2 -2
- package/dist/module/form-control-file-v22.js +1 -1
- package/dist/module/form-control-file2.js +2 -2
- package/dist/module/form-control-monetary2.js +2 -2
- package/dist/module/form-control-number-masked2.js +2 -2
- package/dist/module/form-control-number.js +2 -2
- package/dist/module/form-control-radio2.js +2 -2
- package/dist/module/form-control-text2.js +2 -2
- package/dist/module/form-control-textarea2.js +2 -2
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/iframe-input2.js +3 -3
- package/dist/module/justifi-apple-pay.js +10 -6
- package/dist/module/justifi-button2.js +1 -1
- package/dist/module/justifi-header2.js +1 -1
- package/dist/module/justifi-order-terminals.js +1 -1
- package/dist/module/justifi-payment-transactions-list.js +1 -1
- package/dist/module/justifi-payments-list-filters.js +2 -2
- package/dist/module/justifi-payments-list.js +1 -1
- package/dist/module/justifi-payout-transactions-list.js +1 -1
- package/dist/module/justifi-payouts-list-filters.js +2 -2
- package/dist/module/justifi-payouts-list.js +1 -1
- package/dist/module/justifi-skeleton.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +2 -2
- package/dist/module/justifi-terminal-orders-list.js +1 -1
- package/dist/module/justifi-terminals-list-filters.js +1 -1
- package/dist/module/justifi-terminals-list.js +1 -1
- package/dist/module/justifi-tokenize-payment-method.js +1 -1
- package/dist/module/package.js +1 -1
- package/dist/module/payment-details-core2.js +8 -8
- package/dist/module/payment-method-option2.js +1 -1
- package/dist/module/payments-list-core2.js +1 -1
- package/dist/module/payout-details-core2.js +3 -3
- package/dist/module/payouts-list-core2.js +1 -1
- package/dist/module/postal-code-form.js +1 -1
- package/dist/module/summary.js +1 -1
- package/dist/module/terminal-orders-list-core2.js +1 -1
- package/dist/module/terminal-quantity-selector2.js +1 -1
- package/dist/module/terminals-list-core2.js +1 -1
- package/dist/webcomponents/p-02f4b072.entry.js +1 -0
- package/dist/webcomponents/{p-f016d034.entry.js → p-04169a4a.entry.js} +1 -1
- package/dist/webcomponents/{p-35198019.entry.js → p-04209892.entry.js} +1 -1
- package/dist/webcomponents/{p-54cc3fc8.entry.js → p-04b38d61.entry.js} +1 -1
- package/dist/webcomponents/{p-e86c876e.entry.js → p-0c06ede5.entry.js} +1 -1
- package/dist/webcomponents/p-18a23b4a.entry.js +1 -0
- package/dist/webcomponents/{p-61849552.entry.js → p-1c79237c.entry.js} +1 -1
- package/dist/webcomponents/{p-74929b71.entry.js → p-207f4e07.entry.js} +1 -1
- package/dist/webcomponents/p-20cff97a.entry.js +1 -0
- package/dist/webcomponents/p-21dd7b38.entry.js +1 -0
- package/dist/webcomponents/{p-fffd5bc7.entry.js → p-2cbc2dcd.entry.js} +1 -1
- package/dist/webcomponents/{p-62c752a1.entry.js → p-35bc4279.entry.js} +1 -1
- package/dist/webcomponents/p-3fb1b0be.entry.js +1 -0
- package/dist/webcomponents/{p-055f8380.entry.js → p-487fd882.entry.js} +1 -1
- package/dist/webcomponents/p-6ab71dc9.entry.js +1 -0
- package/dist/webcomponents/{p-4bae955b.entry.js → p-6b9dfd09.entry.js} +1 -1
- package/dist/webcomponents/p-73da14c6.entry.js +1 -0
- package/dist/webcomponents/{p-c8cf74fa.entry.js → p-7db0847f.entry.js} +1 -1
- package/dist/webcomponents/{p-c58e5f24.entry.js → p-90a2875b.entry.js} +1 -1
- package/dist/webcomponents/p-935f8208.entry.js +1 -0
- package/dist/webcomponents/{p-00fa3a2c.entry.js → p-948066ff.entry.js} +1 -1
- package/dist/webcomponents/p-9b57e831.entry.js +1 -0
- package/dist/webcomponents/p-9ed95478.entry.js +1 -0
- package/dist/webcomponents/{p-k0Ii-jgH.js → p-CDmdt8BH.js} +1 -1
- package/dist/webcomponents/p-HMZ8vsvN.js +1 -0
- package/dist/webcomponents/{p-801cab54.entry.js → p-a60c67e6.entry.js} +1 -1
- package/dist/webcomponents/{p-7b5e899e.entry.js → p-ab3e7841.entry.js} +1 -1
- package/dist/webcomponents/{p-b5717f03.entry.js → p-b0f90f5d.entry.js} +1 -1
- package/dist/webcomponents/{p-367338c8.entry.js → p-b1301f92.entry.js} +1 -1
- package/dist/webcomponents/{p-b120e132.entry.js → p-b6d05490.entry.js} +1 -1
- package/dist/webcomponents/p-bb481c67.entry.js +1 -0
- package/dist/webcomponents/p-bbff3166.entry.js +1 -0
- package/dist/webcomponents/{p-90788382.entry.js → p-be4c5b34.entry.js} +1 -1
- package/dist/webcomponents/p-bf4d2e69.entry.js +1 -0
- package/dist/webcomponents/p-c48279fc.entry.js +1 -0
- package/dist/webcomponents/p-c919d553.entry.js +1 -0
- package/dist/webcomponents/{p-378db83c.entry.js → p-c983e9bb.entry.js} +1 -1
- package/dist/webcomponents/p-d16d97a4.entry.js +1 -0
- package/dist/webcomponents/{p-7cbfa878.entry.js → p-df82aca6.entry.js} +1 -1
- package/dist/webcomponents/p-e19e47eb.entry.js +1 -0
- package/dist/webcomponents/{p-cd6c6c2b.entry.js → p-e3dabf77.entry.js} +1 -1
- package/dist/webcomponents/{p-01f792ac.entry.js → p-e5ae45c3.entry.js} +1 -1
- package/dist/webcomponents/p-f18076ba.entry.js +1 -0
- package/dist/webcomponents/{p-a67b6e78.entry.js → p-f2bae759.entry.js} +1 -1
- package/dist/webcomponents/{p-9327f8c1.entry.js → p-f3f8a5a2.entry.js} +1 -1
- package/dist/webcomponents/p-fb6723b7.entry.js +1 -0
- package/dist/webcomponents/{p-2ce1bc94.entry.js → p-fcc30769.entry.js} +1 -1
- package/dist/webcomponents/p-fddcf426.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-41a410ca.entry.js +0 -1
- package/dist/webcomponents/p-453bcb9d.entry.js +0 -1
- package/dist/webcomponents/p-467d1dcc.entry.js +0 -1
- package/dist/webcomponents/p-509d9191.entry.js +0 -1
- package/dist/webcomponents/p-52be4ff0.entry.js +0 -1
- package/dist/webcomponents/p-54ff0e4f.entry.js +0 -1
- package/dist/webcomponents/p-5c82e024.entry.js +0 -1
- package/dist/webcomponents/p-6f94530d.entry.js +0 -1
- package/dist/webcomponents/p-79454e79.entry.js +0 -1
- package/dist/webcomponents/p-79684a85.entry.js +0 -1
- package/dist/webcomponents/p-7b5d48f7.entry.js +0 -1
- package/dist/webcomponents/p-7d59de81.entry.js +0 -1
- package/dist/webcomponents/p-7f4305a2.entry.js +0 -1
- package/dist/webcomponents/p-D2Cx_K3D.js +0 -1
- package/dist/webcomponents/p-a4cb4c39.entry.js +0 -1
- package/dist/webcomponents/p-a55b110c.entry.js +0 -1
- package/dist/webcomponents/p-b56d75d5.entry.js +0 -1
- package/dist/webcomponents/p-b5ed41c0.entry.js +0 -1
- package/dist/webcomponents/p-b7bb1ae9.entry.js +0 -1
- package/dist/webcomponents/p-baaef16c.entry.js +0 -1
- package/dist/webcomponents/p-dfbf0089.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as s}from"./p-kpoIU4v_.js";import{f as i}from"./p-B7jE0g5_.js";import{z as a,am as r}from"./p-D3G5aVLy.js";import{B as d}from"./p-Cm_ywVHL.js";import{S as c}from"./p-CRFzwZW6.js";import{S as o}from"./p-Bz8JT676.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-DiWKhLRS.js";import{D as u}from"./p-Bg2SZArf.js";import{c as b,J as y}from"./p-k0Ii-jgH.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2Cx_K3D.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event")}acceptDispute(){m({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"0f1028825a7a96a06e7219518ffed54bc0db1b2b"},this.isLoading&&s("div",{key:"f4b704182a5a7085827854634d38c56423cc2e1b",style:{marginBottom:"8px"}},s(o,{key:"b2062d8b683ab110c26fc30f1600c4500f668d87",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"b5d2afe1fdd2e5ee0ec60048a48778bcfa6c78d3",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"1e87c8936b3f2e26e680786927c5a4609aca0b83",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"49090493e3921353b7a830397795496bb234d112",part:a},s("h1",{key:"fd7b56a7cfeaa6820bf2cc121575314d075b5a83",class:"h4",part:r},"This payment is disputed"),s("p",{key:"72ba296695928baca8f7c5c3b1f858c596efedb2"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"cce733ff1bbca7a9530a442035cbae2995e018e7",class:"h5"},"Dispute details"),s("div",{key:"28b7f081e345112d99c52d05f205734995617253",class:"d-table gap-2"},s("div",{key:"d9476d8d0adfa3c6eccad229e94cd3824a720c7d",class:"d-table-row gap-2"},s("span",{key:"4d9e0714eee778c326ee1d70a32f79d90d3d4b09",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"b227edcf9b4b65b790d8aa98021d2662a12855bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"b1b1cdaac5482f565a6f26af71c0b526b8c19f4e",class:"d-table-row gap-2"},s("span",{key:"0a479a9de96cce6e42bec90a17affe2c93ced44f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"5d5020dda571f4465e2a358880ad5f20bc6171ea",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"a5f42c3fcbb5d14f8479d0a576d31a50f8fc6441",class:"d-table-row gap-2"},s("span",{key:"280fca5a101eb0e823eb9ccc13c746ac7ed62069",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"4dfc0b9a295ffc804b708d3590358256009e5376",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"654e7baccd08628bc90d050bad108011b49f9972",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"d0817cdb23bf33086c6ce5122f4ed5388027d96c",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"5446bef44a0ca747692d59fd5490409d00a9e285",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"17fbc5902badc4230c5485b326f480180c844768"},s("h1",{key:"fefa0234306588d9e7f56733872bf8c9793f51dd",class:"h4"},"This payment is disputed and under review"),s("p",{key:"eaad72aa8d9f65ca296379a2800180878ec8a7e5"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"ec1b0d728a7518f913c2a69976fa1f5fc8f76c74"},s("h1",{key:"9d42fad15fbeee507e2f364c3a35f143ff7599e2",class:"h4"},"This payment was disputed"),s("p",{key:"3b728a5544fe17a6c58c12f7e8eef290022945b6"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"6d1813508a657265546fbef00bd1e8f46ffaf740"},s("h1",{key:"de981fc2e06e860f47146647975965a903a39b55",class:"h4"},"This payment was disputed"),s("p",{key:"4e57ab86518bd678a3a5402b712d40d573b3a970"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"dbdfd59a21c7e8ea4dfdaecb91f885f82540a27c"},s("justifi-dispute-response-core",{key:"3cff38e5995f0033c45c54fa195ffeebc27e189e","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.stepCompleteEvent=t(this,"complete-form-step-event"),this.submitEvent=t(this,"submit-event"),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"20d075178a9d88cd73be32e52f8df6d3d360f8d7",class:"row gy-3"},s("div",{key:"6c1bc735f1a15709c596b5bea7cc3ce50e9a73f5",class:"col-12"},s("h1",{key:"27a0804924937ee7a8d01265bd0da2d9dd31d301",class:"h4",part:r},"Counter dispute")),s("div",{key:"b60822e91425c5c4af003169f47fd725daf9fb0f",class:"col-12"},this.currentStepComponent),s("div",{key:"d1be3f6be53de37836275067070cf4b5a2eb3e4a",class:"col-12"},s("div",{key:"48c8725d8de8b658e59ccfa851a6af6638e19ca5",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{v as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
|
|
1
|
+
import{r as e,c as t,h as s}from"./p-kpoIU4v_.js";import{f as i}from"./p-B7jE0g5_.js";import{z as a,am as r}from"./p-D3G5aVLy.js";import{B as d}from"./p-Cm_ywVHL.js";import{S as c}from"./p-CRFzwZW6.js";import{S as o}from"./p-Bz8JT676.js";import"./p-CZfYo5-1.js";import{C as n,a as h}from"./p-Cjcsf8ku.js";import{g as p,a as f}from"./p-D2muobcE.js";import{D as l}from"./p-DiWKhLRS.js";import{D as u}from"./p-Bg2SZArf.js";import{c as b,J as y}from"./p-CDmdt8BH.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-HMZ8vsvN.js";const m=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},v=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.submitEvent=t(this,"submit-event")}acceptDispute(){m({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"0f1028825a7a96a06e7219518ffed54bc0db1b2b"},this.isLoading&&s("div",{key:"f4b704182a5a7085827854634d38c56423cc2e1b",style:{marginBottom:"8px"}},s(o,{key:"b2062d8b683ab110c26fc30f1600c4500f668d87",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"b5d2afe1fdd2e5ee0ec60048a48778bcfa6c78d3",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"1e87c8936b3f2e26e680786927c5a4609aca0b83",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"49090493e3921353b7a830397795496bb234d112",part:a},s("h1",{key:"fd7b56a7cfeaa6820bf2cc121575314d075b5a83",class:"h4",part:r},"This payment is disputed"),s("p",{key:"72ba296695928baca8f7c5c3b1f858c596efedb2"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"cce733ff1bbca7a9530a442035cbae2995e018e7",class:"h5"},"Dispute details"),s("div",{key:"28b7f081e345112d99c52d05f205734995617253",class:"d-table gap-2"},s("div",{key:"d9476d8d0adfa3c6eccad229e94cd3824a720c7d",class:"d-table-row gap-2"},s("span",{key:"4d9e0714eee778c326ee1d70a32f79d90d3d4b09",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"b227edcf9b4b65b790d8aa98021d2662a12855bc",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"b1b1cdaac5482f565a6f26af71c0b526b8c19f4e",class:"d-table-row gap-2"},s("span",{key:"0a479a9de96cce6e42bec90a17affe2c93ced44f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"5d5020dda571f4465e2a358880ad5f20bc6171ea",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"a5f42c3fcbb5d14f8479d0a576d31a50f8fc6441",class:"d-table-row gap-2"},s("span",{key:"280fca5a101eb0e823eb9ccc13c746ac7ed62069",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"4dfc0b9a295ffc804b708d3590358256009e5376",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"654e7baccd08628bc90d050bad108011b49f9972",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"d0817cdb23bf33086c6ce5122f4ed5388027d96c",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"5446bef44a0ca747692d59fd5490409d00a9e285",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"17fbc5902badc4230c5485b326f480180c844768"},s("h1",{key:"fefa0234306588d9e7f56733872bf8c9793f51dd",class:"h4"},"This payment is disputed and under review"),s("p",{key:"eaad72aa8d9f65ca296379a2800180878ec8a7e5"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"ec1b0d728a7518f913c2a69976fa1f5fc8f76c74"},s("h1",{key:"9d42fad15fbeee507e2f364c3a35f143ff7599e2",class:"h4"},"This payment was disputed"),s("p",{key:"3b728a5544fe17a6c58c12f7e8eef290022945b6"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"6d1813508a657265546fbef00bd1e8f46ffaf740"},s("h1",{key:"de981fc2e06e860f47146647975965a903a39b55",class:"h4"},"This payment was disputed"),s("p",{key:"4e57ab86518bd678a3a5402b712d40d573b3a970"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event"),this.errorMessage=null,this.apiOrigin="https://wc-proxy.justifi.ai",this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)}}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=()=>{}})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:f(d.error),code:p(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=p(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=m({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"dbdfd59a21c7e8ea4dfdaecb91f885f82540a27c"},s("justifi-dispute-response-core",{key:"3cff38e5995f0033c45c54fa195ffeebc27e189e","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.stepCompleteEvent=t(this,"complete-form-step-event"),this.submitEvent=t(this,"submit-event"),this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"20d075178a9d88cd73be32e52f8df6d3d360f8d7",class:"row gy-3"},s("div",{key:"6c1bc735f1a15709c596b5bea7cc3ce50e9a73f5",class:"col-12"},s("h1",{key:"27a0804924937ee7a8d01265bd0da2d9dd31d301",class:"h4",part:r},"Counter dispute")),s("div",{key:"b60822e91425c5c4af003169f47fd725daf9fb0f",class:"col-12"},this.currentStepComponent),s("div",{key:"d1be3f6be53de37836275067070cf4b5a2eb3e4a",class:"col-12"},s("div",{key:"48c8725d8de8b658e59ccfa851a6af6638e19ca5",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{v as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as a}from"./p-kpoIU4v_.js";import{l as t}from"./p-Bde7dY9t.js";import{f as s,p as d,c as i}from"./p-DaDsBt65.js";import{f as l,g as r,t as c,h as o,j as p,k as b}from"./p-D3G5aVLy.js";import{S as n}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{c as f,a as m}from"./p-B7jE0g5_.js";import"./p-BFTU3MAI.js";import"./p-7WIgS5RM.js";const u=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{s[e]=a},this.handleDateInput=(e,a)=>{const t=f(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({payment_id:this.paymentId,terminal_id:this.terminalId,payment_status:this.paymentStatus,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(d[e]=a)}))}get paymentStatusOptions(){return[{label:"All",value:""},{label:"Pending",value:"pending"},{label:"Authorized",value:"authorized"},{label:"Succeeded",value:"succeeded"},{label:"Failed",value:"failed"},{label:"Disputed",value:"disputed"},{label:"Refunded",value:"refunded"}]}render(){const e=Object.assign({},s);return a(n,{key:"8aba022fe4424789146723f919f5199c36a7c097"},a("table-filters-menu",{key:"38d8465fc57343caa10693e8cabdb82454d61a5e",params:e,clearParams:i,part:l},a("div",{key:"450d7b50e8b6d566539e2556a68a2902eb7602d2",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"d371788631aaac9197d3ae3b1178948c91c6e5c1",class:"p-2"},a("form-control-text",{key:"9c72f274a1993bd35364401484b83e026e7a1e28",name:"payment_id",label:"Payment ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.paymentId||s.payment_id,disabled:!!this.paymentId,part:r})),a("div",{key:"8172fb6ed0b92e6f9bbfa7c318d5ca4bd987ecac",class:"p-2"},a("form-control-text",{key:"b9ed00d0cfe7c5580515fd8da24c51676d5e30a8",name:"terminal_id",label:"Terminal ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.terminalId||s.terminal_id,disabled:!!this.terminalId,part:c})),a("div",{key:"ab8aa770e553e83ccecb2c29be2546e98b10aa25",class:"p-2"},a("form-control-select",{key:"b6c7af7c4b1a62c7a40cefd4df75093863f66bf8",name:"payment_status",label:"Status",options:this.paymentStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentStatus||s.payment_status,disabled:!!this.paymentStatus,part:o})),a("div",{key:"b0ca780bae36a8a5aa11eb96e49d17326d4d575b",class:"p-2"},a("form-control-date",{key:"df0aacad0d323cb67bc2521bd5d581632059341c",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:m(this.createdAfter,{showInputDateTime:!0})||m(s.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:p})),a("div",{key:"c68669b6466711c96e2ead262506204884d38e55",class:"p-2"},a("form-control-date",{key:"9fe44d67c5079b271d1de78ec5b097897f562bd4",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:m(this.createdBefore,{showInputDateTime:!0})||m(s.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:b})))))}};export{u as justifi_payments_list_filters}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,c as a}from"./p-kpoIU4v_.js";import{d as s,b as c}from"./p-B7jE0g5_.js";import{a as i,b as d,D as r,c as f,C as o,E as l}from"./p-CEYGUVns.js";import{B as b}from"./p-Cm_ywVHL.js";import{S as h}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{M as n}from"./p-BFL-wXPM.js";import{S as y}from"./p-Bz8JT676.js";import{a as p,B as v}from"./p-DCDU6JB3.js";import"./p-D3G5aVLy.js";const u=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(y,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(y,{width:"70%"})),e("div",{class:"col-12"},e(y,{width:"40%"})),e("div",{class:"col-12"},e(y,{width:"40%"})),e("div",{class:"col-12"},e(y,{width:"100%"})),e("div",{class:"col-12"},e(y,{width:"80%"}))),m=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event"),this.loading=!0,this.errorMessage=null,this.downloadCSV=()=>{this.getPayoutCSV({payoutId:this.payout.id,onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a})}})}}componentWillLoad(){this.getPayout&&this.fetchData()}getPayoutWatcher(){this.fetchData()}fetchData(){this.loading=!0,this.getPayout({onSuccess:e=>{this.errorMessage=null,this.payout=e,this.loading=!1},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a}),this.loading=!1}})}render(){var t;return e(h,{key:"f2e62decda12ccb5a81b98522ce7b567055ba2e7"},this.loading&&e(u,{key:"565b3d560e7d08c083c1304a91acc247ca0d3ab6"}),!this.loading&&this.errorMessage&&l(this.errorMessage),!this.loading&&this.payout&&e("justifi-details",{key:"128283a1b588d080a714ffce407aa259f6a49a13","error-message":this.errorMessage},e(i,{key:"912a9fe1e04543306e1956305c0e7bcf42e4e7f0",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},n(null===(t=this.payout)||void 0===t?void 0:t.status),e(p,"expedited"===this.payout.settlement_priority?{variant:v.WARNING,title:"Expedited",text:"Expedited"}:{variant:v.SECONDARY,title:"Standard",text:"Standard"})),title:this.payout.formattedPaymentAmount(this.payout.amount)},e(d,{key:"02af0ad3fec493224a016dcfb3e4a0650956efc9",classes:"border-1 border-end",title:"Updated At",value:`${s(this.payout.updated_at)} ${c(this.payout.updated_at)}`}),e(d,{key:"6de8a05995fdd19abc8d974cb2cef8ac6b7aa8c1",classes:"border-1 border-end",title:"Created At",value:`${s(this.payout.created_at)} ${c(this.payout.created_at)}`}),e(d,{key:"5523501f19646e8cfed3dc9abe12cbbba9ee9299",title:"ID",value:this.payout.id}),e("div",{key:"29206ce4d15a105dad4f033d484c755ad1296609",class:"m-4"},e(b,{key:"14237cf7f8b767b9dbf3850dc9e7504d9fc6fb17",variant:"secondary",class:"btn btn-outline-secondary d-flex align-items-center",onClick:this.downloadCSV},"Export CSV"))),e("div",{key:"3d6a21530c49af49069ecab49ce2052b11a6c1ab",slot:"detail-sections"},e(r,{key:"1b31ef957c70e29d7cdea6b2b92f246649df03f2",sectionTitle:"Details"}),e("div",{key:"4ff391bd564e843dc40f560c39368545c881c6d8",class:"d-table gap-2 w-100"},e(f,{key:"438f715cc5a289970ab368244097f13d498b0511",title:"Date paid",value:s(this.payout.deposits_at)}),e(f,{key:"0b65234526127fddb4243acb20a45d7ceacc5201",title:"Statement Description",value:this.payout.description}),e(f,{key:"7cbfad705a6b9018455d7c057c98ac01dba1a130",title:"Payout Method",value:this.payout.delivery_method}),e(f,{key:"39f053361e28d235d42b2c43422dd4136f608d0b",title:"Amount",value:this.payout.formattedPaymentAmount(this.payout.amount)}),e(f,{key:"4068f10731040596c941ed513f361492ffb8cd46",title:"Fee",value:this.payout.formattedPaymentAmount(this.payout.fees_total)})),e(r,{key:"421827d798d72320089ce93c7c782ef0e43faf77",sectionTitle:"Account"}),e("div",{key:"e60b895bde0a2dbfc99daf3811337d98e0a0042b",class:"d-table gap-2 w-100"},e(f,{key:"ec885b1806af82f45444ffcf24afacb6812c4ace",title:"ID",value:this.payout.account_id}),e(f,{key:"90f5499eca649a2ebb8a6a988ca9ada61bacc9ff",title:"Account Type",value:this.payout.bank_account.account_type}),e(f,{key:"4d07f2ed084eabc2903bcc9a35ceae0ea6ea3833",title:"Institution",value:this.payout.bank_account.account_type}),e(f,{key:"26a8f03032441d445415cc3db75c12015220ff32",title:"Routing Number",value:this.payout.bank_account.routing_number}),e(f,{key:"ba4cc41095ee5afedbfd351d72016b3e17297647",title:"Account Number",value:this.payout.bank_account.account_number_last4})),this.payout.metadata&&[e(r,{key:"094777aac3ff8aa7a5c7a98f5470564955e4ccb7",sectionTitle:"Metadata"}),e("div",{key:"977175f6c6fa6920f27c101a9f39ecba762796fc",class:"d-table gap-2 w-100"},e(o,{key:"0a5096720505436e4048574fe62c6acd0543667d",metadata:this.payout.metadata}))])))}static get watchers(){return{getPayout:["getPayoutWatcher"]}}};export{m as payout_details_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as
|
|
1
|
+
import{r as t,c as s,h as a,H as e,g as i}from"./p-kpoIU4v_.js";import{c as o,l as r,b as h,T as l,a as c,aj as n,ak as d,al as f}from"./p-D3G5aVLy.js";import{F as p}from"./p-D522G7Ja.js";import"./p-CZfYo5-1.js";const u=class{constructor(a){t(this,a),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.isFocused=!1,this.handleFormControlInput=t=>{const s=t.target,a=s.getAttribute("name");this.inputHandler(a,s.value),this.formControlInput.emit(s.value)},this.updateInput=t=>{this.selectElement.value=t}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){let t=o;return this.errorText&&(t=h),this.disabled&&(t=l),this.isFocused&&(t=c),t}render(){var t;return a(e,{key:"a7428cd8a89414d877dafe9948f5652f28c36a5f"},a("div",{key:"c9d5d5d2f8a6292484d3606d883dbb9d168aa316",class:"form-group d-flex flex-column"},a("div",{key:"c1aba6560934b966de02e9afef77428c6060eefb",class:"d-flex align-items-start gap-2"},a("label",{key:"5fbbb09c3955ff3285b006f24c3873082394d39c",part:r,class:"form-label",htmlFor:this.name},this.label),a("form-control-tooltip",{key:"f756a05a8273ab6fd65205bb5c32cd34c30a9db3",helpText:this.helpText})),a("select",{key:"ffd0fa461d3c35da5595e705a7c4068066d8f971",ref:t=>this.selectElement=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-select is-invalid":"form-select",disabled:this.disabled},null===(t=this.options)||void 0===t?void 0:t.map((t=>a("option",{value:t.value},t.label)))),a(p,{key:"6ee60bb236ccf7cea7bc8ccf946a363d2cd26906",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}},m=class{constructor(a){t(this,a),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.isFocused=!1,this.handleFormControlInput=t=>{const s=t.target,a=s.getAttribute("name");this.inputHandler(a,s.value),this.formControlInput.emit({name:a,value:s.value})},this.updateInput=t=>{const s=this.el.querySelector("input");s&&(s.value=t||"")}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.errorText?h:this.disabled?l:this.isFocused?c:o}render(){return a(e,{key:"68ed9ee7ba3c4c33e3047a4ae95170518d0998ae"},a("div",{key:"62db9a3f0478e12346e5872e284ffc21d019109e",class:"form-group d-flex flex-column"},a("div",{key:"6393a547f640b8d089f4dadf04e2e18b25911b15",class:"d-flex align-items-start gap-2"},a("label",{key:"f85ecc2ffb78a2253b391a74599c91332b923ef1",part:r,class:"form-label",htmlFor:this.name},this.label),a("form-control-tooltip",{key:"0545d73dd5201a92ff783ba020d420d1c38aa428",helpText:this.helpText})),a("input",{key:"8e4da743a340b3dc80a62376f1b93c01921a4995",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled}),a(p,{key:"f231489de0a377cec17ee031a2431ae709f8347d",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}},b=class{constructor(s){t(this,s)}show(){this.tooltip.classList.add("show")}hide(){this.tooltip.classList.remove("show")}render(){return this.helpText?a("div",{class:"tooltip-container"},a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-question-square tooltip-icon",viewBox:"0 0 16 16",ref:t=>this.anchorIcon=t,part:f},a("path",{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"}),a("path",{d:"M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94"})),a("custom-popper",{trigger:"hover",placement:"top",anchorRef:this.anchorIcon},a("div",{class:"tooltip bs-tooltip-top",part:n,role:"tooltip",ref:t=>this.tooltip=t},a("div",{class:"tooltip-inner",part:d},this.helpText)))):null}};export{u as form_control_select,m as form_control_text,b as form_control_tooltip}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,c as s,H as i,g as o}from"./p-kpoIU4v_.js";import{S as r}from"./p-CRFzwZW6.js";import{B as a}from"./p-Cm_ywVHL.js";import{z as c,r as d}from"./p-D3G5aVLy.js";import{f as h}from"./p-B7jE0g5_.js";import{c as n,o as l}from"./p-BYakc1Om.js";import"./p-CZfYo5-1.js";import{H as p}from"./p-Cc27pPPQ.js";import{H as u,b as m,i as y}from"./p-vHbP4g3Q.js";import{H as f}from"./p-CLjv4frq.js";import{J as v,c as b}from"./p-k0Ii-jgH.js";import"./p-9y5MOK55.js";import{C as k,a as j,b as C}from"./p-Cjcsf8ku.js";import{I as g}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as P,a as _}from"./p-D2muobcE.js";import{C as w}from"./p-C0EFqY0W.js";import"./p-7WIgS5RM.js";import"./p-D2Cx_K3D.js";import"./p-Dj1uo4J3.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const A=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return t(r,{key:"89057d5d72b67b613e4846165ea8d2bf5c79482d"},t(a,{key:"2bfa0c22898e703a36fb59b1060da35b362f6efa",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},E=class{constructor(t){e(this,t)}render(){return t(r,{key:"dbe9b02315fe34f0765b04d1f56758eeafbec247"},t("section",{key:"8d55dbe1ed13f4d565eac71600dc53c4d29f9d2f"},t("div",{key:"d3b27f48a23b448680abae596531905ea198b4b0"},t("div",{key:"1df204481e044414825de33640d3b13e73bd44a2",part:c},null==n?void 0:n.paymentDescription),t("div",{key:"7734088f6171a77e56cbf3434de7a892949812d4"},t("span",{key:"ed855b2d6f02d316dcdc5e8c6d3309b4919c560e",part:c},"Total")," ",t("span",{key:"c352cf6089c2c4d8b2fc57776acd45991880fe3f",part:c},h(+(null==n?void 0:n.totalAmount)))))))}},L=class{constructor(t){e(this,t),this.levels={h1:p,h2:u,h3:f},this.level="h1"}render(){return t(r,{key:"0ea6499e12267cc11baa3e88b24b06aae5add667"},t(this.levels[this.level],{key:"d2e1d462e946d129890187b320db0b8006f505f7",text:this.text,class:this.class}))}},M=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event"),this.submitEvent=s(this,"submit-event"),this.paymentMethodChangedEvent=s(this,"payment-method-changed"),this.savePaymentMethod=!1,this.handleApplePayCompleted=e=>{const{success:t,token:s,error:i}=e.detail;t&&s?(this.applePayToken=s,this.submitCheckoutWithApplePay()):(console.error("Apple Pay completed but failed:",i),this.errorEvent.emit({message:(null==i?void 0:i.message)||"Apple Pay payment failed",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR}))},this.handleApplePayError=e=>{const{error:t}=e.detail;console.error("Apple Pay error:",t),this.errorEvent.emit({message:t||"Apple Pay error occurred",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})},this.handleApplePayCancelled=()=>{console.log("Apple Pay cancelled by user"),this.applePayToken=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),n.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new w};this.getCheckout=(({authToken:e,checkoutId:t,service:s})=>async({onSuccess:i,onError:o})=>{var r;try{const a=await s.fetchCheckout(e,t);if(a.error)return o({error:_(a.error),code:P(null===(r=a.error)||void 0===r?void 0:r.code),severity:k.ERROR});i({checkout:a.data})}catch(e){const t=P(null==e?void 0:e.code);return o({error:e.message||e,code:t,severity:k.ERROR})}})(e),this.completeCheckout=(({authToken:e,checkoutId:t,service:s})=>async({payment:i,onSuccess:o,onError:r})=>{var a;try{const c=await s.complete(e,t,i);if(c.error)return r({error:_(c.error),code:P(null===(a=c.error)||void 0===a?void 0:a.code),severity:k.ERROR});o({checkout:c.data})}catch(e){const t=P(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:k.ERROR})}})(e),l("selectedPaymentMethod",(e=>{this.paymentMethodChangedEvent.emit(e)}))}componentWillLoad(){this.authToken&&this.checkoutId?(this.analytics=new v(this),b(),n.authToken=this.authToken,this.fetchCheckout(),m("set",(e=>{void 0!==y[e]&&this.fetchCheckout()}))):this.errorEvent.emit({message:C.NOT_AUTHENTICATED,errorCode:j.NOT_AUTHENTICATED,severity:k.ERROR})}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.getCheckout&&this.getCheckout({onSuccess:({checkout:e})=>{e.status!==g.completed?e.status!==g.expired?this.updateStore(e):this.errorEvent.emit({message:C.CHECKOUT_EXPIRED,errorCode:j.CHECKOUT_EXPIRED,severity:k.ERROR}):this.errorEvent.emit({message:C.CHECKOUT_ALREADY_COMPLETED,errorCode:j.CHECKOUT_ALREADY_COMPLETED,severity:k.ERROR})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.FETCH_ERROR,severity:k.ERROR})}})}updateStore(e){var t,s,i,o;n.accountId=e.account_id,n.paymentMethods=e.payment_methods,n.paymentMethodGroupId=e.payment_method_group_id,n.paymentDescription=e.payment_description,n.totalAmount=e.total_amount,n.paymentAmount=e.payment_amount,n.bnplEnabled=e.payment_settings.bnpl_payments,n.bnplProviderClientId=null===(t=null==e?void 0:e.bnpl)||void 0===t?void 0:t.provider_client_id,n.bnplProviderMode=null===(s=null==e?void 0:e.bnpl)||void 0===s?void 0:s.provider_mode,n.bnplProviderApiVersion=null===(i=null==e?void 0:e.bnpl)||void 0===i?void 0:i.provider_api_version,n.bnplProviderCheckoutUrl=null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.provider_checkout_url}queryFormRefs(){this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form"),this.billingInformationFormRef=this.hostEl.querySelector("justifi-billing-information-form, justifi-postal-code-form"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance"),this.sezzlePaymentMethodRef=this.hostEl.querySelector("justifi-sezzle-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async submitCheckoutWithApplePay(){this.applePayToken?this.completeCheckout({payment:{payment_mode:"apple_pay",payment_token:this.applePayToken},onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Apple Pay checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}}):this.errorEvent.emit({message:"No Apple Pay token available",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})}async tokenizePaymentMethod(e){var t,s;const i=null!==(s=await(null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.getValues()))&&void 0!==s?s:{},o=Object.assign(Object.assign({},e),i),r=Object.assign({accountId:n.accountId,payment_method_group_id:void 0},o);return this.savePaymentMethod&&(r.payment_method_group_id=n.paymentMethodGroupId),this.paymentMethodFormRef.tokenize({clientId:this.authToken,paymentMethodMetadata:r,account:n.accountId})}async getPaymentMethod(e){if(this.applePayToken)return"apple_pay_token";if(!this.paymentMethodFormRef)return n.selectedPaymentMethod;const{error:t,id:s}=await this.tokenizePaymentMethod(e);if(!t)return s;this.errorEvent.emit({errorCode:t.code,message:t.message,severity:k.ERROR})}async validate(){var e,t;if(this.applePayToken)return!0;const s=[null===(e=this.paymentMethodFormRef)||void 0===e?void 0:e.validate(),null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.validate()];return this.insuranceFormRef&&s.push(this.insuranceFormRef.validate()),(await Promise.all(s)).every((e=>!1!==(null==e?void 0:e.isValid)))}async submitCheckout(e){var t;if(this.applePayToken)return void await this.submitCheckoutWithApplePay();if(!await this.validate())return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:j.VALIDATION_ERROR,severity:k.ERROR});let s;if("sezzle"===n.selectedPaymentMethod){const e=this.insuranceFormRef?await this.insuranceFormRef.validate():{isValid:!0},i=await this.sezzlePaymentMethodRef.resolvePaymentMethod(e);if(i.error)return void this.errorEvent.emit({message:i.error.message,errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});"success"===(null===(t=i.bnpl)||void 0===t?void 0:t.status)&&(s={payment_mode:"bnpl",payment_token:void 0})}else{const t=await this.getPaymentMethod(e);if(!t)return void this.errorEvent.emit({message:"Payment method tokenization failed.",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});s={payment_mode:"ecom",payment_token:t}}this.completeCheckout({payment:s,onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}})}async setSelectedPaymentMethod(e){n.selectedPaymentMethod=e}render(){return t(i,{key:"307608e8cd41e1c262dbca6cda7b0bfc8855dedf"})}get hostEl(){return o(this)}},I=class{constructor(t){e(this,t)}render(){return t(r,{key:"e9069cbe6668585daa972c3d226ef2a901a0b003",class:"payment-method"},t("div",{key:"9ec14865488d43f8007c481a8ba030b5415abf96",class:"radio-list-item p-3",part:d,onClick:this.clickHandler,hidden:this.radioButtonHidden},t("form-control-radio",{key:"146ee9bc2cfc57192db519643f18ed672ac12e77",name:"paymentMethodType",value:this.paymentMethodOptionId,checked:this.isSelected,label:this.label})))}};export{A as justifi_button,E as justifi_checkout_summary,L as justifi_header,M as justifi_modular_checkout,I as payment_method_option}
|
|
1
|
+
import{r as e,h as t,c as s,H as i,g as o}from"./p-kpoIU4v_.js";import{S as r}from"./p-CRFzwZW6.js";import{B as a}from"./p-Cm_ywVHL.js";import{z as c,r as h}from"./p-D3G5aVLy.js";import{f as n}from"./p-B7jE0g5_.js";import{c as d,o as l}from"./p-BYakc1Om.js";import"./p-CZfYo5-1.js";import{H as p}from"./p-Cc27pPPQ.js";import{H as u,b as m,i as y}from"./p-vHbP4g3Q.js";import{H as f}from"./p-CLjv4frq.js";import{J as v,c as b}from"./p-CDmdt8BH.js";import"./p-9y5MOK55.js";import{C as k,a as j,b as C}from"./p-Cjcsf8ku.js";import{I as g}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as P,a as _}from"./p-D2muobcE.js";import{C as w}from"./p-C0EFqY0W.js";import"./p-7WIgS5RM.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const M=class{constructor(t){e(this,t),this.variant="primary",this.type="button"}render(){return t(r,{key:"18d7ab039e1cef7b3e5fea26c0af5f37c36eab14"},t(a,{key:"5ae27b690cf7d7d94cfae966782ff3ff1165f402",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},A=class{constructor(t){e(this,t)}render(){return t(r,{key:"d7aeca995c6793b5b2c12a85eb7c6ce01ab8d025"},t("section",{key:"962bdd1ce83c5464465c41d5b5655b7c1922208e"},t("div",{key:"f8ecf321efae1bfb53cd88c3b32a7b51d0e9bc6a"},t("div",{key:"630c741b4b931e61cad0823eba96f63c7cbdb2e0",part:c},null==d?void 0:d.paymentDescription),t("div",{key:"15be11ce16201a7e3659a01783d9d9b8d5cd5f2b"},t("span",{key:"36e21c27b534551bad9570ccf9628be36ddae05b",part:c},"Total")," ",t("span",{key:"d270040198a56e22f8e14e302166a6235e190c99",part:c},n(+(null==d?void 0:d.totalAmount)))))))}},E=class{constructor(t){e(this,t),this.levels={h1:p,h2:u,h3:f},this.level="h1"}render(){return t(r,{key:"2d95ee91f805c2966eb50c1772ee2e02457ddca5"},t(this.levels[this.level],{key:"6afb5a11c91793a29f4b79e67e3cafe2ce1ff977",text:this.text,class:this.class}))}},L=class{constructor(t){e(this,t),this.errorEvent=s(this,"error-event"),this.submitEvent=s(this,"submit-event"),this.paymentMethodChangedEvent=s(this,"payment-method-changed"),this.savePaymentMethod=!1,this.handleApplePayCompleted=e=>{const{success:t,token:s,error:i}=e.detail;t&&s?(this.applePayToken=s,this.submitCheckoutWithApplePay()):(console.error("Apple Pay completed but failed:",i),this.errorEvent.emit({message:(null==i?void 0:i.message)||"Apple Pay payment failed",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR}))},this.handleApplePayError=e=>{const{error:t}=e.detail;console.error("Apple Pay error:",t),this.errorEvent.emit({message:t||"Apple Pay error occurred",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})},this.handleApplePayCancelled=()=>{console.log("Apple Pay cancelled by user"),this.applePayToken=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),d.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new w};this.getCheckout=(({authToken:e,checkoutId:t,service:s})=>async({onSuccess:i,onError:o})=>{var r;try{const a=await s.fetchCheckout(e,t);if(a.error)return o({error:_(a.error),code:P(null===(r=a.error)||void 0===r?void 0:r.code),severity:k.ERROR});i({checkout:a.data})}catch(e){const t=P(null==e?void 0:e.code);return o({error:e.message||e,code:t,severity:k.ERROR})}})(e),this.completeCheckout=(({authToken:e,checkoutId:t,service:s})=>async({payment:i,onSuccess:o,onError:r})=>{var a;try{const c=await s.complete(e,t,i);if(c.error)return r({error:_(c.error),code:P(null===(a=c.error)||void 0===a?void 0:a.code),severity:k.ERROR});o({checkout:c.data})}catch(e){const t=P(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:k.ERROR})}})(e),l("selectedPaymentMethod",(e=>{this.paymentMethodChangedEvent.emit(e)}))}componentWillLoad(){this.authToken&&this.checkoutId?(this.analytics=new v(this),b(),d.authToken=this.authToken,this.fetchCheckout(),m("set",(e=>{void 0!==y[e]&&this.fetchCheckout()}))):this.errorEvent.emit({message:C.NOT_AUTHENTICATED,errorCode:j.NOT_AUTHENTICATED,severity:k.ERROR})}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.getCheckout&&this.getCheckout({onSuccess:({checkout:e})=>{e.status!==g.completed?e.status!==g.expired?this.updateStore(e):this.errorEvent.emit({message:C.CHECKOUT_EXPIRED,errorCode:j.CHECKOUT_EXPIRED,severity:k.ERROR}):this.errorEvent.emit({message:C.CHECKOUT_ALREADY_COMPLETED,errorCode:j.CHECKOUT_ALREADY_COMPLETED,severity:k.ERROR})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.FETCH_ERROR,severity:k.ERROR})}})}updateStore(e){var t,s,i,o;d.accountId=e.account_id,d.paymentMethods=e.payment_methods,d.paymentMethodGroupId=e.payment_method_group_id,d.paymentDescription=e.payment_description,d.totalAmount=e.total_amount,d.paymentAmount=e.payment_amount,d.bnplEnabled=e.payment_settings.bnpl_payments,d.bnplProviderClientId=null===(t=null==e?void 0:e.bnpl)||void 0===t?void 0:t.provider_client_id,d.bnplProviderMode=null===(s=null==e?void 0:e.bnpl)||void 0===s?void 0:s.provider_mode,d.bnplProviderApiVersion=null===(i=null==e?void 0:e.bnpl)||void 0===i?void 0:i.provider_api_version,d.bnplProviderCheckoutUrl=null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.provider_checkout_url}queryFormRefs(){this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form"),this.billingInformationFormRef=this.hostEl.querySelector("justifi-billing-information-form, justifi-postal-code-form"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance"),this.sezzlePaymentMethodRef=this.hostEl.querySelector("justifi-sezzle-payment-method"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async submitCheckoutWithApplePay(){this.applePayToken?this.completeCheckout({payment:{payment_mode:"apple_pay",payment_token:this.applePayToken},onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Apple Pay checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}}):this.errorEvent.emit({message:"No Apple Pay token available",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR})}async tokenizePaymentMethod(e){var t,s;const i=null!==(s=await(null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.getValues()))&&void 0!==s?s:{},o=Object.assign(Object.assign({},e),i),r=Object.assign({accountId:d.accountId,payment_method_group_id:void 0},o);return this.savePaymentMethod&&(r.payment_method_group_id=d.paymentMethodGroupId),this.paymentMethodFormRef.tokenize({clientId:this.authToken,paymentMethodMetadata:r,account:d.accountId})}async getPaymentMethod(e){if(this.applePayToken)return"apple_pay_token";if(!this.paymentMethodFormRef)return d.selectedPaymentMethod;const{error:t,id:s}=await this.tokenizePaymentMethod(e);if(!t)return s;this.errorEvent.emit({errorCode:t.code,message:t.message,severity:k.ERROR})}async validate(){var e,t;if(this.applePayToken)return!0;const s=[null===(e=this.paymentMethodFormRef)||void 0===e?void 0:e.validate(),null===(t=this.billingInformationFormRef)||void 0===t?void 0:t.validate()];return this.insuranceFormRef&&s.push(this.insuranceFormRef.validate()),(await Promise.all(s)).every((e=>!1!==(null==e?void 0:e.isValid)))}async submitCheckout(e){var t;if(this.applePayToken)return void await this.submitCheckoutWithApplePay();if(!await this.validate())return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:j.VALIDATION_ERROR,severity:k.ERROR});let s;if("sezzle"===d.selectedPaymentMethod){const e=this.insuranceFormRef?await this.insuranceFormRef.validate():{isValid:!0},i=await this.sezzlePaymentMethodRef.resolvePaymentMethod(e);if(i.error)return void this.errorEvent.emit({message:i.error.message,errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});"success"===(null===(t=i.bnpl)||void 0===t?void 0:t.status)&&(s={payment_mode:"bnpl",payment_token:void 0})}else{const t=await this.getPaymentMethod(e);if(!t)return void this.errorEvent.emit({message:"Payment method tokenization failed.",errorCode:j.TOKENIZE_ERROR,severity:k.ERROR});s={payment_mode:"ecom",payment_token:t}}this.completeCheckout({payment:s,onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:j.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}})}async setSelectedPaymentMethod(e){d.selectedPaymentMethod=e}render(){return t(i,{key:"307608e8cd41e1c262dbca6cda7b0bfc8855dedf"})}get hostEl(){return o(this)}},H=class{constructor(t){e(this,t)}render(){return t(r,{key:"13d81bf8c38b3f59567a8f3414d3ba77c2f4730c",class:"payment-method"},t("div",{key:"d4636ac2cc75bc6f1688aa5aabb64c427c14634e",class:"radio-list-item p-3",part:h,onClick:this.clickHandler,hidden:this.radioButtonHidden},t("form-control-radio",{key:"2e086a0fd3494695c6cc0d95399a4d6fc8805069",name:"paymentMethodType",value:this.paymentMethodOptionId,checked:this.isSelected,label:this.label})))}};export{M as justifi_button,A as justifi_checkout_summary,E as justifi_header,L as justifi_modular_checkout,H as payment_method_option}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-kpoIU4v_.js";import{ap as e,am as r,ae as o,z as l}from"./p-D3G5aVLy.js";import{S as d}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{c as n,J as a}from"./p-CDmdt8BH.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as v}from"./p-DVPcHdzq.js";import{B as u}from"./p-BlJnA265.js";import{m as p}from"./p-DH8F0bsw.js";import{S as m}from"./p-Bz8JT676.js";import"./p-9y5MOK55.js";import{k as f}from"./p-B7jE0g5_.js";import{h as b,g as w,b as g}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import{g as j,a as y}from"./p-D2muobcE.js";import{T as x}from"./p-DtsIovbb.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-7WIgS5RM.js";const k=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(m,{width:"25%"})),s("div",{class:"col-12"},s(m,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(m,{width:"50%"}),s(m,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(m,{width:"65%"}),s(m,{width:"35%"}))),S=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(m,{width:"40%",height:"40px"})),s(k,null)),B=()=>s("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},s("div",{class:"d-flex align-items-center gap-3"},s(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),s("div",{class:"flex-grow-1"},s("div",{class:"d-flex row flex-row"},s("div",{class:"col-6 flex-column"},s(m,null),s(m,{width:"60%"})),s("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},s(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),s(m,{width:"80px",height:"32px"}),s(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),s("div",{class:"mt-4"},s("div",{class:"d-flex flex-column gap-2"},s(m,null),s(m,null)))))),C=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event"),this.submitted=t(this,"submit-event"),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 w({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?g.boardingShipping:g.boardingOnly}),n(),this.analytics=new a(this),this.loadData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}handleError(s,i,t){this.error={message:s,code:i,severity:t},this.errorEvent.emit({errorCode:i,message:s,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new v})({onSuccess:({business:s})=>{this.business=new u(s),this.loading.business=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:s,authToken:i,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,n;try{const a=await t.fetchTerminalModels(s,i);if(a.error)return r({error:y(a.error),code:j(null===(n=a.error)||void 0===n?void 0:n.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=a.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((s=>new b(s))))||[],orderLimit:null===(d=a.data)||void 0===d?void 0:d.order_limit})}catch(s){const i=j(null==s?void 0:s.code);return r({error:s.message||s,code:i,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new x})({onSuccess:({terminals:s,orderLimit:i})=>{this.terminalModels=s,this.orderLimit=i,this.loading.terminals=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.loading.terminals=!1}})}submitOrder(){const s=(({authToken:s,service:i,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await i.orderTerminals(s,e,t);if(d.error)return o({error:y(d.error),code:j(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:s}=d;r({data:s})}}catch(s){const i=j(null==s?void 0:s.code);return o({error:s.message||s,code:i,severity:h.ERROR})}})({authToken:this.authToken,service:new x});this.submitting=!0,s({terminalOrder:this.order.payload,onSuccess:({data:s})=>{this.submitted.emit(s),this.submitting=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.submitting=!1}})}onSelectedQuantityChange(s){this.order.updateTerminal(s.detail.modelName,s.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return s("div",null,this.loading.business&&s(S,null),this.loading.terminals&&s("div",{class:"mt-5"},s(B,null),s(B,null),s(B,null)))}renderBusinessDetails(){var i,t,o,l,d,n,a,h;if(!this.loading.business&&this.business)return s("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},s("div",{class:"row"},s("div",{class:"col-12"},s("h2",{part:r},this.business.legal_name))),s("div",{class:"row"},s("div",{class:"col-6"},s("h5",{part:e},"Representative:"),s("div",null,s("div",null,null===(t=null===(i=this.business)||void 0===i?void 0:i.representative)||void 0===t?void 0:t.name),s("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),s("div",null,null===(n=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===n?void 0:n.email),s("div",null,f(null===(h=null===(a=this.business)||void 0===a?void 0:a.representative)||void 0===h?void 0:h.phone)))),s("div",{class:"col-6"},s("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),s("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",s("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 s("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((i=>s("terminal-quantity-selector",{modelName:i.model_name,description:i.description,imageUrl:i.image_url,helpUrl:i.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return s("div",{class:"mt-3"},s("div",{class:"text-end"},"Order limit: ",this.orderLimit),s("div",{class:"d-flex justify-content-end mt-3"},s("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 s(d,{key:"3c9d82edf60cb15cae0ca399dc72b108eb645da1"},s("div",{key:"cb70067e7bf65760fbe1f3b6c86b705d4f1bb602",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{C as justifi_order_terminals}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as a}from"./p-kpoIU4v_.js";import{c as i}from"./p-9y5MOK55.js";import{a as s}from"./p-B7jE0g5_.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{f as c}from"./p-Bou1Z4Bm.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{c as p,J as d}from"./p-
|
|
1
|
+
import{h as t,r as e,c as a}from"./p-kpoIU4v_.js";import{c as i}from"./p-9y5MOK55.js";import{a as s}from"./p-B7jE0g5_.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{f as c}from"./p-Bou1Z4Bm.js";import{p as n}from"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{c as p,J as d}from"./p-CDmdt8BH.js";import{g as h,a as l}from"./p-D2muobcE.js";import{P as f}from"./p-Sz-UKsNL.js";import{T as u,l as m,a as y,b,c as _,d as w,e as j,f as v,g as T,h as g,i as k,j as D,k as C}from"./p-C8ll3Wwp.js";import{S as I}from"./p-CRFzwZW6.js";import{T as S}from"./p-CZfYo5-1.js";import{N as P,O}from"./p-D3G5aVLy.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-B8tUOqiv.js";const q={id:()=>t("th",{part:P,scope:"col",title:"The unique identifier of each transaction"},"ID"),account_id:()=>t("th",{part:P,scope:"col",title:"The unique identifier of the account associated with each transaction"},"Account ID"),payout_id:()=>t("th",{part:P,scope:"col",title:"The unique identifier of the payout associated with each transaction"},"Payout ID"),financial_transaction_id:()=>t("th",{part:P,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),amount:()=>t("th",{part:P,scope:"col",title:"The dollar amount of each transaction"},"Amount"),fee:()=>t("th",{part:P,scope:"col",title:"The fee associated with each transaction"},"Fee"),net:()=>t("th",{part:P,scope:"col",title:"The net amount of each transaction"},"Net"),currency:()=>t("th",{part:P,scope:"col",title:"The currency of each transaction"},"Currency"),description:()=>t("th",{part:P,scope:"col",title:"The description of each transaction"},"Description"),source_id:()=>t("th",{part:P,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),txn_type:()=>t("th",{part:P,scope:"col",title:"The type of each transaction"},"Type"),created_at:()=>t("th",{part:P,scope:"col",title:"The date and time each transaction was made"},"Processed On"),available_on:()=>t("th",{part:P,scope:"col",title:"The date and time each transaction will be available"},"Available On"),updated_at:()=>t("th",{part:P,scope:"col",title:"The date and time each transaction was last updated"},"Updated On")},B={fee:"Fee",payment:"Payment",payout:"Payout",seller_payment_refund:"Seller Payment Refund",dispute_amount_collected:"Dispute Amount Collected",dispute_fee_collected:"Dispute Fee Collected",seller_payment:"Seller Payment",transfer:"Transfer",partner_platform_proceeds_credit:"Partner Platform Proceeds Credit"},E={id:e=>t("td",{part:O(e.id)},e.id),account_id:e=>t("td",{part:O(e.account_id)},e.account_id),payout_id:e=>t("td",{part:O(e.payout_id)},e.payout_id),financial_transaction_id:e=>t("td",{part:O(e.financial_transaction_id)},e.financial_transaction_id),amount:e=>t("td",{part:O(e.amount)},e.formattedPaymentAmount(e.amount)),fee:e=>t("td",{part:O(e.fee)},e.formattedPaymentAmount(e.fee)),net:e=>t("td",{part:O(e.net)},e.formattedPaymentAmount(e.net)),currency:e=>t("td",{part:O(e.currency)},e.currency),description:e=>t("td",{part:O(e.description)},e.description),source_id:e=>t("td",{part:O(e.source_id)},e.source_id),txn_type:e=>t("td",{part:O(e.txn_type)},B[e.txn_type]),created_at:e=>t("td",{part:O(e.created_at)},t("div",{class:"fw-bold"},s(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},s(e.created_at,{showTime:!0}))),available_on:e=>t("td",{part:O(e.available_on)},t("div",{class:"fw-bold"},s(e.available_on,{showDisplayDate:!0})),t("div",{class:"fw-bold"},s(e.available_on,{showTime:!0}))),updated_at:e=>t("td",{part:O(e.updated_at)},t("div",{class:"fw-bold"},s(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},s(e.updated_at,{showTime:!0})))},A=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=n,this.pagingParams={},this.columns="created_at,txn_type,description,amount,fee,net",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:S.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:S.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:S.row,data:a})}}componentWillLoad(){this.transactionsTable=new u(this.balanceTransactions,this.columns,q,E),p(),this.analytics=new d(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.payoutId&&this.authToken?(({accountId:t,authToken:e,service:a})=>async({params:i,onSuccess:s,onError:r,final:n})=>{var p;try{const n=await a.fetchPayoutTransactions(t,e,i);n.error?r({error:l(n.error),code:h(null===(p=n.error)||void 0===p?void 0:p.code),severity:o.ERROR}):s({balanceTransactions:n.data.map((t=>new c(t))),pagingInfo:Object.assign({},n.page_info)})}catch(t){const e=h(null==t?void 0:t.code);r({error:l(t),code:e,severity:o.ERROR})}finally{n()}})({accountId:i.accountId,authToken:this.authToken,service:new f})({params:this.requestParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payout-id and auth-token props are required",this.handleError(r.MISSING_PROPS,this.errorMessage,o.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}get requestParams(){return Object.assign({payout_id:this.payoutId,limit:"15"},this.pagingParams)}render(){return t(I,{key:"dea4847a741c529cdcc3fd7ea9601a2e18a4eb2c"},t(m,{key:"5f64785e0e90934f303a870ad926de7c6a4c274c"},t(y,{key:"6cfeec59129cfe23bbc0f383487de9a46ea4b745"},t(b,{key:"ba018e95819dcb822d5785e55bc746fc4c38944b"},t(_,{key:"25148be0fdd114ab0c316be5bcf831a9c2772a0e"},this.transactionsTable.columnData.map((t=>t)))),t(w,{key:"9bab9f321e57c277d28da1ec5eca2d54a9d8b3a4"},t(j,{key:"17daf6218d2e62a1b9474239ec318382c7e35d20",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(v,{key:"c74a7f402a0461a409aa21db8b8ea0f1a56ab297",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(T,{key:"bfc19bdfee30c81caf0ad6438a355a419a6bfdc5",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(g,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"264872eb46643bd40c521669e00f0359598aff4c"},t(D,{key:"cfadcb898d61410c1db6b87030d6d33af902d3a5"},t(C,{key:"e648e056899773f3c4e34c116f7ce52af43766cf",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"2c372de8364ca61ec54f1aee2ce9db248fda469e",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],payoutId:["propChanged"],authToken:["propChanged"]}}};export{A as justifi_payout_transactions_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,c as a}from"./p-kpoIU4v_.js";import{d as s,b as d,i}from"./p-B7jE0g5_.js";import{M as c}from"./p-BvyiDejp.js";import{a as f,b,D as l,c as h,C as r,E as o}from"./p-CEYGUVns.js";import{S as y}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{S as n}from"./p-Bz8JT676.js";import{a as p,B as v}from"./p-DCDU6JB3.js";import"./p-D3G5aVLy.js";const k=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(n,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(n,{width:"70%"})),e("div",{class:"col-12"},e(n,{width:"40%"})),e("div",{class:"col-12"},e(n,{width:"40%"})),e("div",{class:"col-12"},e(n,{width:"100%"})),e("div",{class:"col-12"},e(n,{width:"80%"}))),u=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event"),this.loading=!0}componentWillLoad(){this.getPaymentDetails&&this.fetchData()}updateOnPropChange(){this.fetchData()}fetchData(){this.loading=!0,this.getPaymentDetails({onSuccess:({payment:e})=>{this.payment=e,this.errorMessage=null},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({errorCode:t,message:e,severity:a})},final:()=>{this.loading=!1}})}render(){return e(y,{key:"4338e42dfcbf16380a2de314c8a9c89b703be45e"},this.loading&&e(k,{key:"82204cf03e14dcb49567fb6cc68b6870be01bd03"}),!this.loading&&this.errorMessage&&o(this.errorMessage),!this.loading&&!this.errorMessage&&this.payment&&e("justifi-details",{key:"4e50d16529fde2c1a5b737127a7e47adf6183641","error-message":this.errorMessage},e(f,{key:"b721371c573bf0f437ee60248770c187f3964706",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},c(this.payment.status),this.payment.expedited?e(p,{variant:v.WARNING,title:"Expedited",text:"Expedited"}):null),title:this.payment.formattedPaymentAmount(this.payment.amount)},e(b,{key:"216e66f36d6b1cdaec82bb4bb71aaba3844b0b10",classes:"border-1 border-end",title:"Updated At",value:`${s(this.payment.updated_at)} ${d(this.payment.updated_at)}`}),e(b,{key:"d3480527a9f462ba9d6518240d132043e4a42b7c",classes:"border-1 border-end",title:"Created At",value:`${s(this.payment.created_at)} ${d(this.payment.created_at)}`}),e(b,{key:"3ab5d4882e4c654b74111d47123100a538120769",title:"ID",value:this.payment.id})),e("div",{key:"5a75f3e83c470e1680f88ba60174b8e385ba9244",slot:"detail-sections"},e(l,{key:"33378dd6f5be68ebbd9d471931de03a13ed58854",sectionTitle:"Details"}),e("div",{key:"8e48bae187f36587b09832e5fc0ba58dc5158a50",class:"d-table gap-2 w-100"},e(h,{key:"aff9354c93ef439b436e89dae168744906edc1bb",title:"Amount",value:this.payment.formattedPaymentAmount(this.payment.amount)}),e(h,{key:"4c369c287dd856197a829ed883a52fb5147cf8ab",title:"Fees",value:this.payment.formattedPaymentAmount(this.payment.fee_amount)}),e(h,{key:"0382e25ed55c32d55698bbc69295a4d74ffff1da",title:"Refunded",value:this.payment.formattedPaymentAmount(this.payment.amount_refunded)}),e(h,{key:"6efb0780c5e2f96e0cc73099a2f341f31b229f88",title:"Net",value:this.payment.formattedPaymentAmount(this.payment.balance)}),e(h,{key:"39fb251b26f2b49199f8b1773dc9ad16b5c6def9",title:"Status",value:c(this.payment.status)}),e(h,{key:"943f86f46c61866cee58eb0aa805272da36f1b22",title:"Payment ID",value:this.payment.id}),e(h,{key:"b85d389b9f44c70a4d6ced1bb22801ec11d0cffc",title:"Processing Fees",value:this.payment.formattedPaymentAmount(this.payment.fee_amount)}),e(h,{key:"0d4cf8ae6094262454c9016feb7de73d1e76d56f",title:"Statement Descriptor",value:this.payment.statement_descriptor}),e(h,{key:"90fd37e1fd37c072c1fd60f2b776e7589d4f85db",title:"Description",value:this.payment.description}),e(h,{key:"4bf435ac62d7b8d0d207e349fc5aff6239a7462f",title:"Expedited",value:this.payment.expedited?"Yes":"No"})),this.payment.payment_method.card&&[e(l,{key:"2e64d9c8b859f5dcdbfcf687e6e17bf3b5f89f69",sectionTitle:"Payment Method"}),e("div",{key:"39101177a72ad2f2bbb0dce157dba6fe565a1c55",class:"d-table gap-2 w-100"},e(h,{key:"d3f419b55db2ea4ce5e8a6e2570695d2002beba2",title:"ID",value:this.payment.payment_method.card.id}),e(h,{key:"b15b14a68538396ff6d0eda77470c1d2709d1001",title:"Payment Type",value:"Card"}),e(h,{key:"b01f214f3366241a5b9eeecf8fe9536f13170ae9",title:"Last 4 Numbers",value:this.payment.payment_method.lastFourDigits}),e(h,{key:"a3620d1d48e2cf276749383778a7b16391bd8090",title:"Brand",value:i(this.payment.payment_method.card.brand)}),e(h,{key:"2550056c2587c3e6909fe42a23c892329fe076c7",title:"Cardholder",value:this.payment.payment_method.payersName}))],this.payment.payment_method.bank_account&&[e(l,{key:"5f4f08e97bf5fa40af01e178b8ffb0d2378940a0",sectionTitle:"Payment Method"}),e("div",{key:"1ea2b719d937c8f1e4e78a6cdd2299145ca22e96",class:"d-table gap-2 w-100"},e(h,{key:"43704124e46819028dbc2e5cc40c9f0f08fc99f5",title:"ID",value:this.payment.payment_method.bank_account.id}),e(h,{key:"081b84120c383ce0d9c30e50ff1dbeda21d826a4",title:"Last 4 Numbers",value:this.payment.last_four_digits}),e(h,{key:"c18e75ab3a88ddf1e267ded7d3743c3e3b8ee512",title:"Bank Name",value:this.payment.payment_method.bank_account.brand}),e(h,{key:"441c1e5f2b945a31e5ffc56392a994414c97d720",title:"Account Owner",value:this.payment.payment_method.payersName}))],this.payment.metadata&&[e(l,{key:"46fa6de75f55f563066a16dea4cadd6f7c03385a",sectionTitle:"Metadata"}),e("div",{key:"8b2958f2f348bfa5a94f51221bec8b6c2b2a0309",class:"d-table gap-2 w-100"},e(r,{key:"671bc289b2ec8d573f3493f5e6ec56e0c7e5ab78",metadata:this.payment.metadata}))])))}static get watchers(){return{getPaymentDetails:["updateOnPropChange"]}}};export{u as payment_details_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-kpoIU4v_.js";import{A as r}from"./p-Dj1uo4J3.js";import{C as s,a as o}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as n,a}from"./p-D2muobcE.js";import{c,J as p}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-kpoIU4v_.js";import{A as r}from"./p-Dj1uo4J3.js";import{C as s,a as o}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{g as n,a}from"./p-D2muobcE.js";import{c,J as p}from"./p-CDmdt8BH.js";import{c as u}from"./p-BYakc1Om.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-HMZ8vsvN.js";const d=r();class m{async fetchQuote(t,i){return d.post({endpoint:"insurance/quotes",body:i,authToken:t})}async toggleCoverage(t,i,e){return d.post({endpoint:`insurance/quotes/${i}/toggle`,body:e,authToken:t})}}const h=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event")}async validate(){return this.seasonInterruptionCoreRef.validate()}componentWillLoad(){c(),this.analytics=new p(this),this.initializeServiceMethods()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}initializeServiceMethods(){const t=this.authToken||u.authToken;if(!t)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:s.ERROR});const i={authToken:t,service:new m};this.getQuote=(({authToken:t,service:i})=>async({payload:e,onSuccess:r,onError:o})=>{var c;try{const p=await i.fetchQuote(t,e);if(p.error)return o({error:a(p.error),code:n(null===(c=p.error)||void 0===c?void 0:c.code),severity:s.ERROR});r({quote:p.data})}catch(t){const i=n(null==t?void 0:t.code);return o({error:t.message||t,code:i,severity:s.ERROR})}})(i),this.toggleCoverage=(({authToken:t,service:i})=>async({quoteId:e,payload:r,onSuccess:o,onError:c})=>{var p;try{const u=await i.toggleCoverage(t,e,r);if(u.error)return c({error:a(u.error),code:n(null===(p=u.error)||void 0===p?void 0:p.code),severity:s.ERROR});o({quote:u.data})}catch(t){const i=n(null==t?void 0:t.code);return c({error:t.message||t,code:i,severity:s.ERROR})}})(i)}render(){return e("justifi-season-interruption-insurance-core",{key:"a563c1f6daf665c6ae06442c18dd25400b420f39",ref:t=>this.seasonInterruptionCoreRef=t,"checkout-id":this.checkoutId||u.checkoutId,getQuote:this.getQuote,toggleCoverage:this.toggleCoverage,"primary-identity-first-name":this.primaryIdentityFirstName,"primary-identity-last-name":this.primaryIdentityLastName,"primary-identity-state":this.primaryIdentityState,"primary-identity-postal-code":this.primaryIdentityPostalCode,"primary-identity-country":this.primaryIdentityCountry,"primary-identity-email-address":this.primaryIdentityEmailAddress,"policy-attributes-insurable-amount":this.policyAttributesInsurableAmount,"policy-attributes-start-date":this.policyAttributesStartDate,"policy-attributes-end-date":this.policyAttributesEndDate,"covered-identity-first-name":this.coveredIdentityFirstName,"covered-identity-last-name":this.coveredIdentityLastName})}};export{h as justifi_season_interruption_insurance}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as t,h as e,H as a}from"./p-kpoIU4v_.js";import{Z as i,_ as h,$ as r,a0 as o,a1 as c,l as d}from"./p-D3G5aVLy.js";import{F as f}from"./p-FdjD8N0u.js";import{F as b}from"./p-D522G7Ja.js";import"./p-CZfYo5-1.js";const m=class{constructor(e){s(this,e),this.formControlInput=t(this,"formControlInput"),this.formControlBlur=t(this,"formControlBlur"),this.isFocused=!1,this.handleFormControlInput=s=>{s.preventDefault();const t=s.target,e=t.getAttribute("name");this.inputHandler(e,t.checked),this.formControlInput.emit({name:e,value:t.value})},this.updateInput=s=>{this.checkboxElement.checked=s}}get part(){return this.errorText?i:this.isFocused&&this.checked?h:this.isFocused?r:this.checked?o:c}render(){return e(a,{key:"57a7e88600501b5776d8b38f9b3004449477c9be"},e("div",{key:"b800909791526c9768ab69a3b8616990a66510b2",class:"form-group d-flex flex-column"},e("div",{key:"4e3115de90d6a81aa87677ee9632c558e4d5bc4c",class:"form-check"},e("input",{key:"37b8bbe4a45030a28e65bc842e9c4e7063333098",ref:s=>this.checkboxElement=s,type:"checkbox",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-check-input is-invalid":"form-check-input",disabled:this.disabled,checked:this.checked}),e("label",{key:"4d2934f57e676b3d22df044a9e8a0871a67016ad",class:"form-check-label",htmlFor:this.name,part:d},this.label)),e(f,{key:"5fdb63d077476e7dc48d0f25de1a510e0310d09c",helpText:this.helpText,name:this.name}),e(b,{key:"c9b63478dbd8866bf4f1afb8d5975def53460c1a",errorText:this.errorText,name:this.name})))}};export{m as form_control_checkbox}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{B as e}from"./p-Cm_ywVHL.js";import{S as o}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{c as a,J as r}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{B as e}from"./p-Cm_ywVHL.js";import{S as o}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{c as a,J as r}from"./p-CDmdt8BH.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import{C as p,a as h}from"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{c as m}from"./p-BYakc1Om.js";import"./p-D3G5aVLy.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const d=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.submitEvent=s(this,"submit-event"),this.submitButtonText="Submit",this.isLoading=!1}componentWillLoad(){a(),this.analytics=new r(this),this.authToken||(this.authToken=m.authToken),this.accountId||(this.accountId=m.accountId)}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async tokenizePaymentMethod(t){let s;t&&t.preventDefault(),this.isLoading=!0;try{s=await this.paymentMethodOptionsRef.resolvePaymentMethod({isValid:!0}),s.error&&this.errorEvent.emit({errorCode:s.error.code,message:s.error.message,severity:p.ERROR})}catch(t){this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:t.message,severity:p.ERROR})}finally{return this.submitEvent.emit({response:s}),this.isLoading=!1,s}}async fillBillingForm(t){this.paymentMethodOptionsRef.fillBillingForm(t)}async validate(){return this.paymentMethodOptionsRef.validate()}render(){return i(o,{key:"b122a82d00045609c3aadb38780451c56fed3986"},i("form",{key:"65ccc13977bfc61fae403a9e49fb796cda58c5a5"},i("fieldset",{key:"7e2b545334a7b8951c491f04d1cb3b356095e1da"},i("div",{key:"e78e3b896d8b5e3b67017f5f214d9b2c224c6650",class:"row gy-3"},i("div",{key:"679f6b00bb91a7551082e10dfc849d62070c0a72",class:"col-12"},i("justifi-payment-method-options",{key:"41d9590b7a0d6476ae1774e8064e3813f485965f",ref:t=>this.paymentMethodOptionsRef=t,"show-card":!this.disableCreditCard,"show-ach":!this.disableBankAccount,"show-bnpl":!1,paymentMethodGroupId:this.paymentMethodGroupId,"show-saved-payment-methods":!1,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,authToken:this.authToken,"account-id":this.accountId})),i("div",{key:"2d7a9a0d13009f836bd05da27fc5400b194b105c",class:"col-12"},i(e,{key:"9d1e28220380560e92a895eecd714849cbbf06a3",variant:"primary",type:"submit",onClick:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.hideSubmitButton},this.submitButtonText))))))}};export{d as justifi_tokenize_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as a}from"./p-kpoIU4v_.js";import"./p-9y5MOK55.js";import{a as s}from"./p-B7jE0g5_.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{e as n}from"./p-Bou1Z4Bm.js";import{p as o}from"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{c,J as p}from"./p-
|
|
1
|
+
import{h as t,r as e,c as a}from"./p-kpoIU4v_.js";import"./p-9y5MOK55.js";import{a as s}from"./p-B7jE0g5_.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{e as n}from"./p-Bou1Z4Bm.js";import{p as o}from"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{c,J as p}from"./p-CDmdt8BH.js";import{g as d,a as h}from"./p-D2muobcE.js";import{P as l}from"./p-ObR0KZw0.js";import{T as f,l as u,a as m,b as y,c as b,d as _,e as j,f as g,g as T,h as k,i as w,j as v,k as C}from"./p-C8ll3Wwp.js";import{S as D}from"./p-CRFzwZW6.js";import{T as R}from"./p-CZfYo5-1.js";import{N as S,O as I}from"./p-D3G5aVLy.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-B8tUOqiv.js";const B={created_at:()=>t("th",{part:S,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>t("th",{part:S,scope:"col",title:"The type of each transaction"},"Type"),id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>t("th",{part:S,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>t("th",{part:S,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>t("th",{part:S,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>t("th",{part:S,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>t("th",{part:S,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>t("th",{part:S,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},F={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},x={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}))),type:(e,a)=>t("td",{part:I(a)},F[e.payment_balance_txn_type]),id:(e,a)=>t("td",{part:I(a)},e.id),amount:(e,a)=>t("td",{part:I(a),class:"text-end"},e.formattedPaymentAmount(e.amount)),balance:(e,a)=>t("td",{part:I(a),class:"text-end"},e.formattedPaymentAmount(e.balance)),currency:(e,a)=>t("td",{part:I(a)},e.currency),financial_transaction_id:(e,a)=>t("td",{part:I(a)},e.financial_transaction_id),payment_id:(e,a)=>t("td",{part:I(a)},e.payment_id),payment_balance_txn_type:(e,a)=>t("td",{part:I(a)},e.payment_balance_txn_type),source_id:(e,a)=>t("td",{part:I(a)},e.source_id),source_type:(e,a)=>t("td",{part:I(a)},e.source_type)},E=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=o,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:R.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:R.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:R.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,B,x),c(),this.analytics=new p(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:t,authToken:e,service:a})=>async({params:s,onSuccess:r,onError:o,final:c})=>{var p;try{const c=await a.fetchPaymentTransactions(t,e,s);c.error?o({error:h(c.error),code:d(null===(p=c.error)||void 0===p?void 0:p.code),severity:i.ERROR}):r({balanceTransactions:c.data.map((t=>new n(t))),pagingInfo:Object.assign({},c.page_info)})}catch(t){const e=d(null==t?void 0:t.code);o({error:h(t),code:e,severity:i.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new l})({params:this.pagingParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(r.MISSING_PROPS,this.errorMessage,i.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return t(D,{key:"361096cb55ce8d0b669eb8185d5d29ede0987cc7"},t(u,{key:"7980a1003108ba8194822e5094a9b8bb85d6c758"},t(m,{key:"3fdaea0631b7aceefe24bb85c7fecee9ef5b06d6"},t(y,{key:"7a92bbf526a2a30dd48137427e03caa9c75d07d5"},t(b,{key:"1828192c594aad3554d15288b2769088fe1321cb"},this.transactionsTable.columnData.map((t=>t)))),t(_,{key:"f2c63fb18e6e889013c67fd0b8dc39bac8dd06dc"},t(j,{key:"9a2ac964da5b7c159fd08264e33a87d5df96e1e5",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(g,{key:"35c8474655e1ebd34c64e8aa6e71cb070710f3b4",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(T,{key:"2c87781e8791fd19de1cacdbba553f6f98d007f5",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(k,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(w,{key:"ff33a6fa5fb2ed9df9c9ff223e8a0f3d0b30bff5"},t(v,{key:"66e73eae038757d1c99b1fa33624c58745e8c995"},t(C,{key:"4929f3a3c1ee06a1d09d0a12b5a2059c58780032",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"38a84d08bac6ac8a3dbdcae3c97d6416de7d780f",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{E as justifi_payment_transactions_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as a,c as t}from"./p-kpoIU4v_.js";import{S as i}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{S as s}from"./p-Bz8JT676.js";import{c as d,J as c}from"./p-CDmdt8BH.js";import{w as n,c as r}from"./p-9y5MOK55.js";import{c as o,F as l}from"./p-CR9D6mKt.js";import{k as f,l as b,m as h,n as p,q as m,y as u}from"./p-CYBR4K2p.js";import{ag as y}from"./p-D3G5aVLy.js";import{n as k}from"./p-BnjCmwMr.js";import{S as v}from"./p-BX8GieXu.js";import{o as g}from"./p-BYakc1Om.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-B7jE0g5_.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-7WIgS5RM.js";import"./p-BFTU3MAI.js";import"./p-yH3TC3ZQ.js";const j=a=>{const{isReady:t}=a;return t?null:e("div",{class:"container-fluid p-0"},e("div",{class:"row mb-3"},e("div",{class:"col-12 align-content-end"},e(s,{height:"18px",width:"120px"}),e(s,{height:"36px"}))),e("div",{class:"row"},e("div",{class:"col-12 align-content-end"},e(s,{height:"18px",width:"110px"}),e(s,{height:"36px"}))))},x=class{constructor(e){a(this,e),this.isReady=!1}async componentWillLoad(){await n(),this.iframeOrigin=r.iframeOrigin,d(),this.analytics=new c(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((e=>new Promise((a=>{e.addEventListener("iframeLoaded",(()=>{a()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.accountNumberIframeElement.validate(),a=await this.routingNumberIframeElement.validate();return e&&a}async tokenize({clientId:e,paymentMethodMetadata:a,account:t}){return this.accountNumberIframeElement.tokenize(e,a,t)}render(){return e(i,{key:"ff15c98bae7f78f81f48db8314ceda2902056210"},e(j,{key:"bd874e12ddec0df3f6e8c73b2ff25fbda7cf626e",isReady:this.isReady}),e("hidden-input",{key:"a4ead10782d1dabcf7b0c3ca6d67263e134b79b0"}),e("div",{key:"5557ebe982d2fe51a03a6d124e22045dbe94f3f1",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},e("div",{key:"e2ffdae6b516fb62642f274b995a5670a0c3ea7a",class:"row mb-3"},e("iframe-input",{key:"e189e5d5589d542db0aaf3c628a16760888d83ba",inputId:"accountNumber",ref:e=>this.accountNumberIframeElement=e,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),e("div",{key:"ad2617da7b2d199aedaf1e51709817b9c172542d",class:"row"},e("iframe-input",{key:"d1ec652e802e083580ff033c365ffe2e7d6ffdd1",inputId:"routingNumber",ref:e=>this.routingNumberIframeElement=e,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},w=e=>{const a=o({name:u.required("Enter full name"),address_line1:m.required("Enter street address"),address_line2:p.nullable(),address_city:h.required("Enter city"),address_state:b.required("Select state"),address_postal_code:f.required("Enter postal code")}),t=o({name:u.nullable(),address_line1:m.nullable(),address_line2:p.nullable(),address_city:h.nullable(),address_state:b.nullable(),address_postal_code:f.required("Enter postal code")});return e?t:a},_=class{constructor(e){a(this,e),this.errors={},this.inputHandler=(e,a)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:a}))}}connectedCallback(){this.unsubscribe=g("billingFormFields",(e=>{this.formController.setInitialValues(e)}))}disconnectedCallback(){var e;null===(e=this.unsubscribe)||void 0===e||e.call(this)}componentWillLoad(){this.formController=new l(w())}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async validate(){return{isValid:await this.formController.validate()}}render(){const a=this.formController.getInitialValues();return e(i,{key:"a6ce1995bc8f0bc79b52c692d71bde1235d90622"},e("div",{key:"5ce8118beaf6cfc090c3b6858fb2888741aa7e53",part:y},e("form",{key:"15a9035e31659a0ce08d675d1868afea612811d5"},e("fieldset",{key:"9c57ae450cc38e0fe50a6e0d2949b18d945ace1c"},e("div",{key:"0f6dfd8c20b64e60f22fed232ab56cc0d2509b82",class:"row gy-3"},e("div",{key:"40024642467bd869d4e1b926e6dde10a4f200f8b",class:"col-12"},e("form-control-text",{key:"ead74011aa5097a6c3ae9634a149ded0399729ef",name:"name",label:"Full Name",defaultValue:a.name,errorText:this.errors.name,inputHandler:this.inputHandler})),e("div",{key:"c31e9d4cf5285a0113f4d931035534949709a1ca",class:"col-12"},e("form-control-text",{key:"1cef8e3f7fd41d46046a214b1d442923074f7a41",name:"address_line1",label:"Street Address",defaultValue:a.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),e("div",{key:"9d6dd8dd7894866ecbffeb7dfb347e0ea4099946",class:"col-12"},e("form-control-text",{key:"a65736751e7d8a6470c3eb2d04cf4ff173e660b6",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:a.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),e("div",{key:"1c0ba7f2720bc71434b69cb285ddf6214932d063",class:"col-12"},e("form-control-text",{key:"de507ce3010e4cb09d3b659823b097fd9c9d9d63",name:"address_city",label:"City",defaultValue:a.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),e("div",{key:"31421327f01601abe6aaaae8ac2391afcdc485d9",class:"col-12"},e("form-control-select",{key:"30be012a7b96e75b57808922bc689f31a056e8d7",name:"address_state",label:"State",options:v,defaultValue:a.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),e("div",{key:"f24ba6174800f8f57a02a295e71fb0b018249634",class:"col-12"},e("form-control-text",{key:"cf69224b9af53ad11971ccea42756dbacebb104d",name:"address_postal_code",label:"ZIP",defaultValue:a.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:k})))))))}},C=a=>{const{isReady:t}=a;return t?null:e("div",{class:"container-fluid p-0"},e("div",{class:"mb-3"},e(s,{height:"18px",width:"100px"}),e(s,{height:"36px"})),e("div",{class:"row"},e("div",{class:"col-4 align-content-end"},e(s,{height:"18px",width:"80px"}),e(s,{height:"36px"})),e("div",{class:"col-4 align-content-end"},e(s,{height:"36px"})),e("div",{class:"col-4 align-content-end"},e(s,{height:"18px",width:"30px"}),e(s,{height:"36px"}))))},V=class{constructor(e){a(this,e),this.isReady=!1}async componentWillLoad(){await n(),this.iframeOrigin=r.iframeOrigin,d(),this.analytics=new c(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((e=>new Promise((a=>{e.addEventListener("iframeLoaded",(()=>{a()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}async validate(){const e=await this.cardNumberIframeElement.validate(),a=await this.expirationMonthIframeElement.validate(),t=await this.expirationYearIframeElement.validate(),i=await this.cvvIframeElement.validate();return e&&a&&t&&i}async tokenize({clientId:e,paymentMethodMetadata:a,account:t}){return this.cardNumberIframeElement.tokenize(e,a,t)}render(){return e(i,{key:"3ea6e5a7cb667a94d71686a202d232f6360d25d8"},e(C,{key:"3bd2aba27d83ce47cb147bcaae13232e554d7f56",isReady:this.isReady}),e("hidden-input",{key:"e144b2394bfe0a9639dd512f25f83ab115c6916a"}),e("div",{key:"86e718f1e8dbfb9341dc62c82db7c043dbf444fb",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},e("div",{key:"8a7d518ef2a91663fb951f625c6e3113991a752a",class:"mb-3"},e("iframe-input",{key:"89d2c67e1b03658e43395ba224341c889391eecc",inputId:"cardNumber",ref:e=>this.cardNumberIframeElement=e,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),e("div",{key:"ae5920f94fddaaa2bf068a44d33ec693087a4ff6",class:"row"},e("div",{key:"a4ab2b40162cbc9d5b6b353fdf92699d2a7d1297",class:"col-4 align-content-end"},e("iframe-input",{key:"d7dc593be2fe53910c7c34c389bab9eb32158482",inputId:"expirationMonth",ref:e=>this.expirationMonthIframeElement=e,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),e("div",{key:"ebef3068915a5ec98513594670306a90a40353c4",class:"col-4 align-content-end"},e("iframe-input",{key:"8bc26264bab83aaef4a8962ae7a4769deed6ec28",inputId:"expirationYear",ref:e=>this.expirationYearIframeElement=e,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),e("div",{key:"bcd782486a95fc0fb8ff197bb5f62ba6051f1a42",class:"col-4 align-content-end"},e("iframe-input",{key:"792afe884631622898079e54264dfed3541bf5cb",inputId:"CVV",ref:e=>this.cvvIframeElement=e,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},O=class{constructor(e){a(this,e),this.errors={},this.inputHandler=(e,a)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:a}))}}connectedCallback(){this.unsubscribe=g("billingFormFields",(e=>{this.formController.setInitialValues(e)}))}disconnectedCallback(){var e;null===(e=this.unsubscribe)||void 0===e||e.call(this)}componentWillLoad(){this.formController=new l(w(!0))}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const a=this.formController.getInitialValues();return e(i,{key:"5ad010bc8968661c250eb3b029e93026cc6545e7"},e("form",{key:"cbe9d05605241f7c2c8d48b7e12bbaa3f83b3724"},e("form-control-text",{key:"bfe2ffa8ec34b564127426b220d64fce0809361c",name:"address_postal_code",label:"ZIP",defaultValue:a.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:k})))}},H=class{constructor(e){a(this,e),this.checkboxChanged=t(this,"checkboxChanged"),this.isChecked=!1}handleCheckboxChange(e,a){this.isChecked=a,this.checkboxChanged.emit(this.isChecked)}render(){return e(i,{key:"114f1887f2aebee2440d5c0b187fe1f361137230"},e("div",{key:"8a967beb89065a8b3ee501f0589b6617764c641e",class:"mt-4 form-check"},e("form-control-checkbox",{key:"b22ca881a5fcda9dc044dfd1175e9ae06fd9f504",label:"Save new payment method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange.bind(this)})))}};export{x as justifi_bank_account_form,_ as justifi_billing_information_form,V as justifi_card_form,O as justifi_postal_code_form,H as justifi_save_new_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as i,h as t}from"./p-kpoIU4v_.js";import{E as r}from"./p-CEYGUVns.js";import{B as o}from"./p-DVPcHdzq.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-kpoIU4v_.js";import{E as r}from"./p-CEYGUVns.js";import{B as o}from"./p-DVPcHdzq.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-CDmdt8BH.js";import"./p-D3G5aVLy.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-7MWRbTXI.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-HMZ8vsvN.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){n(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as a,H as e}from"./p-kpoIU4v_.js";import{b as i,T as o,a as r,c as h,l as n,U as c}from"./p-D3G5aVLy.js";import{F as f}from"./p-FdjD8N0u.js";import{F as l}from"./p-D522G7Ja.js";import"./p-CZfYo5-1.js";import{f as b}from"./p-B7jE0g5_.js";const d=class{constructor(a){t(this,a),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.isFocused=!1,this.defaultValue="0",this.formatRawValue=t=>t.replace(/\D/g,""),this.formatDisplayValue=t=>b(+t,void 0,!0),this.updateInput=t=>{const s=this.formControl.name,a=this.formatRawValue(t);this.formControl.value=this.formatDisplayValue(a),this.inputHandler(s,a),this.formControlInput.emit({name:s,value:a})}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get inputPart(){return this.errorText?i:this.disabled?o:this.isFocused?r:h}render(){return a(e,{key:"fe51b18876a4ff9852e22a846560140c7785c13f"},a("div",{key:"dba07ddbca703924766869095f48dacdbd12ee3e",class:"form-group d-flex flex-column"},a("label",{key:"2b06342a7e682609b2cdb9ad678f93fd6507b7f0",part:n,class:"form-label",htmlFor:this.name},this.label),a(f,{key:"71093364163bb3a58dda19e1a55cb44ad9810075",name:this.name,helpText:this.helpText}),a("div",{key:"e31448537ac8240606c45089e918f6b10144f33e",class:"input-group"},a("span",{key:"826c98a15902fbbc468bce8bbc0249906099bcbb",class:"input-group-text",part:c},"$"),a("input",{key:"d339072b747a798a37abc7ece84691f86da88639",ref:t=>this.formControl=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:t=>this.updateInput(t.target.value),onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.inputPart,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled})),a(l,{key:"4bf5b64de48b7e16407be4dae29f2b210ce2b051",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{d as form_control_monetary}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as a,H as e,g as i}from"./p-kpoIU4v_.js";import{i as r,a as o,b as h,c as n,l as c}from"./p-D3G5aVLy.js";import{F as l}from"./p-FdjD8N0u.js";import{F as f}from"./p-D522G7Ja.js";import"./p-CZfYo5-1.js";const m=class{constructor(a){t(this,a),this.formControlInput=s(this,"formControlInput"),this.formControlBlur=s(this,"formControlBlur"),this.isFocused=!1,this.handleFormControlInput=t=>{const s=t.target,a=s.getAttribute("name");this.inputHandler(a,s.value),this.formControlInput.emit({name:a,value:s.value})},this.updateInput=t=>{const s=this.el.querySelector("input");s&&(s.value=t||"")}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get part(){return this.isFocused&&this.errorText?r:this.isFocused?o:this.errorText?h:n}render(){return a(e,{key:"dc0b79410cef1d158cc144a3005115b886861828"},a("div",{key:"805a21626529fba2187d80532a54c62e6eab32d0",class:"form-group d-flex flex-column"},a("label",{key:"77c6a7d7083f2af2b3b9d67536b573f71c125ce3",part:c,class:"form-label",htmlFor:this.name},this.label),a("input",{key:"212751835d17b295756cb0f2d3c414a42f460639",id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",type:"number",disabled:this.disabled}),a(l,{key:"12b238c6aebb20db5456f8020b30fc0b619883ef",helpText:this.helpText,name:this.name}),a(f,{key:"0128578f613685a45c331c57b5dd049348af933b",errorText:this.errorText,name:this.name})))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{m as form_control_number}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t}from"./p-
|
|
1
|
+
import{p as t}from"./p-HMZ8vsvN.js";import{A as s}from"./p-Dj1uo4J3.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class o{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("storybook")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:s.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters&&this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}const n=async()=>{const s=t.version,i=t.name,e=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(i),o=e.replace(/-rc.*/,""),n=s.split("."),r=e.split(".");n[0]!==r[0]&&console.warn(`The package ${i} is out of date. The latest version is ${o}. Please update.`)};export{o as J,n as c}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={name:"@justifi/webcomponents",version:"5.7.6-rc-16"};export{e as p}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{C as e,a as r}from"./p-Cjcsf8ku.js";import{c as o,J as p}from"./p-CDmdt8BH.js";import{a}from"./p-7MWRbTXI.js";import{g as n,a as h}from"./p-D2muobcE.js";import{D as m}from"./p-DiWKhLRS.js";import"./p-HMZ8vsvN.js";import"./p-Dj1uo4J3.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-B7jE0g5_.js";import"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){o(),this.analytics=new p(this),this.initializeGetDispute()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetDispute()}initializeGetDispute(){this.disputeId&&this.authToken?this.getDispute=(({id:t,authToken:s,service:i})=>async({onSuccess:r,onError:o})=>{var p;try{const m=await i.fetchDispute(t,s);if(m.error)return o({error:h(m.error),code:n(null===(p=m.error)||void 0===p?void 0:p.code),severity:e.ERROR});{const t=Object.assign({},m.page_info);r({dispute:new a(m.data),pagingInfo:t})}}catch(t){const s=n(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:e.ERROR})}})({id:this.disputeId,authToken:this.authToken,service:new m}):(this.errorMessage="Dispute ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:r.MISSING_PROPS,severity:e.ERROR}))}render(){return i("justifi-dispute-management-core",{key:"4087eb105a046a3cc194d9f25c80fa11298fa0a2",getDispute:this.getDispute,disputeId:this.disputeId,authToken:this.authToken,"onError-event":this.handleErrorEvent})}static get watchers(){return{disputeId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_dispute_management}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-kpoIU4v_.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import{p as
|
|
1
|
+
import{r as t,c as s,h as e}from"./p-kpoIU4v_.js";import"./p-9y5MOK55.js";import"./p-B7jE0g5_.js";import"./p-Cjcsf8ku.js";import"./p-Bou1Z4Bm.js";import{p as i}from"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{T as a,a as r,b as h,c as o,d as n,e as c,f as p,g as d,h as m,i as b,j as u,k as f,l as g}from"./p-C8ll3Wwp.js";import{T as l}from"./p-CZfYo5-1.js";import{t as j,a as y}from"./p-BRtwZAeZ.js";import{o as k,g as C}from"./p-BVD7g3cE.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D3G5aVLy.js";import"./p-B8tUOqiv.js";import"./p-DCDU6JB3.js";const v=class{constructor(e){t(this,e),this.clickEvent=s(this,"click-event"),this.errorEvent=s(this,"error-event"),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=i,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:l.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:l.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr").dataset.rowEntityId;if(!s)return;const e=this.terminals.find((t=>t.id===s));this.clickEvent.emit({name:l.row,data:e})}}updateOnPropChange(){this.fetchData()}componentWillLoad(){this.terminalsTable=new a(this.terminals,this.columns,j,y),this.getTerminals&&this.getSubAccounts&&this.fetchData(),k("set",(()=>{this.pagingParams={}})),k("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:s})=>{this.terminals=t,this.paging=s,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get terminalParams(){const t=C();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return e(g,{key:"6751b731f5547643780c3d57318474aee84b248b"},e(r,{key:"36d14a0aacdfa627582289a6b775293f0efe2229"},e(h,{key:"756ab46cea2b9721e96701e1367eab4e1489c0fe"},e(o,{key:"9535bf0a3f32e54d315b56966f14e2a915411fc6"},this.terminalsTable.columnData.map((t=>t)))),e(n,{key:"66bd7f68e658310cb670642af1612cf4d963817d"},e(c,{key:"56aebdbbe34742ee01f9f952d8d0344fb59435d2",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),e(p,{key:"cb143316e6969538d84f5ce72990c2d8c48f730e",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),e(d,{key:"2a960216d364507487032a83ed3e6988b7794aac",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((t,s)=>e(m,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},t)))),this.paging&&e(b,{key:"3099c45771b4cd72fe284d4414713d551274bae0"},e(u,{key:"4060eb5ac1dbf0b768bcfe8c3c7b781d48424ad7"},e(f,{key:"7aa7116bbee1c70af2bdae0d6b269660e9994685",colSpan:this.terminalsTable.columnData.length},e("pagination-menu",{key:"24e0d39e92477186509832cd73113831581bf8f9",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})}))))))}static get watchers(){return{pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{v as terminals_list_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as s,c as e}from"./p-kpoIU4v_.js";import{c as r,a as i,F as o}from"./p-CR9D6mKt.js";import{f as n}from"./p-B7jE0g5_.js";import"./p-9y5MOK55.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,i as m}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{B as h}from"./p-Cm_ywVHL.js";import{S as p}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-ObR0KZw0.js";import{m as d}from"./p-DSfL8jLw.js";import{c as f,J as j}from"./p-
|
|
1
|
+
import{h as t,r as s,c as e}from"./p-kpoIU4v_.js";import{c as r,a as i,F as o}from"./p-CR9D6mKt.js";import{f as n}from"./p-B7jE0g5_.js";import"./p-9y5MOK55.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,i as m}from"./p-Bou1Z4Bm.js";import"./p-CLHwhyvu.js";import"./p-BDUTtU21.js";import"./p-BlJnA265.js";import"./p-7MWRbTXI.js";import{B as h}from"./p-Cm_ywVHL.js";import{S as p}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-ObR0KZw0.js";import{m as d}from"./p-DSfL8jLw.js";import{c as f,J as j}from"./p-CDmdt8BH.js";import{g as v,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-Dj1uo4J3.js";import{S as w}from"./p-Bz8JT676.js";import"./p-BFTU3MAI.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D3G5aVLy.js";import"./p-HMZ8vsvN.js";const g=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},C=t=>{if(t)return r({amount:g(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},R=[{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"}],B=b();class T{async postRefund(t,s,e,r){return B.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const x=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),A=()=>t(p,null,t("div",{class:"row gap-5"},t(x,null),t(x,null),t(x,null))),I=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new j(this),this.initializeApi(),this.formController=new o(C())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(C(s)),this.formController.setInitialValues({amount:s}),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?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new m({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:v(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=v(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new T}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(A,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,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:s.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:s.reason,inputHandler:this.inputHandler,options:R,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(h,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{I as justifi_refund_payment}
|