@justifi/webcomponents 4.19.3-rc-1 → 4.19.3-rc-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-84cccd4a.js → Analytics-adc90fc6.js} +1 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +2 -2
- 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-card-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +2 -1
- package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +4 -1
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/{package-d2e04416.js → package-22d30c5d.js} +1 -1
- package/dist/collection/components/checkout/checkout-core.js +2 -1
- package/dist/collection/components/checkout/new-payment-method.js +4 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{Analytics-a742f6d2.js → Analytics-a8eb7344.js} +1 -1
- package/dist/esm/justifi-bank-account-form.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-card-form.entry.js +2 -2
- package/dist/esm/justifi-checkout-core.entry.js +2 -1
- package/dist/esm/justifi-checkout.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-new-payment-method_4.entry.js +4 -1
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-form.entry.js +2 -2
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/{package-a70c900f.js → package-ccb774a9.js} +1 -1
- package/dist/module/checkout-core.js +2 -1
- package/dist/module/new-payment-method.js +4 -1
- package/dist/module/package.js +1 -1
- package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
- package/dist/webcomponents/index.esm.js +1 -0
- package/dist/webcomponents/p-01a404ca.entry.js +44 -0
- package/dist/webcomponents/p-03d35880.entry.js +130 -0
- package/dist/webcomponents/p-06ff0429.entry.js +65 -0
- package/dist/webcomponents/p-08b0fb31.js +41 -1
- package/dist/webcomponents/p-0e1bc91e.js +28 -1
- package/dist/webcomponents/p-10875f3d.entry.js +97 -0
- package/dist/webcomponents/p-14c91ffd.js +20 -1
- package/dist/webcomponents/p-157acba8.entry.js +98 -0
- package/dist/webcomponents/p-15eafa87.js +77 -0
- package/dist/webcomponents/p-18fa0479.entry.js +131 -0
- package/dist/webcomponents/p-1a5120f4.entry.js +145 -0
- package/dist/webcomponents/p-1ad5995e.js +3599 -1
- package/dist/webcomponents/p-1ff8810b.js +29 -1
- package/dist/webcomponents/p-2338affa.js +213 -1
- package/dist/webcomponents/p-24dc023a.entry.js +791 -0
- package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
- package/dist/webcomponents/p-27d87fe2.entry.js +133 -0
- package/dist/webcomponents/p-29c0b182.js +114 -1
- package/dist/webcomponents/p-2b6c9c4f.js +7 -1
- package/dist/webcomponents/p-2e8f4937.js +79 -0
- package/dist/webcomponents/p-2eab3c90.js +3052 -1
- package/dist/webcomponents/p-3395e896.entry.js +74 -0
- package/dist/webcomponents/p-3fd13ca3.js +52 -1
- package/dist/webcomponents/p-47d79529.js +18 -1
- package/dist/webcomponents/p-525db3e8.js +22 -1
- package/dist/webcomponents/p-53ecc8b9.entry.js +261 -0
- package/dist/webcomponents/p-5482d030.entry.js +21 -0
- package/dist/webcomponents/p-56f6ce4c.js +10 -1
- package/dist/webcomponents/p-576826b1.entry.js +43 -0
- package/dist/webcomponents/p-5968ff8a.js +178 -1
- package/dist/webcomponents/p-5f835b89.entry.js +606 -0
- package/dist/webcomponents/p-6078a370.js +244 -1
- package/dist/webcomponents/p-6124b1b3.entry.js +80 -0
- package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
- package/dist/webcomponents/p-7582b554.entry.js +18 -0
- package/dist/webcomponents/p-75fd6367.entry.js +149 -0
- package/dist/webcomponents/p-79646550.entry.js +61 -0
- package/dist/webcomponents/p-7d85af5c.js +16 -1
- package/dist/webcomponents/p-800d31fe.entry.js +162 -0
- package/dist/webcomponents/p-8115b2f4.js +28 -1
- package/dist/webcomponents/p-83125497.js +4027 -1
- package/dist/webcomponents/p-85fc69e5.js +90 -1
- package/dist/webcomponents/p-89887332.js +301 -1
- package/dist/webcomponents/p-8df7bde8.js +27 -1
- package/dist/webcomponents/p-8eb774df.entry.js +54 -0
- package/dist/webcomponents/p-9c9c7dac.js +24 -1
- package/dist/webcomponents/p-9e17630d.entry.js +1684 -0
- package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
- package/dist/webcomponents/p-a4e8573e.entry.js +94 -0
- package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
- package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
- package/dist/webcomponents/p-ab4816e1.entry.js +117 -0
- package/dist/webcomponents/p-ac086069.entry.js +58 -0
- package/dist/webcomponents/p-af244664.js +126 -1
- package/dist/webcomponents/p-b4b8b531.js +44 -1
- package/dist/webcomponents/p-b82c146f.entry.js +111 -0
- package/dist/webcomponents/p-ba4bae6f.js +12 -1
- package/dist/webcomponents/p-ba5fae28.js +90 -1
- package/dist/webcomponents/p-bd66f9d2.entry.js +101 -0
- package/dist/webcomponents/p-cc39384f.entry.js +99 -0
- package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
- package/dist/webcomponents/p-d89bad72.js +39 -1
- package/dist/webcomponents/p-dad3e069.entry.js +298 -0
- package/dist/webcomponents/p-dce846bf.js +27 -1
- package/dist/webcomponents/p-df21aaad.js +120 -1
- package/dist/webcomponents/p-e1255160.js +3 -1
- package/dist/webcomponents/p-e1e7525b.entry.js +73 -0
- package/dist/webcomponents/p-e333620e.js +34 -1
- package/dist/webcomponents/p-e356f280.entry.js +29 -0
- package/dist/webcomponents/p-e3fab0e2.js +43 -1
- package/dist/webcomponents/p-e9a5cb95.entry.js +94 -0
- package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
- package/dist/webcomponents/p-edc37d1f.entry.js +75 -0
- package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
- package/dist/webcomponents/p-fad19d75.js +1638 -2
- package/dist/webcomponents/webcomponents.css +362 -4
- package/dist/webcomponents/webcomponents.esm.js +20 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-07109641.entry.js +0 -1
- package/dist/webcomponents/p-080fedb5.entry.js +0 -1
- package/dist/webcomponents/p-0e3e3544.entry.js +0 -1
- package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
- package/dist/webcomponents/p-1295970b.entry.js +0 -1
- package/dist/webcomponents/p-15b9b267.entry.js +0 -1
- package/dist/webcomponents/p-17e4246f.entry.js +0 -1
- package/dist/webcomponents/p-1a43e355.entry.js +0 -19
- package/dist/webcomponents/p-232278e0.entry.js +0 -1
- package/dist/webcomponents/p-30a493cd.entry.js +0 -1
- package/dist/webcomponents/p-32211b2f.entry.js +0 -1
- package/dist/webcomponents/p-3352353a.entry.js +0 -1
- package/dist/webcomponents/p-462dc522.entry.js +0 -1
- package/dist/webcomponents/p-487b72a8.entry.js +0 -1
- package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
- package/dist/webcomponents/p-52021fa1.entry.js +0 -1
- package/dist/webcomponents/p-53e64f15.entry.js +0 -1
- package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
- package/dist/webcomponents/p-701e03a8.entry.js +0 -1
- package/dist/webcomponents/p-79cfbcfa.entry.js +0 -1
- package/dist/webcomponents/p-8e263202.js +0 -1
- package/dist/webcomponents/p-8e541a32.entry.js +0 -1
- package/dist/webcomponents/p-99899e7e.entry.js +0 -1
- package/dist/webcomponents/p-9993e959.entry.js +0 -1
- package/dist/webcomponents/p-b29f5084.entry.js +0 -1
- package/dist/webcomponents/p-bbed6107.entry.js +0 -1
- package/dist/webcomponents/p-be39c802.entry.js +0 -1
- package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
- package/dist/webcomponents/p-cc97f21b.entry.js +0 -1
- package/dist/webcomponents/p-cd37a87e.entry.js +0 -1
- package/dist/webcomponents/p-d4c94340.entry.js +0 -1
- package/dist/webcomponents/p-d5c9e036.entry.js +0 -1
- package/dist/webcomponents/p-d6a998e4.js +0 -1
- package/dist/webcomponents/p-d8355f91.entry.js +0 -1
- package/dist/webcomponents/p-e2c88817.entry.js +0 -1
- package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
- package/dist/webcomponents/p-ea3598f3.entry.js +0 -1
- package/dist/webcomponents/p-eca70b1d.entry.js +0 -1
- package/dist/webcomponents/p-f0866375.entry.js +0 -1
- package/dist/webcomponents/p-f117d1d1.entry.js +0 -1
- package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
- package/dist/webcomponents/p-fe33151d.entry.js +0 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './p-fad19d75.js';
|
|
2
|
+
import { a as PaymentMethodTypes } from './p-df21aaad.js';
|
|
3
|
+
import { g as snakeToCamel, f as formatCurrency } from './p-83125497.js';
|
|
4
|
+
|
|
5
|
+
const PaymentMethodTypeLabels = {
|
|
6
|
+
bankAccount: 'New bank account',
|
|
7
|
+
card: 'New credit or debit card',
|
|
8
|
+
};
|
|
9
|
+
const NewPaymentMethod = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
registerInstance(this, hostRef);
|
|
12
|
+
this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
|
|
13
|
+
this.onPaymentMethodOptionClick = () => {
|
|
14
|
+
this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
|
|
15
|
+
};
|
|
16
|
+
this.iframeOrigin = "";
|
|
17
|
+
this.authToken = undefined;
|
|
18
|
+
this.accountId = undefined;
|
|
19
|
+
this.paymentMethodOption = undefined;
|
|
20
|
+
this.paymentMethodGroupId = undefined;
|
|
21
|
+
this.isSelected = undefined;
|
|
22
|
+
this.saveNewPaymentMethodChecked = false;
|
|
23
|
+
}
|
|
24
|
+
componentWillLoad() {
|
|
25
|
+
console.log('NewPaymentMethod: componentWillLoad iframeOrigin', this, this.iframeOrigin);
|
|
26
|
+
}
|
|
27
|
+
handleCheckboxChanged(event) {
|
|
28
|
+
this.saveNewPaymentMethodChecked = event.detail;
|
|
29
|
+
}
|
|
30
|
+
async fillBillingForm(fields) {
|
|
31
|
+
this.billingFormRef.fill(fields);
|
|
32
|
+
}
|
|
33
|
+
async resolvePaymentMethod(insuranceValidation) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
if (!this.paymentMethodFormRef || !this.billingFormRef)
|
|
36
|
+
return;
|
|
37
|
+
const isValid = await this.validate();
|
|
38
|
+
if (!isValid || !insuranceValidation.isValid) {
|
|
39
|
+
return { validationError: true };
|
|
40
|
+
}
|
|
41
|
+
const tokenizeResponse = await this.tokenize();
|
|
42
|
+
if (tokenizeResponse.error) {
|
|
43
|
+
return { error: tokenizeResponse.error };
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const tokenizeRessponseData = tokenizeResponse.data;
|
|
47
|
+
return { token: ((_a = tokenizeRessponseData.card) === null || _a === void 0 ? void 0 : _a.token) || ((_b = tokenizeRessponseData.bank_account) === null || _b === void 0 ? void 0 : _b.token) };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async validate() {
|
|
51
|
+
const billingFormValidation = await this.billingFormRef.validate();
|
|
52
|
+
const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();
|
|
53
|
+
return billingFormValidation.isValid && paymentMethodFormValidation.isValid;
|
|
54
|
+
}
|
|
55
|
+
async tokenize() {
|
|
56
|
+
try {
|
|
57
|
+
const billingFormFieldValues = await this.billingFormRef.getValues();
|
|
58
|
+
let paymentMethodData;
|
|
59
|
+
if (this.saveNewPaymentMethodChecked) {
|
|
60
|
+
paymentMethodData = Object.assign(Object.assign({}, billingFormFieldValues), { payment_method_group_id: this.paymentMethodGroupId });
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
paymentMethodData = Object.assign({}, billingFormFieldValues);
|
|
64
|
+
}
|
|
65
|
+
const clientId = this.authToken;
|
|
66
|
+
const tokenizeResponse = await this.paymentMethodFormRef.tokenize(clientId, paymentMethodData, this.accountId);
|
|
67
|
+
return tokenizeResponse;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return error;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
showNewPaymentMethodForm() {
|
|
74
|
+
var _a;
|
|
75
|
+
return (h("div", { class: "mt-2 pb-4 border-bottom" }, h("div", { class: "mb-3" }, h("justifi-payment-method-form", { ref: (el) => (this.paymentMethodFormRef = el), "payment-method-form-type": (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, "iframe-origin": this.iframeOrigin })), h("h3", { class: "fs-6 fw-bold lh-lg mb-4" }, "Billing address"), h("justifi-billing-form", { ref: (el) => (this.billingFormRef = el) }), h("justifi-save-new-payment-method", { hidden: !this.paymentMethodGroupId })));
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
var _a, _b, _c, _d;
|
|
79
|
+
return (h("div", { key: 'd597ba8b0ac2a650a14a79d002a91ef3edf604a4', class: "payment-method" }, h("div", { key: 'a287f7ffd480f17f0f1093d71b9d02fe3db39e0f', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: 'f53d08d048cc242414fcf6794614ad2334db81bb', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '01712a80a30df19a7b540434532cffb4cb3b61e8', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, PaymentMethodTypeLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.id])), this.isSelected ? this.showNewPaymentMethodForm() : null));
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
class PaymentMethodOption {
|
|
84
|
+
constructor(paymentMethod) {
|
|
85
|
+
this.id = paymentMethod.id;
|
|
86
|
+
this.brand = paymentMethod.brand;
|
|
87
|
+
this.acct_last_four = paymentMethod.acct_last_four;
|
|
88
|
+
this.type = snakeToCamel(paymentMethod.type);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
var CardBrandLabels;
|
|
92
|
+
(function (CardBrandLabels) {
|
|
93
|
+
CardBrandLabels["american_express"] = "American Express";
|
|
94
|
+
CardBrandLabels["diners_club"] = "Diners Club";
|
|
95
|
+
CardBrandLabels["discover"] = "Discover";
|
|
96
|
+
CardBrandLabels["jcb"] = "JCB";
|
|
97
|
+
CardBrandLabels["mastercard"] = "Mastercard";
|
|
98
|
+
CardBrandLabels["china_unionpay"] = "UnionPay";
|
|
99
|
+
CardBrandLabels["visa"] = "Visa";
|
|
100
|
+
CardBrandLabels["unknown"] = "Unknown";
|
|
101
|
+
})(CardBrandLabels || (CardBrandLabels = {}));
|
|
102
|
+
|
|
103
|
+
const paymentMethodOptionsCss = ":host{display:block}.payment-method-header{cursor:pointer;color:var(--jfi-radio-button-group-color);background-color:var(--jfi-radio-button-group-background-color);border-bottom:var(--jfi-radio-button-group-divider)}.payment-method-header:hover{color:var(--jfi-radio-button-group-color-hover);background-color:var(--jfi-radio-button-group-background-color-hover)}";
|
|
104
|
+
const JustifiPaymentMethodOptionsStyle0 = paymentMethodOptionsCss;
|
|
105
|
+
|
|
106
|
+
const formCheckInputCss = ".form-check-input,label{cursor:pointer}.form-check-input{background-color:var(--jfi-radio-button-background-color);border-color:var(--jfi-radio-button-border-color)}.form-check-input:checked,.form-check-input:checked:focus{background-color:var(--jfi-radio-button-background-color-selected);border-color:var(--jfi-radio-button-border-color-selected)}.form-check-input:focus{border-color:var(--jfi-radio-button-border-color-focus);box-shadow:var(--jfi-radio-button-box-shadow-focus)}";
|
|
107
|
+
const JustifiPaymentMethodOptionsStyle1 = formCheckInputCss;
|
|
108
|
+
|
|
109
|
+
const PaymentMethodOptions = class {
|
|
110
|
+
constructor(hostRef) {
|
|
111
|
+
registerInstance(this, hostRef);
|
|
112
|
+
this.toggleCreatingNewPaymentMethod = createEvent(this, "toggleCreatingNewPaymentMethod", 7);
|
|
113
|
+
this.showCard = undefined;
|
|
114
|
+
this.showAch = undefined;
|
|
115
|
+
this.showBnpl = undefined;
|
|
116
|
+
this.showSavedPaymentMethods = undefined;
|
|
117
|
+
this.paymentMethodGroupId = undefined;
|
|
118
|
+
this.bnpl = undefined;
|
|
119
|
+
this.insuranceToggled = undefined;
|
|
120
|
+
this.authToken = undefined;
|
|
121
|
+
this.accountId = undefined;
|
|
122
|
+
this.iframeOrigin = "";
|
|
123
|
+
this.savedPaymentMethods = [];
|
|
124
|
+
this.paymentAmount = undefined;
|
|
125
|
+
this.selectedPaymentMethodId = undefined;
|
|
126
|
+
this.paymentMethodOptions = [];
|
|
127
|
+
}
|
|
128
|
+
async fillBillingForm(fields) {
|
|
129
|
+
const newPaymentMethodElement = this.selectedPaymentMethodOptionRef;
|
|
130
|
+
if (newPaymentMethodElement.fillBillingForm) {
|
|
131
|
+
newPaymentMethodElement.fillBillingForm(fields);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
connectedCallback() {
|
|
135
|
+
this.paymentMethodsChanged();
|
|
136
|
+
}
|
|
137
|
+
paymentMethodsChanged() {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
this.paymentMethodOptions = this.savedPaymentMethods
|
|
140
|
+
.map((paymentMethod) => new PaymentMethodOption(paymentMethod))
|
|
141
|
+
.filter((paymentMethod) => {
|
|
142
|
+
// Don't saved card or bank account if they are disabled
|
|
143
|
+
return ((this.showCard || paymentMethod.type !== PaymentMethodTypes.card) &&
|
|
144
|
+
(this.showAch || paymentMethod.type !== PaymentMethodTypes.bankAccount));
|
|
145
|
+
});
|
|
146
|
+
if (this.showBnpl && ((_a = this.bnpl) === null || _a === void 0 ? void 0 : _a.provider) === 'sezzle' && !this.insuranceToggled) {
|
|
147
|
+
this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.sezzle }));
|
|
148
|
+
}
|
|
149
|
+
if (this.showCard) {
|
|
150
|
+
this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.card }));
|
|
151
|
+
}
|
|
152
|
+
if (this.showAch) {
|
|
153
|
+
this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.bankAccount }));
|
|
154
|
+
}
|
|
155
|
+
if (!this.selectedPaymentMethodId) {
|
|
156
|
+
this.selectedPaymentMethodId = (_b = this.paymentMethodOptions[0]) === null || _b === void 0 ? void 0 : _b.id;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
paymentMethodOptionSelected(event) {
|
|
160
|
+
this.selectedPaymentMethodId = event.detail.id;
|
|
161
|
+
}
|
|
162
|
+
async resolvePaymentMethod(insuranceValidation) {
|
|
163
|
+
var _a;
|
|
164
|
+
return await ((_a = this.selectedPaymentMethodOptionRef) === null || _a === void 0 ? void 0 : _a.resolvePaymentMethod(insuranceValidation));
|
|
165
|
+
}
|
|
166
|
+
render() {
|
|
167
|
+
var _a;
|
|
168
|
+
return (h(Host, { key: '7ee40a1bdc9ec15596e870b48cbe7b6bbc20537c' }, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
|
|
169
|
+
const newCard = paymentMethodOption.id === PaymentMethodTypes.card;
|
|
170
|
+
const newBankAccount = paymentMethodOption.id === PaymentMethodTypes.bankAccount;
|
|
171
|
+
const isSelected = this.selectedPaymentMethodId === paymentMethodOption.id;
|
|
172
|
+
const sezzle = paymentMethodOption.id === PaymentMethodTypes.sezzle;
|
|
173
|
+
if (newCard || newBankAccount) {
|
|
174
|
+
return (h("justifi-new-payment-method", { paymentMethodOption: paymentMethodOption, authToken: this.authToken, "account-id": this.accountId, "is-selected": isSelected, paymentMethodGroupId: this.paymentMethodGroupId, ref: (el) => {
|
|
175
|
+
if (isSelected) {
|
|
176
|
+
this.selectedPaymentMethodOptionRef = el;
|
|
177
|
+
}
|
|
178
|
+
} }));
|
|
179
|
+
}
|
|
180
|
+
else if (sezzle) {
|
|
181
|
+
return (h("justifi-sezzle-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, paymentAmount: this.paymentAmount, bnpl: this.bnpl, ref: (el) => {
|
|
182
|
+
if (isSelected) {
|
|
183
|
+
this.selectedPaymentMethodOptionRef = el;
|
|
184
|
+
}
|
|
185
|
+
} }));
|
|
186
|
+
}
|
|
187
|
+
else if (this.showSavedPaymentMethods) {
|
|
188
|
+
return (h("justifi-saved-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, ref: (el) => {
|
|
189
|
+
if (isSelected) {
|
|
190
|
+
this.selectedPaymentMethodOptionRef = el;
|
|
191
|
+
}
|
|
192
|
+
} }));
|
|
193
|
+
}
|
|
194
|
+
})));
|
|
195
|
+
}
|
|
196
|
+
static get watchers() { return {
|
|
197
|
+
"savedPaymentMethods": ["paymentMethodsChanged"]
|
|
198
|
+
}; }
|
|
199
|
+
};
|
|
200
|
+
PaymentMethodOptions.style = JustifiPaymentMethodOptionsStyle0 + JustifiPaymentMethodOptionsStyle1;
|
|
201
|
+
|
|
202
|
+
const SavedPaymentMethod = class {
|
|
203
|
+
constructor(hostRef) {
|
|
204
|
+
registerInstance(this, hostRef);
|
|
205
|
+
this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
|
|
206
|
+
this.onPaymentMethodOptionClick = () => {
|
|
207
|
+
this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
|
|
208
|
+
};
|
|
209
|
+
this.iframeOrigin = "";
|
|
210
|
+
this.paymentMethodOption = undefined;
|
|
211
|
+
this.isSelected = undefined;
|
|
212
|
+
}
|
|
213
|
+
async resolvePaymentMethod(insuranceValidation) {
|
|
214
|
+
var _a;
|
|
215
|
+
if (!insuranceValidation.isValid) {
|
|
216
|
+
return { validationError: true };
|
|
217
|
+
}
|
|
218
|
+
return { token: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id };
|
|
219
|
+
}
|
|
220
|
+
;
|
|
221
|
+
render() {
|
|
222
|
+
var _a, _b, _c, _d, _e;
|
|
223
|
+
return (h(Fragment, { key: '247dafc3fe4011c5f6a2202690310eedfa5422c8' }, h("div", { key: '9cfb0b6ca9c10e5cc6173832bb8211ddb1d0ae5b', class: "payment-method" }, h("div", { key: 'd247cc4cf9f7bf43d7153134c66a921b5bfc49bc', class: "payment-method-header p-3", onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '180c3aa6c4153bccf7cb620b6df49cc288754cd2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: '6ec14d77e8171a1ddb37c686189878a7ebb4b4f4', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, CardBrandLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.brand], " *", (_e = this.paymentMethodOption) === null || _e === void 0 ? void 0 :
|
|
224
|
+
_e.acct_last_four)))));
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const sezzleLogo = (h("img", { class: "sezzle-smart-button-logo-img", src: "https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg", alt: "Sezzle", style: {
|
|
229
|
+
display: 'inline',
|
|
230
|
+
width: '80px',
|
|
231
|
+
marginLeft: '5px',
|
|
232
|
+
marginTop: '-5px',
|
|
233
|
+
} }));
|
|
234
|
+
const SezzlePaymentMethod = class {
|
|
235
|
+
constructor(hostRef) {
|
|
236
|
+
registerInstance(this, hostRef);
|
|
237
|
+
this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
|
|
238
|
+
this.onPaymentMethodOptionClick = () => {
|
|
239
|
+
this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
|
|
240
|
+
};
|
|
241
|
+
this.initializeSezzleCheckout = () => {
|
|
242
|
+
let resolveSezzlePromise;
|
|
243
|
+
this.sezzlePromise = new Promise((resolve) => { resolveSezzlePromise = resolve; });
|
|
244
|
+
const bnpl = this.bnpl;
|
|
245
|
+
const amount = +this.paymentAmount; // convert to number
|
|
246
|
+
const Checkout = window.Checkout;
|
|
247
|
+
const checkout = new Checkout({
|
|
248
|
+
mode: 'popup',
|
|
249
|
+
publicKey: bnpl.provider_client_id,
|
|
250
|
+
apiMode: bnpl.provider_mode,
|
|
251
|
+
apiVersion: bnpl.provider_api_version,
|
|
252
|
+
});
|
|
253
|
+
checkout.sezzleButtonElement = this.sezzleButtonRef;
|
|
254
|
+
checkout.init({
|
|
255
|
+
onClick: function (event) {
|
|
256
|
+
event.preventDefault();
|
|
257
|
+
checkout.startCheckout({
|
|
258
|
+
checkout_url: bnpl.provider_checkout_url
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
onComplete: (event) => resolveSezzlePromise({ bnpl: event.data }),
|
|
262
|
+
onCancel: (event) => resolveSezzlePromise({ bnpl: event.data }),
|
|
263
|
+
onFailure: (event) => resolveSezzlePromise({ bnpl: event.data }),
|
|
264
|
+
});
|
|
265
|
+
this.sezzleCheckout = checkout;
|
|
266
|
+
this.installmentPlan = this.sezzleCheckout.getInstallmentPlan(amount);
|
|
267
|
+
};
|
|
268
|
+
this.iframeOrigin = "";
|
|
269
|
+
this.bnpl = undefined;
|
|
270
|
+
this.clientId = undefined;
|
|
271
|
+
this.accountId = undefined;
|
|
272
|
+
this.paymentMethodOption = undefined;
|
|
273
|
+
this.isSelected = undefined;
|
|
274
|
+
this.paymentAmount = undefined;
|
|
275
|
+
this.installmentPlan = undefined;
|
|
276
|
+
this.sezzleCheckout = undefined;
|
|
277
|
+
this.sezzlePromise = undefined;
|
|
278
|
+
}
|
|
279
|
+
componentDidRender() {
|
|
280
|
+
this.scriptRef.onload = () => {
|
|
281
|
+
this.sezzleButtonRef = document.createElement('button');
|
|
282
|
+
this.initializeSezzleCheckout();
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
async resolvePaymentMethod(insuranceValidation) {
|
|
286
|
+
if (!insuranceValidation.isValid) {
|
|
287
|
+
return { validationError: true };
|
|
288
|
+
}
|
|
289
|
+
this.sezzleButtonRef.click();
|
|
290
|
+
return this.sezzlePromise;
|
|
291
|
+
}
|
|
292
|
+
render() {
|
|
293
|
+
var _a, _b, _c, _d, _e;
|
|
294
|
+
return (h("div", { key: '1b4e4a142e1e59465e0db5515ee6b0a0b2aac146', class: "payment-method" }, h("script", { key: 'c835bc94836949e2362974eaeefca1f6a579a1a0', src: "https://checkout-sdk.sezzle.com/checkout.min.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", { key: '051a0392e6353116423f706be48eb266daf12b84', class: `payment-method-header p-3`, onClick: () => this.onPaymentMethodOptionClick() }, h("input", { key: '6dd0d61f1b8788b45b008f5ac05f8a8b6a6591f2', type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { key: 'caf3429bae616a016f58e141ac5c4493174cf3ef', htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, h("div", { key: '0e4ea85fc6fc32a1c35fe0dac86f21ab7f86eb0a' }, "Buy now, pay later with ", sezzleLogo), this.installmentPlan && (h("small", { key: '3740565f14b87aa2e4af44b7e2b12d93d6e454c2' }, h("span", { key: 'ca9b6dff0042c41d378b101067d060092234fa7c' }, (_d = this.installmentPlan) === null || _d === void 0 ? void 0 : _d.installments.length), "\u00A0", h("span", { key: '14ab21fd2d9bd612f41d5cd3e175402593012619' }, this.installmentPlan.schedule, " payments of"), "\u00A0", h("span", { key: '25e08c1e711af0979e14bbb911aedb58f59bc180', class: "fw-bold" }, formatCurrency((_e = this.installmentPlan) === null || _e === void 0 ? void 0 : _e.installments[0].amountInCents))))))));
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export { NewPaymentMethod as justifi_new_payment_method, PaymentMethodOptions as justifi_payment_method_options, SavedPaymentMethod as justifi_saved_payment_method, SezzlePaymentMethod as justifi_sezzle_payment_method };
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
import{h
|
|
1
|
+
import { h } from './p-fad19d75.js';
|
|
2
|
+
|
|
3
|
+
const LoadingState = () => (h("main", { part: "detail-loading-state", class: "p-4 d-flex justify-content-center text-center", style: { fontSize: '1.2rem' } },
|
|
4
|
+
h("div", { part: "detail-loading-spinner", class: "spinner-border spinner-border-sm", role: "status" },
|
|
5
|
+
h("span", { class: "visually-hidden" }, "Loading..."))));
|
|
6
|
+
const ErrorState = (errorMessage) => (h("main", { part: "detail-empty-state", class: "p-4 d-flex justify-content-center text-center", style: { fontSize: '1.2rem' } },
|
|
7
|
+
h("div", null, errorMessage)));
|
|
8
|
+
const DetailSectionTitle = (props) => [
|
|
9
|
+
h("h5", { part: "detail-section-title", class: "mt-4" }, props.sectionTitle),
|
|
10
|
+
h("hr", null),
|
|
11
|
+
];
|
|
12
|
+
const DetailItem = ({ title, value, }) => title && value ? (h("div", { class: "d-table-row gap-2" },
|
|
13
|
+
h("span", { part: "detail-section-item-title", class: "fw-bold d-table-cell px-2" }, title),
|
|
14
|
+
h("span", { part: "detail-section-item-data", class: "flex-1 d-table-cell px-2 text-wrap", innerHTML: value }))) : null;
|
|
15
|
+
const EntityHeadInfoItem = ({ title, value, classes, }) => (h("div", { part: "detail-head-info-item", class: `d-flex flex-column ${classes}` },
|
|
16
|
+
h("span", { part: "detail-head-info-item-title", class: "fw-bold border-1 border-bottom ps-2 pe-2" }, title),
|
|
17
|
+
h("span", { part: "detail-head-info-item-data", class: "pt-2 ps-2 pe-2" }, value)));
|
|
18
|
+
const EntityHeadInfo = ({ title, slot, badge }, children) => (h("div", { slot: slot, part: "detail-head", class: "p-2" },
|
|
19
|
+
h("div", { class: "d-flex flex-row align-items-center gap-2 mb-2" },
|
|
20
|
+
h("h1", { class: "m-0", part: "detail-title" }, title),
|
|
21
|
+
badge),
|
|
22
|
+
h("div", { part: "detail-head-info", class: "d-flex flex-row align-items-top" }, children)));
|
|
23
|
+
const CodeBlock = ({ metadata }) => metadata && Object.keys(metadata).length ? (h("div", { class: 'mt-4' },
|
|
24
|
+
h("pre", { part: "detail-metadata", class: "p-2", "aria-label": "metadata content" },
|
|
25
|
+
h("code", null, JSON.stringify(metadata, null, 2))))) : null;
|
|
26
|
+
|
|
27
|
+
export { CodeBlock as C, DetailSectionTitle as D, ErrorState as E, LoadingState as L, EntityHeadInfo as a, EntityHeadInfoItem as b, DetailItem as c };
|
|
@@ -1 +1,120 @@
|
|
|
1
|
-
var
|
|
1
|
+
var CaptureStrategy;
|
|
2
|
+
(function (CaptureStrategy) {
|
|
3
|
+
CaptureStrategy["automatic"] = "automatic";
|
|
4
|
+
CaptureStrategy["manual"] = "manual";
|
|
5
|
+
})(CaptureStrategy || (CaptureStrategy = {}));
|
|
6
|
+
var PaymentMethodTypes;
|
|
7
|
+
(function (PaymentMethodTypes) {
|
|
8
|
+
PaymentMethodTypes["card"] = "card";
|
|
9
|
+
PaymentMethodTypes["bankAccount"] = "bankAccount";
|
|
10
|
+
PaymentMethodTypes["sezzle"] = "sezzle";
|
|
11
|
+
PaymentMethodTypes["saved"] = "saved";
|
|
12
|
+
})(PaymentMethodTypes || (PaymentMethodTypes = {}));
|
|
13
|
+
var PaymentStatuses;
|
|
14
|
+
(function (PaymentStatuses) {
|
|
15
|
+
PaymentStatuses["pending"] = "pending";
|
|
16
|
+
PaymentStatuses["automatic"] = "automatic";
|
|
17
|
+
PaymentStatuses["authorized"] = "authorized";
|
|
18
|
+
PaymentStatuses["succeeded"] = "succeeded";
|
|
19
|
+
PaymentStatuses["failed"] = "failed";
|
|
20
|
+
PaymentStatuses["disputed"] = "disputed";
|
|
21
|
+
PaymentStatuses["fully_refunded"] = "fully_refunded";
|
|
22
|
+
PaymentStatuses["partially_refunded"] = "partially_refunded";
|
|
23
|
+
})(PaymentStatuses || (PaymentStatuses = {}));
|
|
24
|
+
var PaymentDisputedStatuses;
|
|
25
|
+
(function (PaymentDisputedStatuses) {
|
|
26
|
+
// if a dispute is 'won', we don't show a dispute status, just general status
|
|
27
|
+
PaymentDisputedStatuses["lost"] = "lost";
|
|
28
|
+
PaymentDisputedStatuses["open"] = "open";
|
|
29
|
+
})(PaymentDisputedStatuses || (PaymentDisputedStatuses = {}));
|
|
30
|
+
class PaymentMethod {
|
|
31
|
+
constructor(paymentMethod) {
|
|
32
|
+
this.card = paymentMethod.card ? new Card(paymentMethod.card) : undefined;
|
|
33
|
+
this.bank_account = paymentMethod.bank_account
|
|
34
|
+
? new BankAccount(paymentMethod.bank_account)
|
|
35
|
+
: undefined;
|
|
36
|
+
}
|
|
37
|
+
get payersName() {
|
|
38
|
+
if (this.card) {
|
|
39
|
+
return this.card.name;
|
|
40
|
+
}
|
|
41
|
+
else if (this.bank_account) {
|
|
42
|
+
return this.bank_account.name;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
get lastFourDigits() {
|
|
47
|
+
if (this.card) {
|
|
48
|
+
return `**** ${this.card.acct_last_four}`;
|
|
49
|
+
}
|
|
50
|
+
else if (this.bank_account) {
|
|
51
|
+
return `**** ${this.bank_account.acct_last_four}`;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
class BankAccount {
|
|
57
|
+
constructor(bankAccount) {
|
|
58
|
+
this.id = bankAccount.id;
|
|
59
|
+
this.acct_last_four = bankAccount.acct_last_four;
|
|
60
|
+
this.name = bankAccount.name;
|
|
61
|
+
this.brand = bankAccount.brand;
|
|
62
|
+
this.token = bankAccount.token;
|
|
63
|
+
this.created_at = bankAccount.created_at;
|
|
64
|
+
this.updated_at = bankAccount.updated_at;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
class Card {
|
|
68
|
+
constructor(card) {
|
|
69
|
+
this.id = card.id || '';
|
|
70
|
+
this.acct_last_four = card.acct_last_four;
|
|
71
|
+
this.name = card.name;
|
|
72
|
+
this.brand = card.brand;
|
|
73
|
+
this.token = card.token;
|
|
74
|
+
this.created_at = card.created_at;
|
|
75
|
+
this.updated_at = card.updated_at;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
class Payment {
|
|
79
|
+
constructor(payment) {
|
|
80
|
+
this.id = payment.id;
|
|
81
|
+
this.account_id = payment.account_id;
|
|
82
|
+
this.amount = payment.amount;
|
|
83
|
+
this.amount_disputed = payment.amount_disputed;
|
|
84
|
+
this.amount_refundable = payment.amount_refundable;
|
|
85
|
+
this.amount_refunded = payment.amount_refunded;
|
|
86
|
+
this.balance = payment.balance;
|
|
87
|
+
this.captured = payment.captured;
|
|
88
|
+
this.capture_strategy = payment.capture_strategy;
|
|
89
|
+
this.currency = payment.currency;
|
|
90
|
+
this.description = payment.description;
|
|
91
|
+
this.disputed = payment.disputed;
|
|
92
|
+
this.disputes = payment.disputes;
|
|
93
|
+
this.error_code = payment.error_code;
|
|
94
|
+
this.error_description = payment.error_description;
|
|
95
|
+
this.fee_amount = payment.fee_amount;
|
|
96
|
+
this.is_test = payment.is_test;
|
|
97
|
+
this.metadata = payment.metadata;
|
|
98
|
+
this.payment_method = new PaymentMethod(payment.payment_method);
|
|
99
|
+
this.payment_intent_id = payment.payment_intent_id;
|
|
100
|
+
this.refunded = payment.refunded;
|
|
101
|
+
this.status = payment.status;
|
|
102
|
+
this.created_at = payment.created_at;
|
|
103
|
+
this.updated_at = payment.updated_at;
|
|
104
|
+
}
|
|
105
|
+
get disputedStatus() {
|
|
106
|
+
const lost = this.disputes.some((dispute) => dispute.status === PaymentDisputedStatuses.lost);
|
|
107
|
+
// if a dispute is 'won', we don't show a dispute status, just general status
|
|
108
|
+
if (!this.disputed) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
else if (lost) {
|
|
112
|
+
return PaymentDisputedStatuses.lost;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return PaymentDisputedStatuses.open;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { Payment as P, PaymentMethodTypes as a };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { J as JustifiAnalytics } from './p-15eafa87.js';
|
|
3
|
+
import { a as ComponentErrorCodes, C as ComponentErrorSeverity } from './p-14c91ffd.js';
|
|
4
|
+
import { m as makeGetBusiness, a as makePostProvisioning } from './p-5968ff8a.js';
|
|
5
|
+
import { B as BusinessService } from './p-0e1bc91e.js';
|
|
6
|
+
import { A as Api } from './p-29c0b182.js';
|
|
7
|
+
import './p-2e8f4937.js';
|
|
8
|
+
import './p-8115b2f4.js';
|
|
9
|
+
|
|
10
|
+
class ProvisionService {
|
|
11
|
+
async postProvisioning(authToken, businessId, product) {
|
|
12
|
+
const endpoint = `entities/provisioning`;
|
|
13
|
+
const payload = {
|
|
14
|
+
business_id: businessId,
|
|
15
|
+
product_category: product,
|
|
16
|
+
};
|
|
17
|
+
return Api({ authToken, apiOrigin: "" }).post(endpoint, JSON.stringify(payload));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const PaymentProvisioning = class {
|
|
22
|
+
constructor(hostRef) {
|
|
23
|
+
registerInstance(this, hostRef);
|
|
24
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
25
|
+
this.postProvisioning = undefined;
|
|
26
|
+
this.getBusiness = undefined;
|
|
27
|
+
this.businessId = undefined;
|
|
28
|
+
this.authToken = undefined;
|
|
29
|
+
this.allowOptionalFields = false;
|
|
30
|
+
this.formTitle = 'Business Information';
|
|
31
|
+
}
|
|
32
|
+
propChanged() {
|
|
33
|
+
this.initializeApi();
|
|
34
|
+
}
|
|
35
|
+
componentWillLoad() {
|
|
36
|
+
this.analytics = new JustifiAnalytics(this);
|
|
37
|
+
this.initializeApi();
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
this.analytics.cleanup();
|
|
41
|
+
}
|
|
42
|
+
initializeApi() {
|
|
43
|
+
if (this.authToken && this.businessId) {
|
|
44
|
+
this.getBusiness = makeGetBusiness({
|
|
45
|
+
authToken: this.authToken,
|
|
46
|
+
businessId: this.businessId,
|
|
47
|
+
service: new BusinessService()
|
|
48
|
+
});
|
|
49
|
+
this.postProvisioning = makePostProvisioning({
|
|
50
|
+
authToken: this.authToken,
|
|
51
|
+
businessId: this.businessId,
|
|
52
|
+
product: 'payment',
|
|
53
|
+
service: new ProvisionService()
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this.errorEvent.emit({
|
|
58
|
+
message: 'auth-token and business-id are required',
|
|
59
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
60
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
return (h("justifi-payment-provisioning-core", { key: 'a93ee23fabf4bdeb381e924bfdf684ddd183075a', businessId: this.businessId, authToken: this.authToken, allowOptionalFields: this.allowOptionalFields, formTitle: this.formTitle, getBusiness: this.getBusiness, postProvisioning: this.postProvisioning }));
|
|
66
|
+
}
|
|
67
|
+
static get watchers() { return {
|
|
68
|
+
"authToken": ["propChanged"],
|
|
69
|
+
"businessId": ["propChanged"]
|
|
70
|
+
}; }
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { PaymentProvisioning as justifi_payment_provisioning };
|
|
@@ -1 +1,34 @@
|
|
|
1
|
-
import{h
|
|
1
|
+
import { h } from './p-fad19d75.js';
|
|
2
|
+
|
|
3
|
+
const TableEmptyState = (props) => {
|
|
4
|
+
const { columnSpan, isEmpty } = props;
|
|
5
|
+
if (!columnSpan || !isEmpty) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return (h("tr", null,
|
|
9
|
+
h("td", { class: "empty-state", part: "empty-state", colSpan: columnSpan, style: { textAlign: 'center' } }, "No results")));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const TableErrorState = (props) => {
|
|
13
|
+
const { columnSpan, errorMessage } = props;
|
|
14
|
+
if (!columnSpan || !errorMessage) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return (h("tr", null,
|
|
18
|
+
h("td", { class: "error-state", part: "error-state", colSpan: columnSpan, "data-test-id": "table-error-state", style: { textAlign: 'center' } },
|
|
19
|
+
"An unexpected error occurred: ",
|
|
20
|
+
errorMessage)));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const TableLoadingState = (props) => {
|
|
24
|
+
const { columnSpan, isLoading } = props;
|
|
25
|
+
if (!columnSpan || !isLoading) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return (h("tr", null,
|
|
29
|
+
h("td", { class: "loading-state", part: "loading-state-cell", colSpan: columnSpan, style: { textAlign: 'center' } },
|
|
30
|
+
h("div", { part: "loading-state-spinner", class: "spinner-border", role: "status" },
|
|
31
|
+
h("span", { class: "visually-hidden" }, "Loading...")))));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { TableLoadingState as T, TableEmptyState as a, TableErrorState as b };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment } from './p-fad19d75.js';
|
|
2
|
+
import './p-56f6ce4c.js';
|
|
3
|
+
import { a as PaymentMethodTypes } from './p-df21aaad.js';
|
|
4
|
+
import './p-e3fab0e2.js';
|
|
5
|
+
|
|
6
|
+
const paymentMethodSelectorCss = ":host{display:block}.jfi-btn-radio+.jfi-btn-radio-label{color:var(--jfi-radio-button-color);background-color:var(--jfi-radio-button-background-color);border-color:var(--jfi-radio-button-border-color);padding:var(--jfi-radio-button-padding);font-size:var(--jfi-radio-button-font-size)}.jfi-btn-radio:focus+.jfi-btn-radio-label{box-shadow:var(--jfi-box-shadow-focus)}.jfi-btn-radio+.jfi-btn-radio-label:hover{color:var(--jfi-radio-button-color-hover);border-color:var(--jfi-radio-button-border-color-hover);background-color:var(--jfi-radio-button-background-color-hover)}.jfi-btn-radio:checked+.jfi-btn-radio-label:hover{color:var(--jfi-radio-button-color-selected-hover);border-color:var(--jfi-radio-button-border-color-selected-hover);background-color:var(--jfi-radio-button-background-color-selected-hover)}.jfi-btn-radio:checked+.jfi-btn-radio-label{color:var(--jfi-radio-button-color-selected);background-color:var(--jfi-radio-button-background-color-selected);border-color:var(--jfi-radio-button-border-color-selected)}.jfi-btn-radio-group{font-family:var(--jfi-layout-font-family);display:inline-flex;width:var(--jfi-radio-button-group-width)}";
|
|
7
|
+
const JustifiPaymentMethodSelectorStyle0 = paymentMethodSelectorCss;
|
|
8
|
+
|
|
9
|
+
const PaymentMethodLabels = {
|
|
10
|
+
bankAccount: 'Bank Account',
|
|
11
|
+
card: 'Card',
|
|
12
|
+
};
|
|
13
|
+
const PaymentMethodSelector = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
registerInstance(this, hostRef);
|
|
16
|
+
this.paymentMethodSelected = createEvent(this, "paymentMethodSelected", 7);
|
|
17
|
+
this.paymentMethodTypes = [PaymentMethodTypes.card, PaymentMethodTypes.bankAccount];
|
|
18
|
+
this.selectedPaymentMethodType = undefined;
|
|
19
|
+
}
|
|
20
|
+
onChangeHandler(event) {
|
|
21
|
+
this.paymentMethodSelected.emit(event.target.value);
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return (h("div", { key: 'a0cd592094f7f69955469de84addde1d4bc5af4d', class: "btn-group jfi-btn-radio-group", role: "group", "aria-label": "Radio toggle group for payment method" }, this.paymentMethodTypes.map((paymentMethodType) => (h(Fragment, null, h("input", { id: paymentMethodType, type: "radio", name: "paymentMethodType", value: paymentMethodType, onChange: (event) => this.onChangeHandler(event), checked: this.selectedPaymentMethodType === paymentMethodType, class: "btn-check jfi-btn-radio" }), h("label", { htmlFor: paymentMethodType, class: "btn btn-outline-primary jfi-btn-radio-label" }, PaymentMethodLabels[paymentMethodType]))))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
PaymentMethodSelector.style = JustifiPaymentMethodSelectorStyle0;
|
|
28
|
+
|
|
29
|
+
export { PaymentMethodSelector as justifi_payment_method_selector };
|
|
@@ -1 +1,43 @@
|
|
|
1
|
-
var
|
|
1
|
+
var PayoutStatuses;
|
|
2
|
+
(function (PayoutStatuses) {
|
|
3
|
+
PayoutStatuses["paid"] = "paid";
|
|
4
|
+
PayoutStatuses["failed"] = "failed";
|
|
5
|
+
PayoutStatuses["forwarded"] = "forwarded";
|
|
6
|
+
PayoutStatuses["scheduled"] = "scheduled";
|
|
7
|
+
PayoutStatuses["in_transit"] = "in_transit";
|
|
8
|
+
PayoutStatuses["canceled"] = "canceled";
|
|
9
|
+
})(PayoutStatuses || (PayoutStatuses = {}));
|
|
10
|
+
var PayoutStatusesSafeNames;
|
|
11
|
+
(function (PayoutStatusesSafeNames) {
|
|
12
|
+
PayoutStatusesSafeNames["paid"] = "Paid";
|
|
13
|
+
PayoutStatusesSafeNames["failed"] = "Failed";
|
|
14
|
+
PayoutStatusesSafeNames["forwarded"] = "Forwarded";
|
|
15
|
+
PayoutStatusesSafeNames["scheduled"] = "Scheduled";
|
|
16
|
+
PayoutStatusesSafeNames["in_transit"] = "In Transit";
|
|
17
|
+
PayoutStatusesSafeNames["canceled"] = "Canceled";
|
|
18
|
+
})(PayoutStatusesSafeNames || (PayoutStatusesSafeNames = {}));
|
|
19
|
+
class Payout {
|
|
20
|
+
constructor(payout) {
|
|
21
|
+
this.id = payout.id;
|
|
22
|
+
this.account_id = payout.account_id;
|
|
23
|
+
this.amount = payout.amount;
|
|
24
|
+
this.bank_account = payout.bank_account;
|
|
25
|
+
this.currency = payout.currency;
|
|
26
|
+
this.delivery_method = payout.delivery_method || 'standard';
|
|
27
|
+
this.description = payout.description;
|
|
28
|
+
this.deposits_at = payout.deposits_at;
|
|
29
|
+
this.fees_total = payout.fees_total;
|
|
30
|
+
this.refunds_count = payout.refunds_count;
|
|
31
|
+
this.refunds_total = payout.refunds_total;
|
|
32
|
+
this.payments_count = payout.payments_count;
|
|
33
|
+
this.payments_total = payout.payments_total;
|
|
34
|
+
this.payout_type = payout.payout_type;
|
|
35
|
+
this.other_total = payout.other_total;
|
|
36
|
+
this.status = payout.status;
|
|
37
|
+
this.metadata = payout.metadata;
|
|
38
|
+
this.created_at = payout.created_at;
|
|
39
|
+
this.updated_at = payout.updated_at;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { Payout as P, PayoutStatuses as a, PayoutStatusesSafeNames as b };
|