@pelcro/react-pelcro-js 3.6.0-beta.20 → 3.6.0-beta.22
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/index.cjs.js +611 -23
- package/dist/index.esm.js +611 -23
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7924,10 +7924,10 @@ const getEntitlementsFromElem = elem => {
|
|
|
7924
7924
|
return elem.dataset.pelcroEntitlements.split(",").map(entitlement => entitlement.trim()).filter(entitlement => entitlement);
|
|
7925
7925
|
};
|
|
7926
7926
|
const getPaymentCardIcon$1 = name => {
|
|
7927
|
-
var _icons$name;
|
|
7927
|
+
var _icons$name$toLowerCa;
|
|
7928
7928
|
|
|
7929
7929
|
const icons = {
|
|
7930
|
-
|
|
7930
|
+
visa: /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
7931
7931
|
className: "plc-w-16",
|
|
7932
7932
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7933
7933
|
viewBox: "0 0 48 48"
|
|
@@ -7938,7 +7938,7 @@ const getPaymentCardIcon$1 = name => {
|
|
|
7938
7938
|
fill: "#FFC107",
|
|
7939
7939
|
d: "M12.212,24.945l-0.966-4.748c0,0-0.437-1.029-1.573-1.029c-1.136,0-4.44,0-4.44,0S10.894,20.84,12.212,24.945z"
|
|
7940
7940
|
})),
|
|
7941
|
-
|
|
7941
|
+
mastercard: /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
7942
7942
|
className: "plc-w-16",
|
|
7943
7943
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7944
7944
|
viewBox: "0 0 48 48"
|
|
@@ -7952,7 +7952,7 @@ const getPaymentCardIcon$1 = name => {
|
|
|
7952
7952
|
fill: "#ff3d00",
|
|
7953
7953
|
d: "M18,24c0,4.755,2.376,8.95,6,11.48c3.624-2.53,6-6.725,6-11.48s-2.376-8.95-6-11.48 C20.376,15.05,18,19.245,18,24z"
|
|
7954
7954
|
})),
|
|
7955
|
-
"
|
|
7955
|
+
"american express": /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
7956
7956
|
className: "plc-w-16",
|
|
7957
7957
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7958
7958
|
viewBox: "0 0 48 48"
|
|
@@ -7964,7 +7964,7 @@ const getPaymentCardIcon$1 = name => {
|
|
|
7964
7964
|
d: "M22.255 20l-2.113 4.683L18.039 20h-2.695v6.726L12.341 20h-2.274L7 26.981h1.815l.671-1.558h3.432l.682 1.558h3.465v-5.185l2.299 5.185h1.563l2.351-5.095v5.095H25V20H22.255zM10.135 23.915l1.026-2.44 1.066 2.44H10.135zM37.883 23.413L41 20.018h-2.217l-1.994 2.164L34.86 20H28v6.982h6.635l2.092-2.311L38.767 27h2.21L37.883 23.413zM33.728 25.516h-4.011v-1.381h3.838v-1.323h-3.838v-1.308l4.234.012 1.693 1.897L33.728 25.516z"
|
|
7965
7965
|
}))
|
|
7966
7966
|
};
|
|
7967
|
-
return (_icons$name = icons[name]) !== null && _icons$name !== void 0 ? _icons$name : /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
7967
|
+
return (_icons$name$toLowerCa = icons[name.toLowerCase()]) !== null && _icons$name$toLowerCa !== void 0 ? _icons$name$toLowerCa : /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
7968
7968
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7969
7969
|
className: "plc-w-16",
|
|
7970
7970
|
fill: "none",
|
|
@@ -9975,12 +9975,16 @@ const debounce = (func, waitTime) => {
|
|
|
9975
9975
|
};
|
|
9976
9976
|
};
|
|
9977
9977
|
function getSiteCardProcessor() {
|
|
9978
|
-
var _window$Pelcro$site$r;
|
|
9978
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
9979
9979
|
|
|
9980
9980
|
if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_gateway_settings) {
|
|
9981
9981
|
return "vantiv";
|
|
9982
9982
|
}
|
|
9983
9983
|
|
|
9984
|
+
if ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r2 !== void 0 && _window$Pelcro$site$r2.tap_gateway_settings) {
|
|
9985
|
+
return "tap";
|
|
9986
|
+
}
|
|
9987
|
+
|
|
9984
9988
|
return "stripe";
|
|
9985
9989
|
}
|
|
9986
9990
|
|
|
@@ -10086,6 +10090,14 @@ const loadPaymentSDKs = () => {
|
|
|
10086
10090
|
const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
|
|
10087
10091
|
window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
|
|
10088
10092
|
}
|
|
10093
|
+
} // Load Tap SDKs
|
|
10094
|
+
|
|
10095
|
+
|
|
10096
|
+
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
10097
|
+
|
|
10098
|
+
if (supportsTap) {
|
|
10099
|
+
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
10100
|
+
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
10089
10101
|
}
|
|
10090
10102
|
};
|
|
10091
10103
|
const loadAuth0SDK = () => {
|
|
@@ -14198,7 +14210,7 @@ var _generateUserError = /*#__PURE__*/new WeakMap();
|
|
|
14198
14210
|
|
|
14199
14211
|
class Payment {
|
|
14200
14212
|
/**
|
|
14201
|
-
* @param {(StripeGateway|PaypalGateway|VantivGateway)} paymentGateway
|
|
14213
|
+
* @param {(StripeGateway|PaypalGateway|VantivGateway|TapGateway)} paymentGateway
|
|
14202
14214
|
*/
|
|
14203
14215
|
constructor(paymentGateway) {
|
|
14204
14216
|
_defineProperty$3(this, "execute", (options, callback) => {
|
|
@@ -14219,7 +14231,7 @@ class Payment {
|
|
|
14219
14231
|
_isPaymentGatewayInvalid.set(this, {
|
|
14220
14232
|
writable: true,
|
|
14221
14233
|
value: gateway => {
|
|
14222
|
-
return gateway && !(gateway instanceof StripeGateway || gateway instanceof PaypalGateway || gateway instanceof VantivGateway);
|
|
14234
|
+
return gateway && !(gateway instanceof StripeGateway || gateway instanceof PaypalGateway || gateway instanceof VantivGateway || gateway instanceof TapGateway);
|
|
14223
14235
|
}
|
|
14224
14236
|
});
|
|
14225
14237
|
|
|
@@ -14274,7 +14286,8 @@ class Payment {
|
|
|
14274
14286
|
const PAYMENT_GATEWAYS_ENUM = {
|
|
14275
14287
|
stripe: "stripe",
|
|
14276
14288
|
paypal: "braintree",
|
|
14277
|
-
vantiv: "vantiv"
|
|
14289
|
+
vantiv: "vantiv",
|
|
14290
|
+
tap: "tap"
|
|
14278
14291
|
};
|
|
14279
14292
|
/**
|
|
14280
14293
|
* Payment Strategies
|
|
@@ -14842,6 +14855,241 @@ class VantivGateway {
|
|
|
14842
14855
|
|
|
14843
14856
|
}
|
|
14844
14857
|
|
|
14858
|
+
var _paymentGateway4 = /*#__PURE__*/new WeakMap();
|
|
14859
|
+
|
|
14860
|
+
var _createSubscription4 = /*#__PURE__*/new WeakMap();
|
|
14861
|
+
|
|
14862
|
+
var _renewSubscription3 = /*#__PURE__*/new WeakMap();
|
|
14863
|
+
|
|
14864
|
+
var _createGiftedSubscription4 = /*#__PURE__*/new WeakMap();
|
|
14865
|
+
|
|
14866
|
+
var _renewGiftedSubscription3 = /*#__PURE__*/new WeakMap();
|
|
14867
|
+
|
|
14868
|
+
var _purchaseEcommerceOrder3 = /*#__PURE__*/new WeakMap();
|
|
14869
|
+
|
|
14870
|
+
var _payInvoice4 = /*#__PURE__*/new WeakMap();
|
|
14871
|
+
|
|
14872
|
+
class TapGateway {
|
|
14873
|
+
constructor() {
|
|
14874
|
+
_paymentGateway4.set(this, {
|
|
14875
|
+
writable: true,
|
|
14876
|
+
value: PAYMENT_GATEWAYS_ENUM["tap"]
|
|
14877
|
+
});
|
|
14878
|
+
|
|
14879
|
+
_defineProperty$3(this, "execute", (options, callback) => {
|
|
14880
|
+
const types = PAYMENT_TYPES;
|
|
14881
|
+
|
|
14882
|
+
switch (options.type) {
|
|
14883
|
+
case types.CREATE_SUBSCRIPTION:
|
|
14884
|
+
return _classPrivateFieldGet(this, _createSubscription4).call(this, options, callback);
|
|
14885
|
+
|
|
14886
|
+
case types.RENEW_SUBSCRIPTION:
|
|
14887
|
+
return _classPrivateFieldGet(this, _renewSubscription3).call(this, options, callback);
|
|
14888
|
+
|
|
14889
|
+
case types.CREATE_GIFTED_SUBSCRIPTION:
|
|
14890
|
+
return _classPrivateFieldGet(this, _createGiftedSubscription4).call(this, options, callback);
|
|
14891
|
+
|
|
14892
|
+
case types.RENEW_GIFTED_SUBSCRIPTION:
|
|
14893
|
+
return _classPrivateFieldGet(this, _renewGiftedSubscription3).call(this, options, callback);
|
|
14894
|
+
|
|
14895
|
+
case types.PURCHASE_ECOMMERCE_ORDER:
|
|
14896
|
+
return _classPrivateFieldGet(this, _purchaseEcommerceOrder3).call(this, options, callback);
|
|
14897
|
+
|
|
14898
|
+
case types.PAY_INVOICE:
|
|
14899
|
+
return _classPrivateFieldGet(this, _payInvoice4).call(this, options, callback);
|
|
14900
|
+
|
|
14901
|
+
default:
|
|
14902
|
+
console.error("Unsupported payment method: tap Gateway");
|
|
14903
|
+
}
|
|
14904
|
+
});
|
|
14905
|
+
|
|
14906
|
+
_createSubscription4.set(this, {
|
|
14907
|
+
writable: true,
|
|
14908
|
+
value: (options, callback) => {
|
|
14909
|
+
const {
|
|
14910
|
+
token,
|
|
14911
|
+
plan,
|
|
14912
|
+
couponCode,
|
|
14913
|
+
product,
|
|
14914
|
+
quantity = 1,
|
|
14915
|
+
addressId,
|
|
14916
|
+
isExistingSource
|
|
14917
|
+
} = options;
|
|
14918
|
+
const params = isExistingSource ? {
|
|
14919
|
+
source_id: token
|
|
14920
|
+
} : {
|
|
14921
|
+
payment_gateway: _classPrivateFieldGet(this, _paymentGateway4),
|
|
14922
|
+
gateway_token: token
|
|
14923
|
+
};
|
|
14924
|
+
window.Pelcro.subscription.create({
|
|
14925
|
+
quantity,
|
|
14926
|
+
auth_token: window.Pelcro.user.read().auth_token,
|
|
14927
|
+
plan_id: plan.id,
|
|
14928
|
+
campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
|
|
14929
|
+
coupon_code: couponCode,
|
|
14930
|
+
address_id: product.address_required ? addressId : null,
|
|
14931
|
+
...params
|
|
14932
|
+
}, (err, res) => {
|
|
14933
|
+
callback(err, res);
|
|
14934
|
+
});
|
|
14935
|
+
}
|
|
14936
|
+
});
|
|
14937
|
+
|
|
14938
|
+
_renewSubscription3.set(this, {
|
|
14939
|
+
writable: true,
|
|
14940
|
+
value: (options, callback) => {
|
|
14941
|
+
const {
|
|
14942
|
+
subscriptionIdToRenew,
|
|
14943
|
+
token,
|
|
14944
|
+
plan,
|
|
14945
|
+
couponCode,
|
|
14946
|
+
product,
|
|
14947
|
+
addressId,
|
|
14948
|
+
isExistingSource
|
|
14949
|
+
} = options;
|
|
14950
|
+
const params = isExistingSource ? {
|
|
14951
|
+
source_id: token
|
|
14952
|
+
} : {
|
|
14953
|
+
payment_gateway: _classPrivateFieldGet(this, _paymentGateway4),
|
|
14954
|
+
gateway_token: token
|
|
14955
|
+
};
|
|
14956
|
+
window.Pelcro.subscription.renew({
|
|
14957
|
+
auth_token: window.Pelcro.user.read().auth_token,
|
|
14958
|
+
plan_id: plan.id,
|
|
14959
|
+
coupon_code: couponCode,
|
|
14960
|
+
campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
|
|
14961
|
+
subscription_id: subscriptionIdToRenew,
|
|
14962
|
+
address_id: product.address_required ? addressId : null,
|
|
14963
|
+
...params
|
|
14964
|
+
}, (err, res) => {
|
|
14965
|
+
callback(err, res);
|
|
14966
|
+
});
|
|
14967
|
+
}
|
|
14968
|
+
});
|
|
14969
|
+
|
|
14970
|
+
_createGiftedSubscription4.set(this, {
|
|
14971
|
+
writable: true,
|
|
14972
|
+
value: (options, callback) => {
|
|
14973
|
+
const {
|
|
14974
|
+
token,
|
|
14975
|
+
plan,
|
|
14976
|
+
couponCode,
|
|
14977
|
+
product,
|
|
14978
|
+
giftRecipient,
|
|
14979
|
+
quantity = 1,
|
|
14980
|
+
addressId,
|
|
14981
|
+
isExistingSource
|
|
14982
|
+
} = options;
|
|
14983
|
+
const params = isExistingSource ? {
|
|
14984
|
+
source_id: token
|
|
14985
|
+
} : {
|
|
14986
|
+
payment_gateway: _classPrivateFieldGet(this, _paymentGateway4),
|
|
14987
|
+
gateway_token: token
|
|
14988
|
+
};
|
|
14989
|
+
window.Pelcro.subscription.create({
|
|
14990
|
+
quantity,
|
|
14991
|
+
auth_token: window.Pelcro.user.read().auth_token,
|
|
14992
|
+
plan_id: plan.id,
|
|
14993
|
+
coupon_code: couponCode,
|
|
14994
|
+
campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
|
|
14995
|
+
gift_recipient_email: giftRecipient.email,
|
|
14996
|
+
gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
|
|
14997
|
+
gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
|
|
14998
|
+
gift_start_date: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.startDate,
|
|
14999
|
+
gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
|
|
15000
|
+
address_id: product.address_required ? addressId : null,
|
|
15001
|
+
...params
|
|
15002
|
+
}, (err, res) => {
|
|
15003
|
+
callback(err, res);
|
|
15004
|
+
});
|
|
15005
|
+
}
|
|
15006
|
+
});
|
|
15007
|
+
|
|
15008
|
+
_renewGiftedSubscription3.set(this, {
|
|
15009
|
+
writable: true,
|
|
15010
|
+
value: (options, callback) => {
|
|
15011
|
+
const {
|
|
15012
|
+
subscriptionIdToRenew,
|
|
15013
|
+
token,
|
|
15014
|
+
product,
|
|
15015
|
+
plan,
|
|
15016
|
+
couponCode,
|
|
15017
|
+
addressId,
|
|
15018
|
+
isExistingSource
|
|
15019
|
+
} = options;
|
|
15020
|
+
const params = isExistingSource ? {
|
|
15021
|
+
source_id: token
|
|
15022
|
+
} : {
|
|
15023
|
+
payment_gateway: _classPrivateFieldGet(this, _paymentGateway4),
|
|
15024
|
+
gateway_token: token
|
|
15025
|
+
};
|
|
15026
|
+
window.Pelcro.subscription.renewGift({
|
|
15027
|
+
auth_token: window.Pelcro.user.read().auth_token,
|
|
15028
|
+
plan_id: plan.id,
|
|
15029
|
+
coupon_code: couponCode,
|
|
15030
|
+
subscription_id: subscriptionIdToRenew,
|
|
15031
|
+
address_id: product.address_required ? addressId : null,
|
|
15032
|
+
...params
|
|
15033
|
+
}, (err, res) => {
|
|
15034
|
+
callback(err, res);
|
|
15035
|
+
});
|
|
15036
|
+
}
|
|
15037
|
+
});
|
|
15038
|
+
|
|
15039
|
+
_purchaseEcommerceOrder3.set(this, {
|
|
15040
|
+
writable: true,
|
|
15041
|
+
value: (options, callback) => {
|
|
15042
|
+
const {
|
|
15043
|
+
token,
|
|
15044
|
+
items,
|
|
15045
|
+
couponCode,
|
|
15046
|
+
addressId,
|
|
15047
|
+
isExistingSource
|
|
15048
|
+
} = options;
|
|
15049
|
+
const params = isExistingSource ? {
|
|
15050
|
+
source_id: token
|
|
15051
|
+
} : {
|
|
15052
|
+
payment_gateway: _classPrivateFieldGet(this, _paymentGateway4),
|
|
15053
|
+
gateway_token: token
|
|
15054
|
+
};
|
|
15055
|
+
window.Pelcro.ecommerce.order.create({
|
|
15056
|
+
items,
|
|
15057
|
+
coupon_code: couponCode,
|
|
15058
|
+
campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
|
|
15059
|
+
...params,
|
|
15060
|
+
...(addressId && {
|
|
15061
|
+
address_id: addressId
|
|
15062
|
+
})
|
|
15063
|
+
}, (err, res) => {
|
|
15064
|
+
callback(err, res);
|
|
15065
|
+
});
|
|
15066
|
+
}
|
|
15067
|
+
});
|
|
15068
|
+
|
|
15069
|
+
_payInvoice4.set(this, {
|
|
15070
|
+
writable: true,
|
|
15071
|
+
value: (options, callback) => {
|
|
15072
|
+
const {
|
|
15073
|
+
token,
|
|
15074
|
+
invoiceId
|
|
15075
|
+
} = options;
|
|
15076
|
+
const params = options.isExistingSource ? {
|
|
15077
|
+
source_id: token,
|
|
15078
|
+
invoice_id: invoiceId
|
|
15079
|
+
} : {
|
|
15080
|
+
payment_gateway: _classPrivateFieldGet(this, _paymentGateway4),
|
|
15081
|
+
gateway_token: token,
|
|
15082
|
+
invoice_id: invoiceId
|
|
15083
|
+
};
|
|
15084
|
+
window.Pelcro.invoice.pay(params, (err, res) => {
|
|
15085
|
+
callback(err, res);
|
|
15086
|
+
});
|
|
15087
|
+
}
|
|
15088
|
+
});
|
|
15089
|
+
}
|
|
15090
|
+
|
|
15091
|
+
}
|
|
15092
|
+
|
|
14845
15093
|
/**
|
|
14846
15094
|
* @typedef {Object} PaymentStateType
|
|
14847
15095
|
* @property {boolean} disableSubmit
|
|
@@ -14935,6 +15183,265 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
14935
15183
|
});
|
|
14936
15184
|
updateTotalAmountWithTax();
|
|
14937
15185
|
}, []);
|
|
15186
|
+
/*====== Start Tap integration ========*/
|
|
15187
|
+
|
|
15188
|
+
const submitUsingTap = () => {
|
|
15189
|
+
var _ref, _ref2, _state$updatedPrice;
|
|
15190
|
+
|
|
15191
|
+
const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
|
|
15192
|
+
|
|
15193
|
+
if (isUsingExistingPaymentMethod) {
|
|
15194
|
+
// no need to create a new source using tap
|
|
15195
|
+
return handleTapPayment(null);
|
|
15196
|
+
}
|
|
15197
|
+
|
|
15198
|
+
if (!tapInstanceRef.current) {
|
|
15199
|
+
return console.error("Tap sdk script wasn't loaded, you need to load tap sdk before rendering the tap payment flow");
|
|
15200
|
+
}
|
|
15201
|
+
|
|
15202
|
+
const getOrderItemsTotal = () => {
|
|
15203
|
+
if (!order) {
|
|
15204
|
+
return null;
|
|
15205
|
+
}
|
|
15206
|
+
|
|
15207
|
+
const isQuickPurchase = !Array.isArray(order);
|
|
15208
|
+
|
|
15209
|
+
if (isQuickPurchase) {
|
|
15210
|
+
return order.price * order.quantity;
|
|
15211
|
+
}
|
|
15212
|
+
|
|
15213
|
+
if (order.length === 0) {
|
|
15214
|
+
return null;
|
|
15215
|
+
}
|
|
15216
|
+
|
|
15217
|
+
return order.reduce((total, item) => {
|
|
15218
|
+
return total + item.price * item.quantity;
|
|
15219
|
+
}, 0);
|
|
15220
|
+
};
|
|
15221
|
+
|
|
15222
|
+
const totalAmount = (_ref = (_ref2 = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice === null || invoice === void 0 ? void 0 : invoice.amount_remaining) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
|
|
15223
|
+
tapInstanceRef.current.createToken(tapInstanceCard.current).then(function (result) {
|
|
15224
|
+
if (result.error) {
|
|
15225
|
+
// Inform the user if there was an error
|
|
15226
|
+
onFailure(result.error);
|
|
15227
|
+
dispatch({
|
|
15228
|
+
type: DISABLE_SUBMIT,
|
|
15229
|
+
payload: false
|
|
15230
|
+
});
|
|
15231
|
+
dispatch({
|
|
15232
|
+
type: LOADING,
|
|
15233
|
+
payload: false
|
|
15234
|
+
});
|
|
15235
|
+
return dispatch({
|
|
15236
|
+
type: SHOW_ALERT,
|
|
15237
|
+
payload: {
|
|
15238
|
+
type: "error",
|
|
15239
|
+
content: getErrorMessages(result.error)
|
|
15240
|
+
}
|
|
15241
|
+
});
|
|
15242
|
+
} else {
|
|
15243
|
+
console.log("Tap API Call result", result);
|
|
15244
|
+
window.Pelcro.payment.authorize({
|
|
15245
|
+
auth_token: window.Pelcro.user.read().auth_token,
|
|
15246
|
+
site_id: window.Pelcro.siteid,
|
|
15247
|
+
amount: totalAmount,
|
|
15248
|
+
currency: (plan === null || plan === void 0 ? void 0 : plan.currency) || (invoice === null || invoice === void 0 ? void 0 : invoice.currency) || window.Pelcro.site.read().default_currency,
|
|
15249
|
+
tap_token: result.id,
|
|
15250
|
+
redirect_url: `${window.Pelcro.environment.domain}/webhook/tap/callback/3dsecure?auth_token=${window.Pelcro.user.read().auth_token}`
|
|
15251
|
+
}, (err, res) => {
|
|
15252
|
+
toggleAuthenticationPendingView(true, res);
|
|
15253
|
+
|
|
15254
|
+
const listenFor3DSecureCompletionMessage = () => {
|
|
15255
|
+
const retrieveSourceInfoFromIframe = event => {
|
|
15256
|
+
const {
|
|
15257
|
+
data
|
|
15258
|
+
} = event;
|
|
15259
|
+
|
|
15260
|
+
if (data.message === "3DS-authentication-complete") {
|
|
15261
|
+
const tapID = data.tapID;
|
|
15262
|
+
toggleAuthenticationPendingView(false);
|
|
15263
|
+
window.removeEventListener("message", retrieveSourceInfoFromIframe);
|
|
15264
|
+
handleTapPayment(tapID);
|
|
15265
|
+
}
|
|
15266
|
+
}; // listen to injected iframe for authentication complete message
|
|
15267
|
+
|
|
15268
|
+
|
|
15269
|
+
window.addEventListener("message", retrieveSourceInfoFromIframe);
|
|
15270
|
+
};
|
|
15271
|
+
|
|
15272
|
+
listenFor3DSecureCompletionMessage(); // if (err) {
|
|
15273
|
+
// onFailure(err);
|
|
15274
|
+
// return dispatch({
|
|
15275
|
+
// type: SHOW_ALERT,
|
|
15276
|
+
// payload: {
|
|
15277
|
+
// type: "error",
|
|
15278
|
+
// content: getErrorMessages(err)
|
|
15279
|
+
// }
|
|
15280
|
+
// });
|
|
15281
|
+
// }
|
|
15282
|
+
// dispatch({
|
|
15283
|
+
// type: SHOW_ALERT,
|
|
15284
|
+
// payload: {
|
|
15285
|
+
// type: "success",
|
|
15286
|
+
// content: t("messages.sourceUpdated")
|
|
15287
|
+
// }
|
|
15288
|
+
// });
|
|
15289
|
+
// onSuccess(res);
|
|
15290
|
+
});
|
|
15291
|
+
}
|
|
15292
|
+
});
|
|
15293
|
+
};
|
|
15294
|
+
|
|
15295
|
+
function handleTapPayment(paymentRequest) {
|
|
15296
|
+
// if (paymentRequest) {
|
|
15297
|
+
// const SUCCESS_STATUS = "870";
|
|
15298
|
+
// if (paymentRequest.response !== SUCCESS_STATUS) {
|
|
15299
|
+
// switch (paymentRequest.response) {
|
|
15300
|
+
// case "871":
|
|
15301
|
+
// return handlePaymentError({
|
|
15302
|
+
// error: new Error("Invalid account number")
|
|
15303
|
+
// });
|
|
15304
|
+
// default:
|
|
15305
|
+
// return handlePaymentError({
|
|
15306
|
+
// error: new Error(paymentRequest.message)
|
|
15307
|
+
// });
|
|
15308
|
+
// }
|
|
15309
|
+
// }
|
|
15310
|
+
// }
|
|
15311
|
+
const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
|
|
15312
|
+
|
|
15313
|
+
if (type === "createPayment") {
|
|
15314
|
+
handleTapSubscription();
|
|
15315
|
+
} else if (type === "orderCreate") {
|
|
15316
|
+
purchase(new TapGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
|
|
15317
|
+
} else if (type === "invoicePayment") {
|
|
15318
|
+
payInvoice(new TapGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, dispatch);
|
|
15319
|
+
} else if (type === "updatePaymentSource") {
|
|
15320
|
+
createNewTapCard();
|
|
15321
|
+
}
|
|
15322
|
+
|
|
15323
|
+
function createNewTapCard() {
|
|
15324
|
+
window.Pelcro.source.create({
|
|
15325
|
+
auth_token: window.Pelcro.user.read().auth_token,
|
|
15326
|
+
token: paymentRequest,
|
|
15327
|
+
gateway: "tap"
|
|
15328
|
+
}, (err, res) => {
|
|
15329
|
+
dispatch({
|
|
15330
|
+
type: DISABLE_SUBMIT,
|
|
15331
|
+
payload: false
|
|
15332
|
+
});
|
|
15333
|
+
dispatch({
|
|
15334
|
+
type: LOADING,
|
|
15335
|
+
payload: false
|
|
15336
|
+
});
|
|
15337
|
+
|
|
15338
|
+
if (err) {
|
|
15339
|
+
onFailure(err);
|
|
15340
|
+
return dispatch({
|
|
15341
|
+
type: SHOW_ALERT,
|
|
15342
|
+
payload: {
|
|
15343
|
+
type: "error",
|
|
15344
|
+
content: getErrorMessages(err)
|
|
15345
|
+
}
|
|
15346
|
+
});
|
|
15347
|
+
}
|
|
15348
|
+
|
|
15349
|
+
dispatch({
|
|
15350
|
+
type: SHOW_ALERT,
|
|
15351
|
+
payload: {
|
|
15352
|
+
type: "success",
|
|
15353
|
+
content: t("messages.sourceUpdated")
|
|
15354
|
+
}
|
|
15355
|
+
});
|
|
15356
|
+
onSuccess(res);
|
|
15357
|
+
});
|
|
15358
|
+
}
|
|
15359
|
+
|
|
15360
|
+
function handleTapSubscription() {
|
|
15361
|
+
const payment = new Payment(new TapGateway());
|
|
15362
|
+
const createSubscription = !isGift && !subscriptionIdToRenew;
|
|
15363
|
+
const renewSubscription = !isGift && subscriptionIdToRenew;
|
|
15364
|
+
const giftSubscriprition = isGift && !subscriptionIdToRenew;
|
|
15365
|
+
const renewGift = isRenewingGift;
|
|
15366
|
+
const {
|
|
15367
|
+
couponCode
|
|
15368
|
+
} = state;
|
|
15369
|
+
|
|
15370
|
+
if (renewGift) {
|
|
15371
|
+
return payment.execute({
|
|
15372
|
+
type: PAYMENT_TYPES.RENEW_GIFTED_SUBSCRIPTION,
|
|
15373
|
+
token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
|
|
15374
|
+
plan,
|
|
15375
|
+
couponCode,
|
|
15376
|
+
product,
|
|
15377
|
+
isExistingSource: isUsingExistingPaymentMethod,
|
|
15378
|
+
subscriptionIdToRenew,
|
|
15379
|
+
addressId: selectedAddressId
|
|
15380
|
+
}, (err, res) => {
|
|
15381
|
+
if (err) {
|
|
15382
|
+
return handlePaymentError(err);
|
|
15383
|
+
}
|
|
15384
|
+
|
|
15385
|
+
onSuccess(res);
|
|
15386
|
+
});
|
|
15387
|
+
} else if (giftSubscriprition) {
|
|
15388
|
+
return payment.execute({
|
|
15389
|
+
type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
|
|
15390
|
+
token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
|
|
15391
|
+
quantity: plan.quantity,
|
|
15392
|
+
plan,
|
|
15393
|
+
couponCode,
|
|
15394
|
+
product,
|
|
15395
|
+
isExistingSource: isUsingExistingPaymentMethod,
|
|
15396
|
+
giftRecipient,
|
|
15397
|
+
addressId: selectedAddressId
|
|
15398
|
+
}, (err, res) => {
|
|
15399
|
+
if (err) {
|
|
15400
|
+
return handlePaymentError(err);
|
|
15401
|
+
}
|
|
15402
|
+
|
|
15403
|
+
onSuccess(res);
|
|
15404
|
+
});
|
|
15405
|
+
} else if (renewSubscription) {
|
|
15406
|
+
return payment.execute({
|
|
15407
|
+
type: PAYMENT_TYPES.RENEW_SUBSCRIPTION,
|
|
15408
|
+
token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
|
|
15409
|
+
quantity: plan.quantity,
|
|
15410
|
+
plan,
|
|
15411
|
+
couponCode,
|
|
15412
|
+
product,
|
|
15413
|
+
isExistingSource: isUsingExistingPaymentMethod,
|
|
15414
|
+
subscriptionIdToRenew,
|
|
15415
|
+
addressId: selectedAddressId
|
|
15416
|
+
}, (err, res) => {
|
|
15417
|
+
if (err) {
|
|
15418
|
+
return handlePaymentError(err);
|
|
15419
|
+
}
|
|
15420
|
+
|
|
15421
|
+
onSuccess(res);
|
|
15422
|
+
});
|
|
15423
|
+
} else if (createSubscription) {
|
|
15424
|
+
return payment.execute({
|
|
15425
|
+
type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
|
|
15426
|
+
token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
|
|
15427
|
+
quantity: plan.quantity,
|
|
15428
|
+
plan,
|
|
15429
|
+
couponCode,
|
|
15430
|
+
product,
|
|
15431
|
+
isExistingSource: isUsingExistingPaymentMethod,
|
|
15432
|
+
addressId: selectedAddressId
|
|
15433
|
+
}, (err, res) => {
|
|
15434
|
+
if (err) {
|
|
15435
|
+
return handlePaymentError(err);
|
|
15436
|
+
}
|
|
15437
|
+
|
|
15438
|
+
onSuccess(res);
|
|
15439
|
+
});
|
|
15440
|
+
}
|
|
15441
|
+
}
|
|
15442
|
+
}
|
|
15443
|
+
/*====== End Tap integration ========*/
|
|
15444
|
+
|
|
14938
15445
|
|
|
14939
15446
|
const submitUsingVantiv = () => {
|
|
14940
15447
|
const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
|
|
@@ -15112,6 +15619,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15112
15619
|
}
|
|
15113
15620
|
|
|
15114
15621
|
const vantivInstanceRef = React__default['default'].useRef(null);
|
|
15622
|
+
const tapInstanceRef = React__default['default'].useRef(null);
|
|
15623
|
+
const tapInstanceCard = React__default['default'].useRef(null);
|
|
15115
15624
|
React.useEffect(() => {
|
|
15116
15625
|
const cardProcessor = getSiteCardProcessor();
|
|
15117
15626
|
|
|
@@ -15139,6 +15648,72 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15139
15648
|
}
|
|
15140
15649
|
});
|
|
15141
15650
|
}
|
|
15651
|
+
|
|
15652
|
+
if (cardProcessor === "tap" && !selectedPaymentMethodId) {
|
|
15653
|
+
var _window$Pelcro$site$r3;
|
|
15654
|
+
|
|
15655
|
+
const tapKey = Tapjsli((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.tap_gateway_settings.publishable_key);
|
|
15656
|
+
let elements = tapKey.elements({});
|
|
15657
|
+
let style = {
|
|
15658
|
+
base: {
|
|
15659
|
+
color: "#535353",
|
|
15660
|
+
lineHeight: "18px",
|
|
15661
|
+
fontFamily: "sans-serif",
|
|
15662
|
+
fontSmoothing: "antialiased",
|
|
15663
|
+
fontSize: "16px",
|
|
15664
|
+
"::placeholder": {
|
|
15665
|
+
color: "rgba(0, 0, 0, 0.26)",
|
|
15666
|
+
fontSize: "15px"
|
|
15667
|
+
}
|
|
15668
|
+
},
|
|
15669
|
+
invalid: {
|
|
15670
|
+
color: "red"
|
|
15671
|
+
}
|
|
15672
|
+
}; // input labels/placeholders
|
|
15673
|
+
|
|
15674
|
+
let labels = {
|
|
15675
|
+
cardNumber: "Card Number",
|
|
15676
|
+
expirationDate: "MM/YY",
|
|
15677
|
+
cvv: "CVV",
|
|
15678
|
+
cardHolder: "Card Holder Name"
|
|
15679
|
+
}; //payment options
|
|
15680
|
+
|
|
15681
|
+
let paymentOptions = {
|
|
15682
|
+
labels: labels,
|
|
15683
|
+
TextDirection: "ltr"
|
|
15684
|
+
}; //create element, pass style and payment options
|
|
15685
|
+
|
|
15686
|
+
let card = elements.create("card", {
|
|
15687
|
+
style: style
|
|
15688
|
+
}, paymentOptions); //mount element
|
|
15689
|
+
|
|
15690
|
+
card.mount("#tapPaymentIframe"); //card change event listener
|
|
15691
|
+
|
|
15692
|
+
card.addEventListener("change", function (event) {// if (event.error_interactive) {
|
|
15693
|
+
// onFailure(event.error_interactive);
|
|
15694
|
+
// return dispatch({
|
|
15695
|
+
// type: SHOW_ALERT,
|
|
15696
|
+
// payload: {
|
|
15697
|
+
// type: "error",
|
|
15698
|
+
// content: getErrorMessages(event.error_interactive)
|
|
15699
|
+
// }
|
|
15700
|
+
// });
|
|
15701
|
+
// } else {
|
|
15702
|
+
// dispatch({
|
|
15703
|
+
// type: SHOW_ALERT,
|
|
15704
|
+
// payload: { type: "error", content: "" }
|
|
15705
|
+
// });
|
|
15706
|
+
// }
|
|
15707
|
+
// let displayError = document.getElementById("error-handler");
|
|
15708
|
+
// if (event.error) {
|
|
15709
|
+
// displayError.textContent = event.error.message;
|
|
15710
|
+
// } else {
|
|
15711
|
+
// displayError.textContent = "";
|
|
15712
|
+
// }
|
|
15713
|
+
});
|
|
15714
|
+
tapInstanceRef.current = tapKey;
|
|
15715
|
+
tapInstanceCard.current = card;
|
|
15716
|
+
}
|
|
15142
15717
|
}, [selectedPaymentMethodId]);
|
|
15143
15718
|
|
|
15144
15719
|
const initPaymentRequest = (state, dispatch) => {
|
|
@@ -15211,9 +15786,9 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15211
15786
|
|
|
15212
15787
|
|
|
15213
15788
|
const updateTotalAmountWithTax = () => {
|
|
15214
|
-
var _window$Pelcro$site$
|
|
15789
|
+
var _window$Pelcro$site$r4;
|
|
15215
15790
|
|
|
15216
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
15791
|
+
const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
|
|
15217
15792
|
|
|
15218
15793
|
if (taxesEnabled && type === "createPayment") {
|
|
15219
15794
|
dispatch({
|
|
@@ -15806,7 +16381,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15806
16381
|
source,
|
|
15807
16382
|
error
|
|
15808
16383
|
}) => {
|
|
15809
|
-
var
|
|
16384
|
+
var _ref3, _ref4, _state$updatedPrice2, _source$card3;
|
|
15810
16385
|
|
|
15811
16386
|
if (error) {
|
|
15812
16387
|
return handlePaymentError(error);
|
|
@@ -15832,7 +16407,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15832
16407
|
}, 0);
|
|
15833
16408
|
};
|
|
15834
16409
|
|
|
15835
|
-
const totalAmount = (
|
|
16410
|
+
const totalAmount = (_ref3 = (_ref4 = (_state$updatedPrice2 = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice2 !== void 0 ? _state$updatedPrice2 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref4 !== void 0 ? _ref4 : invoice === null || invoice === void 0 ? void 0 : invoice.amount_remaining) !== null && _ref3 !== void 0 ? _ref3 : getOrderItemsTotal();
|
|
15836
16411
|
|
|
15837
16412
|
if ((source === null || source === void 0 ? void 0 : (_source$card3 = source.card) === null || _source$card3 === void 0 ? void 0 : _source$card3.three_d_secure) === "required" && totalAmount > 0) {
|
|
15838
16413
|
return resolveTaxCalculation().then(res => {
|
|
@@ -15863,13 +16438,13 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15863
16438
|
|
|
15864
16439
|
|
|
15865
16440
|
const resolveTaxCalculation = () => {
|
|
15866
|
-
var _window$Pelcro$site$
|
|
16441
|
+
var _window$Pelcro$site$r5;
|
|
15867
16442
|
|
|
15868
16443
|
if (type === "invoicePayment") {
|
|
15869
16444
|
return new Promise(resolve => resolve());
|
|
15870
16445
|
}
|
|
15871
16446
|
|
|
15872
|
-
const taxesEnabled = (_window$Pelcro$site$
|
|
16447
|
+
const taxesEnabled = (_window$Pelcro$site$r5 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r5 === void 0 ? void 0 : _window$Pelcro$site$r5.taxes_enabled;
|
|
15873
16448
|
return new Promise((resolve, reject) => {
|
|
15874
16449
|
// resolve early if taxes isn't enabled
|
|
15875
16450
|
if (!taxesEnabled) {
|
|
@@ -16021,10 +16596,12 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16021
16596
|
};
|
|
16022
16597
|
|
|
16023
16598
|
const injectCardAuthenticationIframe = source => {
|
|
16599
|
+
var _source$redirect;
|
|
16600
|
+
|
|
16024
16601
|
const cardAuthContainer = document.querySelector(".card-authentication-container");
|
|
16025
16602
|
const iframe = document.createElement("iframe");
|
|
16026
|
-
iframe.src = source.redirect.url;
|
|
16027
|
-
iframe.style = "position: absolute; width: 100%; height: 100%; left: 0; top:
|
|
16603
|
+
iframe.src = source !== null && source !== void 0 && (_source$redirect = source.redirect) !== null && _source$redirect !== void 0 && _source$redirect.url ? source.redirect.url : source.threeDSecure_url;
|
|
16604
|
+
iframe.style = "position: absolute; width: 100%; height: 100%; left: 0; top: 0; bottom: 0; z-index: 10;";
|
|
16028
16605
|
cardAuthContainer.appendChild(iframe);
|
|
16029
16606
|
};
|
|
16030
16607
|
|
|
@@ -16070,6 +16647,10 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16070
16647
|
return submitUsingVantiv();
|
|
16071
16648
|
}
|
|
16072
16649
|
|
|
16650
|
+
if (getSiteCardProcessor() === "tap") {
|
|
16651
|
+
return submitUsingTap();
|
|
16652
|
+
}
|
|
16653
|
+
|
|
16073
16654
|
if (selectedPaymentMethodId) {
|
|
16074
16655
|
// pay with selected method (source) if exists already
|
|
16075
16656
|
return handlePayment({
|
|
@@ -16283,6 +16864,12 @@ const CheckoutForm = () => {
|
|
|
16283
16864
|
});
|
|
16284
16865
|
}
|
|
16285
16866
|
|
|
16867
|
+
if (cardProcessor === "tap") {
|
|
16868
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16869
|
+
id: "tapPaymentIframe"
|
|
16870
|
+
});
|
|
16871
|
+
}
|
|
16872
|
+
|
|
16286
16873
|
if (cardProcessor === "stripe") {
|
|
16287
16874
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(PelcroCardNumber, {
|
|
16288
16875
|
autoFocus: true
|
|
@@ -16967,13 +17554,14 @@ function PaymentMethodView({
|
|
|
16967
17554
|
showCoupon,
|
|
16968
17555
|
showExternalPaymentMethods
|
|
16969
17556
|
}) {
|
|
16970
|
-
var _window$Pelcro$site$r;
|
|
17557
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
16971
17558
|
|
|
16972
17559
|
const {
|
|
16973
17560
|
t
|
|
16974
17561
|
} = useTranslation("checkoutForm");
|
|
16975
17562
|
const cardProcessor = getSiteCardProcessor();
|
|
16976
17563
|
const supportsVantiv = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings);
|
|
17564
|
+
Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.tap_gateway_settings);
|
|
16977
17565
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16978
17566
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
|
|
16979
17567
|
}, cardProcessor === "stripe" && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -24217,10 +24805,10 @@ var GroupContext = /*#__PURE__*/React.createContext(null);
|
|
|
24217
24805
|
GroupContext.displayName = 'GroupContext';
|
|
24218
24806
|
|
|
24219
24807
|
const getPaymentCardIcon = name => {
|
|
24220
|
-
var _icons$name;
|
|
24808
|
+
var _icons$name$toLowerCa;
|
|
24221
24809
|
|
|
24222
24810
|
const icons = {
|
|
24223
|
-
|
|
24811
|
+
visa: /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
24224
24812
|
className: "plc-w-12",
|
|
24225
24813
|
fill: "#ffffff",
|
|
24226
24814
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -24228,7 +24816,7 @@ const getPaymentCardIcon = name => {
|
|
|
24228
24816
|
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
24229
24817
|
d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 29.6875 19.40625 C 26.585938 19.40625 25 20.933594 25 22.875 C 25 26.386719 29.0625 25.914063 29.0625 27.71875 C 29.0625 28.023438 28.828125 28.75 27.125 28.75 C 25.417969 28.75 24.3125 28.09375 24.3125 28.09375 L 23.78125 30.46875 C 23.78125 30.46875 24.886719 31.09375 27 31.09375 C 29.113281 31.09375 32.03125 29.476563 32.03125 27.125 C 32.03125 24.296875 27.96875 24.074219 27.96875 22.8125 C 27.96875 22.167969 28.46875 21.6875 29.9375 21.6875 C 30.890625 21.6875 31.96875 22.40625 31.96875 22.40625 L 32.46875 19.96875 C 32.46875 19.96875 31.050781 19.40625 29.6875 19.40625 Z M 16.46875 19.625 L 13.78125 27.5625 C 13.78125 27.5625 13.597656 26.886719 13.53125 26.46875 C 11.996094 23.023438 9.5 21.75 9.5 21.75 L 11.875 30.75 L 15.125 30.75 L 19.625 19.625 Z M 20.78125 19.625 L 19.03125 30.75 L 22 30.75 L 23.78125 19.625 Z M 36.8125 19.625 L 31.96875 30.75 L 34.90625 30.75 L 35.5 29.15625 L 39.1875 29.15625 L 39.5 30.75 L 42.1875 30.75 L 39.90625 19.625 Z M 6.25 19.65625 C 6.25 19.65625 12.054688 21.453125 13.40625 25.8125 L 12.40625 20.75 C 12.40625 20.75 11.976563 19.65625 10.8125 19.65625 Z M 37.9375 22.84375 L 38.75 27.03125 L 36.3125 27.03125 Z"
|
|
24230
24818
|
})),
|
|
24231
|
-
|
|
24819
|
+
mastercard: /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
24232
24820
|
className: "plc-w-12",
|
|
24233
24821
|
fill: "#ffffff",
|
|
24234
24822
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -24236,7 +24824,7 @@ const getPaymentCardIcon = name => {
|
|
|
24236
24824
|
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
24237
24825
|
d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 17 13 C 10.382812 13 5 18.382812 5 25 C 5 31.617188 10.382812 37 17 37 C 20.078125 37 22.875 35.816406 25 33.90625 C 27.125 35.816406 29.925781 37 33 37 C 39.617188 37 45 31.617188 45 25 C 45 18.382812 39.617188 13 33 13 C 29.925781 13 27.125 14.183594 25 16.09375 C 22.875 14.183594 20.078125 13 17 13 Z M 33 15 C 38.535156 15 43 19.464844 43 25 C 43 30.535156 38.535156 35 33 35 C 30.449219 35 28.109375 34.066406 26.34375 32.5 C 27.996094 30.441406 29 27.839844 29 25 C 29 22.160156 27.996094 19.558594 26.34375 17.5 C 28.109375 15.933594 30.449219 15 33 15 Z M 33 15 "
|
|
24238
24826
|
})),
|
|
24239
|
-
"
|
|
24827
|
+
"american express": /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
24240
24828
|
className: "plc-w-12",
|
|
24241
24829
|
fill: "#ffffff",
|
|
24242
24830
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -24245,7 +24833,7 @@ const getPaymentCardIcon = name => {
|
|
|
24245
24833
|
d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 8.5625 19.90625 L 4.84375 28.40625 L 7.0625 28.40625 L 7.875 26.5 L 12.0625 26.5 L 12.875 28.40625 L 17.09375 28.40625 L 17.09375 22.09375 L 19.90625 28.40625 L 21.8125 28.40625 L 24.65625 22.1875 L 24.65625 28.40625 L 26.75 28.40625 L 26.75 19.90625 L 23.40625 19.90625 L 20.84375 25.625 L 18.28125 19.90625 L 15 19.90625 L 15 28.09375 L 11.34375 19.90625 Z M 29.5 19.90625 L 29.5 28.4375 L 37.5 28.4375 L 40 25.59375 L 42.46875 28.4375 L 45.125 28.4375 L 41.375 24.0625 L 45.125 19.90625 L 42.46875 19.90625 L 40.0625 22.5625 L 37.75 19.90625 Z M 9.90625 21.6875 L 11.21875 24.6875 L 8.65625 24.6875 Z M 31.5625 21.71875 L 36.65625 21.75 L 38.6875 24.0625 L 36.40625 26.625 L 31.5625 26.625 L 31.5625 24.9375 L 36.1875 24.9375 L 36.1875 23.3125 L 31.5625 23.3125 Z"
|
|
24246
24834
|
}))
|
|
24247
24835
|
};
|
|
24248
|
-
return (_icons$name = icons[name]) !== null && _icons$name !== void 0 ? _icons$name : /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
24836
|
+
return (_icons$name$toLowerCa = icons[name.toLowerCase()]) !== null && _icons$name$toLowerCa !== void 0 ? _icons$name$toLowerCa : /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
24249
24837
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24250
24838
|
className: "plc-w-12",
|
|
24251
24839
|
fill: "none",
|