@foxy.io/elements 1.29.0-beta.5 → 1.29.0
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/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +5 -5
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +554 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-payments-api.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-b53c58a6.js → shared-0ad0fb9f.js} +1 -1
- package/dist/cdn/{shared-bdb350d5.js → shared-0c7f9c0c.js} +1 -1
- package/dist/cdn/{shared-982ea9e1.js → shared-0f00d4d8.js} +1 -1
- package/dist/cdn/{shared-ca437731.js → shared-13203be0.js} +1 -1
- package/dist/cdn/{shared-cdf1e214.js → shared-1467a889.js} +1 -1
- package/dist/cdn/{shared-ffbcfbc5.js → shared-19768452.js} +1 -1
- package/dist/cdn/{shared-b938ba79.js → shared-1ecfa77b.js} +1 -1
- package/dist/cdn/{shared-f02d1d28.js → shared-226dd830.js} +1 -1
- package/dist/cdn/{shared-64aa8234.js → shared-22ba950a.js} +1 -1
- package/dist/cdn/{shared-91445b2b.js → shared-25502f01.js} +1 -1
- package/dist/cdn/{shared-f9e2e408.js → shared-2c1dff50.js} +1 -1
- package/dist/cdn/{shared-7e2a1984.js → shared-301a779e.js} +1 -1
- package/dist/cdn/{shared-494a9f3d.js → shared-32e92c3b.js} +1 -1
- package/dist/cdn/{shared-c1770155.js → shared-3483c729.js} +1 -1
- package/dist/cdn/{shared-fd17c575.js → shared-376784f0.js} +1 -1
- package/dist/cdn/{shared-c308b7e0.js → shared-38f0bda5.js} +1 -1
- package/dist/cdn/{shared-525fa58a.js → shared-40c6b1f6.js} +1 -1
- package/dist/cdn/{shared-735ba10d.js → shared-421a3ced.js} +1 -1
- package/dist/cdn/{shared-4f6e3162.js → shared-49ecea83.js} +1 -1
- package/dist/cdn/{shared-fcb58504.js → shared-4f183419.js} +1 -1
- package/dist/cdn/{shared-c0ce5ed0.js → shared-59b7fcc0.js} +1 -1
- package/dist/cdn/{shared-c92aa1b4.js → shared-5c4d786c.js} +1 -1
- package/dist/cdn/{shared-c2296e25.js → shared-63192750.js} +1 -1
- package/dist/cdn/{shared-337f11e4.js → shared-6a8a40cc.js} +1 -1
- package/dist/cdn/{shared-bbf4189c.js → shared-6be24929.js} +1 -1
- package/dist/cdn/{shared-aa9765b6.js → shared-70747a5c.js} +1 -1
- package/dist/cdn/{shared-66c5e679.js → shared-75331d5e.js} +1 -1
- package/dist/cdn/{shared-8e81d32d.js → shared-77e15843.js} +1 -1
- package/dist/cdn/{shared-ad932522.js → shared-77ef56aa.js} +1 -1
- package/dist/cdn/{shared-5ab6d05e.js → shared-8526ed32.js} +1 -1
- package/dist/cdn/{shared-aba112fe.js → shared-887e1795.js} +1 -1
- package/dist/cdn/{shared-843229d8.js → shared-8bb3eb45.js} +1 -1
- package/dist/cdn/{shared-d70c024a.js → shared-8cb35eb4.js} +1 -1
- package/dist/cdn/{shared-3cd5a0f0.js → shared-8f74f5fc.js} +1 -1
- package/dist/cdn/{shared-86012240.js → shared-8fce283a.js} +1 -1
- package/dist/cdn/shared-90706e10.js +1 -0
- package/dist/cdn/{shared-04327f82.js → shared-970d98db.js} +1 -1
- package/dist/cdn/{shared-f0cbc9b6.js → shared-98ddb87c.js} +1 -1
- package/dist/cdn/{shared-64faf409.js → shared-9a22d597.js} +1 -1
- package/dist/cdn/{shared-8c77078c.js → shared-9b895561.js} +1 -1
- package/dist/cdn/{shared-f4bf0a11.js → shared-a97c3129.js} +1 -1
- package/dist/cdn/{shared-52c30c2b.js → shared-ae00ce7c.js} +1 -1
- package/dist/cdn/{shared-0059cfec.js → shared-afd7214a.js} +4 -4
- package/dist/cdn/{shared-ba9431a5.js → shared-ba7354fa.js} +1 -1
- package/dist/cdn/{shared-e891437e.js → shared-c11df800.js} +1 -1
- package/dist/cdn/shared-c4124870.js +1 -0
- package/dist/cdn/{shared-31276bc2.js → shared-c5a0cdd7.js} +1 -1
- package/dist/cdn/{shared-c0a292f9.js → shared-c9845b4a.js} +1 -1
- package/dist/cdn/{shared-928400e3.js → shared-cc808e01.js} +1 -1
- package/dist/cdn/{shared-0ba38e56.js → shared-ce0465c6.js} +1 -1
- package/dist/cdn/shared-cfb33387.js +1 -0
- package/dist/cdn/{shared-437a77f7.js → shared-d0e4d7b1.js} +1 -1
- package/dist/cdn/{shared-1287115d.js → shared-d75f83f8.js} +1 -1
- package/dist/cdn/{shared-bd0a9424.js → shared-dbda59a0.js} +1 -1
- package/dist/cdn/{shared-01b35bfe.js → shared-df42c94f.js} +1 -1
- package/dist/cdn/{shared-ff73b5b8.js → shared-dfc47fd9.js} +1 -1
- package/dist/cdn/{shared-5b53b424.js → shared-e4870c47.js} +1 -1
- package/dist/cdn/{shared-72d815f5.js → shared-e7232c2b.js} +1 -1
- package/dist/cdn/{shared-383f55a5.js → shared-ea8f9a88.js} +2 -2
- package/dist/cdn/{shared-864584b7.js → shared-ecf479f2.js} +1 -1
- package/dist/cdn/{shared-45512693.js → shared-edae6816.js} +1 -1
- package/dist/cdn/{shared-a18c7822.js → shared-ee2cda29.js} +1 -1
- package/dist/cdn/{shared-d692fde9.js → shared-f21254a3.js} +1 -1
- package/dist/cdn/{shared-13c54ae2.js → shared-f4abc29a.js} +1 -1
- package/dist/cdn/{shared-f7a3f4c7.js → shared-f6573d25.js} +1 -1
- package/dist/cdn/{shared-5e463387.js → shared-fb1602a2.js} +1 -1
- package/dist/cdn/{shared-fbcfc48c.js → shared-fb1dd186.js} +1 -1
- package/dist/cdn/{shared-fe167efc.js → shared-fe4a2e3d.js} +1 -1
- package/dist/cdn/{shared-1c166d01.js → shared-ff7b2af6.js} +1 -1
- package/dist/cdn/translations/customer-portal/de.json +5 -75
- package/dist/cdn/translations/customer-portal/en.json +7 -77
- package/dist/cdn/translations/customer-portal/es.json +5 -74
- package/dist/cdn/translations/customer-portal/fr.json +5 -75
- package/dist/cdn/translations/customer-portal/nl.json +5 -75
- package/dist/cdn/translations/customer-portal/pl.json +5 -75
- package/dist/cdn/translations/customer-portal/sv.json +5 -75
- package/dist/cdn/translations/customer-portal/zh-hk.json +5 -75
- package/dist/cdn/translations/payments-api-fraud-protection-form/en.json +25 -11
- package/dist/cdn/translations/payments-api-payment-method-form/en.json +40 -21
- package/dist/cdn/translations/payments-api-payment-preset-form/en.json +154 -36
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js +1 -1
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js.map +1 -1
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js +1 -1
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/composers/available_fraud_protections.d.ts +2 -1
- package/dist/elements/public/PaymentsApi/api/composers/available_fraud_protections.js +90 -87
- package/dist/elements/public/PaymentsApi/api/composers/available_fraud_protections.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/composers/available_payment_methods.d.ts +2 -1
- package/dist/elements/public/PaymentsApi/api/composers/available_payment_methods.js +4 -1
- package/dist/elements/public/PaymentsApi/api/composers/available_payment_methods.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/handlers/available_fraud_protections.d.ts +1 -0
- package/dist/elements/public/PaymentsApi/api/handlers/available_fraud_protections.js +18 -1
- package/dist/elements/public/PaymentsApi/api/handlers/available_fraud_protections.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/handlers/available_payment_methods.js +16 -0
- package/dist/elements/public/PaymentsApi/api/handlers/available_payment_methods.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/index.js +7 -7
- package/dist/elements/public/PaymentsApi/api/index.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/types.d.ts +5 -0
- package/dist/elements/public/PaymentsApi/api/types.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.d.ts +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.js +66 -36
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.d.ts +3 -2
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.js +3 -2
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.d.ts +8 -3
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +171 -130
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.d.ts +2 -4
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.js +2 -4
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.d.ts +6 -7
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js +80 -87
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/index.d.ts +2 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/index.js +2 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/index.js.map +1 -1
- package/dist/mixins/themeable.js +0 -4
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-241b34e5.js +0 -1
- package/dist/cdn/shared-9a4ccbbb.js +0 -1
- package/dist/cdn/shared-c7055ee3.js +0 -1
- package/dist/cdn/shared-e9bf9d3d.js +0 -553
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalSwitchControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalSwitchControl/InternalSwitchControl.ts"],"names":[],"mappings":"AAA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O;gBACvC,qCAAqC,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO;gBACjE,gBAAgB,EAAE,IAAI,CAAC,QAAQ;gBAC/B,kDAAkD,EAAE,IAAI;aACzD,CAAC;2BACO,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;;;;4BAIjC,QAAQ,CAAC;gBACf,6CAA6C,EAAE,IAAI;gBACnD,eAAe,EAAE,OAAO;gBACxB,eAAe,EAAE,CAAC,OAAO;gBACzB,SAAS,EAAE,IAAI,CAAC,QAAQ;gBACxB,SAAS,EAAE,CAAC,IAAI,CAAC,QAAQ;aAC1B,CAAC;;;;;;;;gCAQU,IAAI,CAAC,QAAQ;gCACb,IAAI,CAAC,QAAQ;+BACd,OAAO;8BACR,CAAC,GAAU,EAAE,EAAE;gBACvB,MAAM,QAAQ,GAAG,GAAG,CAAC,aAAiC,CAAC;gBACvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;YACnE,CAAC;;;;aAIR;UACH,IAAI,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"InternalSwitchControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalSwitchControl/InternalSwitchControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAwB,GAAG,EAAkB,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,OAAO,qBAAsB,SAAQ,uBAAuB;IAAlE;;QASE,uBAAkB,GAAG,KAAK,CAAC;QAE3B,WAAM,GAAG,KAAK,CAAC;IAiFjB,CAAC;IA3FC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB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gBACzB,SAAS,EAAE,IAAI,CAAC,QAAQ;gBACxB,SAAS,EAAE,CAAC,IAAI,CAAC,QAAQ;aAC1B,CAAC;;;;;;;;gCAQU,IAAI,CAAC,QAAQ;gCACb,IAAI,CAAC,QAAQ;+BACd,OAAO;8BACR,CAAC,GAAU,EAAE,EAAE;gBACvB,MAAM,QAAQ,GAAG,GAAG,CAAC,aAAiC,CAAC;gBACvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;YACnE,CAAC;;;;aAIR;UACH,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,UAAU;YAC1C,CAAC,CAAC,IAAI,CAAA;;;;;kBAKE,GAAG,CAAA,yfAAyf;;;;;;;;;4DASld,IAAI,CAAC,UAAU;;aAE9D;YACH,CAAC,CAAC,EAAE;;KAET,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { html, PropertyDeclarations, svg, TemplateResult } from 'lit-element';\nimport { classMap } from '../../../utils/class-map';\n\nexport class InternalSwitchControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n helperTextAsToolip: { type: Boolean, attribute: 'helper-text-as-tooltip' },\n invert: { type: Boolean },\n };\n }\n\n helperTextAsToolip = false;\n\n invert = false;\n\n renderControl(): TemplateResult {\n const checked = this.invert ? !this._value : !!this._value;\n return html`\n <div class=\"flex items-start gap-s leading-xs text-m\">\n <div class=\"flex-1\">\n <label class=\"text-m text-body\" for=\"input\">${this.label}</label>\n ${this.helperTextAsToolip\n ? ''\n : html`<p class=\"text-xs text-secondary\">${this.helperText}</p>`}\n <p class=\"text-xs text-error\" ?hidden=${this.disabled || this.readonly}>\n ${this._errorMessage}\n </p>\n </div>\n\n ${this.readonly\n ? html`<p class=\"text-secondary\">${checked ? this.t('checked') : this.t('unchecked')}</p>`\n : html`\n <div style=\"height: calc(1em * var(--lumo-line-height-xs))\" class=\"flex items-center\">\n <div\n style=\"border-radius: var(--lumo-size-xl); width: calc((1em * var(--lumo-line-height-xs)) - 3px + var(--lumo-space-m))\"\n class=${classMap({\n 'cursor-pointer group transition-colors relative': true,\n 'flex flex-shrink-0 items-center': true,\n 'bg-success': !this.disabled && checked,\n 'bg-contrast-20 hover-bg-contrast-30': !this.disabled && !checked,\n 'bg-contrast-10': this.disabled,\n 'focus-within-ring-2 focus-within-ring-primary-50': true,\n })}\n @click=${() => (this._value = !this._value)}\n >\n <div\n style=\"margin: 1.5px; width: calc((1em * var(--lumo-line-height-xs)) - 6px); height: calc((1em * var(--lumo-line-height-xs)) - 6px)\"\n class=${classMap({\n 'transition-all transform block rounded-full': true,\n 'translate-x-m': checked,\n 'translate-x-0': !checked,\n 'bg-base': this.disabled,\n 'bg-tint': !this.disabled,\n })}\n ></div>\n\n <input\n class=\"opacity-0 absolute inset-0 focus-outline-none\"\n type=\"checkbox\"\n id=\"input\"\n switch\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?checked=${checked}\n @change=${(evt: Event) => {\n const checkbox = evt.currentTarget as HTMLInputElement;\n this._value = this.invert ? !checkbox.checked : checkbox.checked;\n }}\n />\n </div>\n </div>\n `}\n ${this.helperTextAsToolip && this.helperText\n ? html`\n <div\n class=\"transition-colors text-tertiary flex-shrink-0 cursor-pointer hover-text-body\"\n id=\"trigger\"\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" style=\"width: calc(1em * var(--lumo-line-height-xs)); height: calc(1em * var(--lumo-line-height-xs)); margin-right: -0.12em\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z\" /></svg>`}\n </div>\n <vcf-tooltip\n for=\"trigger\"\n style=\"--lumo-base-color: black; max-width: 30rem\"\n class=\"mt-s\"\n theme=\"light\"\n position=\"bottom\"\n >\n <span class=\"text-s\" style=\"color: white\">${this.helperText}</span>\n </vcf-tooltip>\n `\n : ''}\n </div>\n `;\n }\n}\n"]}
|
|
@@ -90,7 +90,7 @@ export class InternalTextControl extends InternalEditableControl {
|
|
|
90
90
|
</p>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
|
-
<div class="flex-1 flex items-center gap-xs">
|
|
93
|
+
<div class="flex-1 flex items-center gap-xs" style="min-width: 30%">
|
|
94
94
|
<input
|
|
95
95
|
placeholder=${this.placeholder}
|
|
96
96
|
class=${classMap({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalTextControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalTextControl/InternalTextControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,OAAO,mBAAoB,SAAQ,uBAAuB;IAAhE;;QA0BE,WAAM,GAAyC,IAAI,CAAC;QAEpD,WAAM,GAAkB,IAAI,CAAC;QAE7B,WAAM,GAAkB,IAAI,CAAC;QAErB,qBAAgB,GAAG,KAAK,CAAC;IAqGnC,CAAC;IApIC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,E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IAAI,CAAC,QAAQ;SAC9C,CAAC;;wBAEU,IAAI,CAAC,QAAQ;sBACf,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,MAAM;qBAC9B,GAAG,EAAE;YACZ,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/C,CAAC;;cAEC,GAAG,CAAA,sWAAsW;;;;KAIlX,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { TextFieldElement } from '@vaadin/vaadin-text-field';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { html, css, svg } from 'lit-element';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { classMap } from '../../../utils/class-map';\nimport { live } from 'lit-html/directives/live';\n\n/**\n * Internal control displaying a basic text box.\n *\n * @since 1.17.0\n * @element foxy-internal-text-control\n */\nexport class InternalTextControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n layout: {},\n prefix: {},\n suffix: {},\n __isErrorVisible: { attribute: false },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n input::-webkit-contacts-auto-fill-button {\n visibility: hidden;\n display: none !important;\n pointer-events: none;\n position: absolute;\n right: 0;\n }\n `,\n ];\n }\n\n layout: 'summary-item' | 'standalone' | null = null;\n\n prefix: string | null = null;\n\n suffix: string | null = null;\n\n private __isErrorVisible = false;\n\n reportValidity(): void {\n this.__isErrorVisible = true;\n super.reportValidity();\n }\n\n renderControl(): TemplateResult {\n if (this.layout === 'summary-item') return this.__renderSummaryItemLayout();\n\n return html`\n <vaadin-text-field\n error-message=${ifDefined(this._errorMessage)}\n helper-text=${this.helperText}\n placeholder=${this.placeholder}\n label=${this.label}\n class=\"w-full\"\n ?clear-button-visible=${!this.suffix}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .checkValidity=${this._checkValidity}\n .value=${this._value}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @input=${(evt: CustomEvent) => {\n const field = evt.currentTarget as TextFieldElement;\n this._value = field.value;\n }}\n >\n ${this.prefix ? html`<div slot=\"prefix\">${this.prefix}</div>` : ''}\n ${this.suffix ? html`<div class=\"pr-s font-medium\" slot=\"suffix\">${this.suffix}</div>` : ''}\n </vaadin-text-field>\n `;\n }\n\n protected get _value(): string {\n return (super._value as string | undefined) ?? '';\n }\n\n protected set _value(newValue: string) {\n super._value = newValue as unknown | undefined;\n }\n\n private __renderSummaryItemLayout() {\n return html`\n <div class=\"flex items-start gap-m leading-xs\">\n <div>\n <label class=\"text-m text-body\" for=\"input\">${this.label}</label>\n <p class=\"text-xs text-secondary\">${this.helperText}</p>\n <p\n class=\"text-xs text-error\"\n ?hidden=${!this.__isErrorVisible || this.disabled || this.readonly}\n >\n ${this._errorMessage}\n </p>\n </div>\n\n <div class=\"flex-1 flex items-center gap-xs\">\n <input\n placeholder=${this.placeholder}\n class=${classMap({\n 'w-full appearance-none text-right bg-transparent transition-colors': true,\n 'text-m rounded-s focus-outline-none': true,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n 'font-medium': !this.readonly,\n })}\n type=\"text\"\n id=\"input\"\n .value=${live(this._value)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @blur=${() => (this.__isErrorVisible = true)}\n @input=${(evt: Event) => {\n evt.stopPropagation();\n this._value = (evt.target as HTMLInputElement).value;\n }}\n />\n\n <button\n aria-label=${this.t('clear')}\n class=${classMap({\n 'rounded-full transition-colors': true,\n 'focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n 'cursor-pointer text-tertiary hover-text-body': !this.disabled,\n 'cursor-default text-disabled': this.disabled,\n })}\n style=\"width: 1em; height: 1em;\"\n ?disabled=${this.disabled}\n ?hidden=${this.readonly || !this._value}\n @click=${() => {\n this._value = '';\n this.dispatchEvent(new CustomEvent('clear'));\n }}\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" style=\"width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em\"><path d=\"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z\" /></svg>`}\n </button>\n </div>\n </div>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InternalTextControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalTextControl/InternalTextControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,OAAO,mBAAoB,SAAQ,uBAAuB;IAAhE;;QA0BE,WAAM,GAAyC,IAAI,CAAC;QAEpD,WAAM,GAAkB,IAAI,CAAC;QAE7B,WAAM,GAAkB,IAAI,CAAC;QAErB,qBAAgB,GAAG,KAAK,CAAC;IAqGnC,CAAC;IApIC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,gBAAgB,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;SACvC,CAAC;IACJ,CAAC;IAED,MAAM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AAM;qBAC9B,GAAG,EAAE;YACZ,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/C,CAAC;;cAEC,GAAG,CAAA,sWAAsW;;;;KAIlX,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { TextFieldElement } from '@vaadin/vaadin-text-field';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { html, css, svg } from 'lit-element';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { classMap } from '../../../utils/class-map';\nimport { live } from 'lit-html/directives/live';\n\n/**\n * Internal control displaying a basic text box.\n *\n * @since 1.17.0\n * @element foxy-internal-text-control\n */\nexport class InternalTextControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n layout: {},\n prefix: {},\n suffix: {},\n __isErrorVisible: { attribute: false },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n input::-webkit-contacts-auto-fill-button {\n visibility: hidden;\n display: none !important;\n pointer-events: none;\n position: absolute;\n right: 0;\n }\n `,\n ];\n }\n\n layout: 'summary-item' | 'standalone' | null = null;\n\n prefix: string | null = null;\n\n suffix: string | null = null;\n\n private __isErrorVisible = false;\n\n reportValidity(): void {\n this.__isErrorVisible = true;\n super.reportValidity();\n }\n\n renderControl(): TemplateResult {\n if (this.layout === 'summary-item') return this.__renderSummaryItemLayout();\n\n return html`\n <vaadin-text-field\n error-message=${ifDefined(this._errorMessage)}\n helper-text=${this.helperText}\n placeholder=${this.placeholder}\n label=${this.label}\n class=\"w-full\"\n ?clear-button-visible=${!this.suffix}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .checkValidity=${this._checkValidity}\n .value=${this._value}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @input=${(evt: CustomEvent) => {\n const field = evt.currentTarget as TextFieldElement;\n this._value = field.value;\n }}\n >\n ${this.prefix ? html`<div slot=\"prefix\">${this.prefix}</div>` : ''}\n ${this.suffix ? html`<div class=\"pr-s font-medium\" slot=\"suffix\">${this.suffix}</div>` : ''}\n </vaadin-text-field>\n `;\n }\n\n protected get _value(): string {\n return (super._value as string | undefined) ?? '';\n }\n\n protected set _value(newValue: string) {\n super._value = newValue as unknown | undefined;\n }\n\n private __renderSummaryItemLayout() {\n return html`\n <div class=\"flex items-start gap-m leading-xs\">\n <div>\n <label class=\"text-m text-body\" for=\"input\">${this.label}</label>\n <p class=\"text-xs text-secondary\">${this.helperText}</p>\n <p\n class=\"text-xs text-error\"\n ?hidden=${!this.__isErrorVisible || this.disabled || this.readonly}\n >\n ${this._errorMessage}\n </p>\n </div>\n\n <div class=\"flex-1 flex items-center gap-xs\" style=\"min-width: 30%\">\n <input\n placeholder=${this.placeholder}\n class=${classMap({\n 'w-full appearance-none text-right bg-transparent transition-colors': true,\n 'text-m rounded-s focus-outline-none': true,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n 'font-medium': !this.readonly,\n })}\n type=\"text\"\n id=\"input\"\n .value=${live(this._value)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @blur=${() => (this.__isErrorVisible = true)}\n @input=${(evt: Event) => {\n evt.stopPropagation();\n this._value = (evt.target as HTMLInputElement).value;\n }}\n />\n\n <button\n aria-label=${this.t('clear')}\n class=${classMap({\n 'rounded-full transition-colors': true,\n 'focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n 'cursor-pointer text-tertiary hover-text-body': !this.disabled,\n 'cursor-default text-disabled': this.disabled,\n })}\n style=\"width: 1em; height: 1em;\"\n ?disabled=${this.disabled}\n ?hidden=${this.readonly || !this._value}\n @click=${() => {\n this._value = '';\n this.dispatchEvent(new CustomEvent('clear'));\n }}\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" style=\"width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em\"><path d=\"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z\" /></svg>`}\n </button>\n </div>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -1,95 +1,98 @@
|
|
|
1
1
|
export function compose(params) {
|
|
2
|
-
const { paymentPresetId: presetId, base } = params;
|
|
2
|
+
const { paymentPresetId: presetId, fraudProtections: fps, base } = params;
|
|
3
3
|
const selfURL = new URL(`./payment_presets/${presetId}/available_fraud_protections`, base);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
},
|
|
4
|
+
const values = {
|
|
5
|
+
minfraud: {
|
|
6
|
+
name: 'MaxMind minFraud',
|
|
7
|
+
uses_rejection_threshold: true,
|
|
8
|
+
json: null,
|
|
9
|
+
},
|
|
10
|
+
google_recaptcha: {
|
|
11
|
+
name: 'Google reCAPTCHA',
|
|
12
|
+
uses_rejection_threshold: false,
|
|
13
|
+
json: {
|
|
14
|
+
blocks: [
|
|
15
|
+
{
|
|
16
|
+
id: '',
|
|
17
|
+
parent_id: '',
|
|
18
|
+
fields: [
|
|
19
|
+
{
|
|
20
|
+
id: 'config',
|
|
21
|
+
name: 'Configuration',
|
|
22
|
+
type: 'select',
|
|
23
|
+
description: 'Determines how reCAPTCHA is configured to operate.',
|
|
24
|
+
default_value: 'disabled',
|
|
25
|
+
options: [
|
|
26
|
+
{ name: 'Disabled', value: 'disabled' },
|
|
27
|
+
{ name: 'Always enabled', value: 'enabled_always' },
|
|
28
|
+
{ name: 'Enabled by errors', value: 'enabled_by_errors' },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'private_key',
|
|
33
|
+
name: 'Private Key',
|
|
34
|
+
type: 'text',
|
|
35
|
+
optional: true,
|
|
36
|
+
description: 'If using a custom subdomain, enter your Private Key here.',
|
|
37
|
+
default_value: '',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'site_key',
|
|
41
|
+
name: 'Site Key',
|
|
42
|
+
type: 'text',
|
|
43
|
+
optional: true,
|
|
44
|
+
description: 'If using a custom subdomain, enter your Site Key here.',
|
|
45
|
+
default_value: '',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
53
50
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
51
|
+
},
|
|
52
|
+
custom_precheckout_hook: {
|
|
53
|
+
name: 'Pre-Checkout Webhook',
|
|
54
|
+
uses_rejection_threshold: false,
|
|
55
|
+
json: {
|
|
56
|
+
blocks: [
|
|
57
|
+
{
|
|
58
|
+
id: '',
|
|
59
|
+
parent_id: '',
|
|
60
|
+
fields: [
|
|
61
|
+
{
|
|
62
|
+
id: 'enabled',
|
|
63
|
+
name: 'Enabled',
|
|
64
|
+
type: 'checkbox',
|
|
65
|
+
default_value: false,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'url',
|
|
69
|
+
name: 'URL',
|
|
70
|
+
type: 'text',
|
|
71
|
+
description: 'Url of your Pre-Checkout Hook',
|
|
72
|
+
default_value: '',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'failure_handling',
|
|
76
|
+
name: 'Failure handling',
|
|
77
|
+
type: 'select',
|
|
78
|
+
description: 'Determines what happens to the checkout submission if your webhook fails to respond correctly.',
|
|
79
|
+
default_value: '',
|
|
80
|
+
options: [
|
|
81
|
+
{ name: 'Reject', value: 'reject' },
|
|
82
|
+
{ name: 'Approve', value: 'approve' },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
],
|
|
91
88
|
},
|
|
92
89
|
},
|
|
93
90
|
};
|
|
91
|
+
for (const type in values) {
|
|
92
|
+
const fp = fps === null || fps === void 0 ? void 0 : fps.find(fp => fp.type === type);
|
|
93
|
+
if (fp)
|
|
94
|
+
values[type].conflict = { type: fp.type, name: fp.description };
|
|
95
|
+
}
|
|
96
|
+
return { _links: { self: { href: selfURL.toString() } }, values };
|
|
94
97
|
}
|
|
95
98
|
//# sourceMappingURL=available_fraud_protections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"available_fraud_protections.js","sourceRoot":"","sources":["../../../../../../src/elements/public/PaymentsApi/api/composers/available_fraud_protections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"available_fraud_protections.js","sourceRoot":"","sources":["../../../../../../src/elements/public/PaymentsApi/api/composers/available_fraud_protections.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAC1E,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,qBAAqB,QAAQ,8BAA8B,EAAE,IAAI,CAAC,CAAC;IAE3F,MAAM,MAAM,GAAwC;QAClD,QAAQ,EAAE;YACR,IAAI,EAAE,kBAAkB;YACxB,wBAAwB,EAAE,IAAI;YAC9B,IAAI,EAAE,IAAI;SACX;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,kBAAkB;YACxB,wBAAwB,EAAE,KAAK;YAC/B,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN;wBACE,EAAE,EAAE,EAAE;wBACN,SAAS,EAAE,EAAE;wBACb,MAAM,EAAE;4BACN;gCACE,EAAE,EAAE,QAAQ;gCACZ,IAAI,EAAE,eAAe;gCACrB,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,oDAAoD;gCACjE,aAAa,EAAE,UAAU;gCACzB,OAAO,EAAE;oCACP,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;oCACvC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;oCACnD,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE;iCAC1D;6BACF;4BACD;gCACE,EAAE,EAAE,aAAa;gCACjB,IAAI,EAAE,aA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AAK,IAAI,CAAC,CAAC;QAC7C,IAAI,EAAE;YAAE,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC;KACzE;IAED,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;AACpE,CAAC","sourcesContent":["import type { AvailableFraudProtections, FraudProtection } from '../types';\n\nexport type Params = {\n fraudProtections?: FraudProtection[];\n paymentPresetId: string;\n base: string;\n};\n\nexport function compose(params: Params): AvailableFraudProtections {\n const { paymentPresetId: presetId, fraudProtections: fps, base } = params;\n const selfURL = new URL(`./payment_presets/${presetId}/available_fraud_protections`, base);\n\n const values: AvailableFraudProtections['values'] = {\n minfraud: {\n name: 'MaxMind minFraud',\n uses_rejection_threshold: true,\n json: null,\n },\n google_recaptcha: {\n name: 'Google reCAPTCHA',\n uses_rejection_threshold: false,\n json: {\n blocks: [\n {\n id: '',\n parent_id: '',\n fields: [\n {\n id: 'config',\n name: 'Configuration',\n type: 'select',\n description: 'Determines how reCAPTCHA is configured to operate.',\n default_value: 'disabled',\n options: [\n { name: 'Disabled', value: 'disabled' },\n { name: 'Always enabled', value: 'enabled_always' },\n { name: 'Enabled by errors', value: 'enabled_by_errors' },\n ],\n },\n {\n id: 'private_key',\n name: 'Private Key',\n type: 'text',\n optional: true,\n description: 'If using a custom subdomain, enter your Private Key here.',\n default_value: '',\n },\n {\n id: 'site_key',\n name: 'Site Key',\n type: 'text',\n optional: true,\n description: 'If using a custom subdomain, enter your Site Key here.',\n default_value: '',\n },\n ],\n },\n ],\n },\n },\n custom_precheckout_hook: {\n name: 'Pre-Checkout Webhook',\n uses_rejection_threshold: false,\n json: {\n blocks: [\n {\n id: '',\n parent_id: '',\n fields: [\n {\n id: 'enabled',\n name: 'Enabled',\n type: 'checkbox',\n default_value: false,\n },\n {\n id: 'url',\n name: 'URL',\n type: 'text',\n description: 'Url of your Pre-Checkout Hook',\n default_value: '',\n },\n {\n id: 'failure_handling',\n name: 'Failure handling',\n type: 'select',\n description:\n 'Determines what happens to the checkout submission if your webhook fails to respond correctly.',\n default_value: '',\n options: [\n { name: 'Reject', value: 'reject' },\n { name: 'Approve', value: 'approve' },\n ],\n },\n ],\n },\n ],\n },\n },\n };\n\n for (const type in values) {\n const fp = fps?.find(fp => fp.type === type);\n if (fp) values[type].conflict = { type: fp.type, name: fp.description };\n }\n\n return { _links: { self: { href: selfURL.toString() } }, values };\n}\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { AvailablePaymentMethods } from '../types';
|
|
1
|
+
import type { AvailablePaymentMethods, PaymentMethod } from '../types';
|
|
2
2
|
import type { Resource } from '@foxy.io/sdk/core';
|
|
3
3
|
import type { Rels } from '@foxy.io/sdk/backend';
|
|
4
4
|
export declare type Params = {
|
|
5
5
|
hostedPaymentGatewaysHelper: Resource<Rels.HostedPaymentGatewaysHelper>;
|
|
6
6
|
paymentGatewaysHelper: Resource<Rels.PaymentGatewaysHelper>;
|
|
7
7
|
paymentPresetId: string;
|
|
8
|
+
paymentMethods: PaymentMethod[];
|
|
8
9
|
paymentGateway?: Resource<Rels.PaymentGateway>;
|
|
9
10
|
base: string;
|
|
10
11
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export function compose(params) {
|
|
2
|
-
const { hostedPaymentGatewaysHelper: hostedGwsHelper, paymentGatewaysHelper: gwsHelper, paymentPresetId: presetId, paymentGateway: gw, base, } = params;
|
|
2
|
+
const { hostedPaymentGatewaysHelper: hostedGwsHelper, paymentGatewaysHelper: gwsHelper, paymentPresetId: presetId, paymentMethods: pmds, paymentGateway: gw, base, } = params;
|
|
3
3
|
const selfURL = new URL(`./payment_presets/${presetId}/available_payment_methods`, base);
|
|
4
4
|
const values = {};
|
|
5
5
|
Object.entries(hostedGwsHelper.values).forEach(([type, helper]) => {
|
|
6
6
|
values[type] = helper;
|
|
7
|
+
const pmd = pmds.find(pm => pm.type === type);
|
|
8
|
+
if (pmd)
|
|
9
|
+
values[type].conflict = { type: pmd.type, name: pmd.description };
|
|
7
10
|
});
|
|
8
11
|
Object.entries(gwsHelper.values).forEach(([type, helper]) => {
|
|
9
12
|
values[type] = helper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"available_payment_methods.js","sourceRoot":"","sources":["../../../../../../src/elements/public/PaymentsApi/api/composers/available_payment_methods.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"available_payment_methods.js","sourceRoot":"","sources":["../../../../../../src/elements/public/PaymentsApi/api/composers/available_payment_methods.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,MAAM,EACJ,2BAA2B,EAAE,eAAe,EAC5C,qBAAqB,EAAE,SAAS,EAChC,eAAe,EAAE,QAAQ,EACzB,cAAc,EAAE,IAAI,EACpB,cAAc,EAAE,EAAE,EAClB,IAAI,GACL,GAAG,MAAM,CAAC;IAEX,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,qBAAqB,QAAQ,4BAA4B,EAAE,IAAI,CAAC,CAAC;IACzF,MAAM,MAAM,GAAsC,EAAE,CAAC;IAErD,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE;QAChE,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAC9C,IAAI,GAAG;YAAE,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC;IAC7E,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE;QAC1D,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;QACtB,IAAI,EAAE;YAAE,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;AACpE,CAAC","sourcesContent":["import type { AvailablePaymentMethods, PaymentMethod } from '../types';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\nexport type Params = {\n hostedPaymentGatewaysHelper: Resource<Rels.HostedPaymentGatewaysHelper>;\n paymentGatewaysHelper: Resource<Rels.PaymentGatewaysHelper>;\n paymentPresetId: string;\n paymentMethods: PaymentMethod[];\n paymentGateway?: Resource<Rels.PaymentGateway>;\n base: string;\n};\n\nexport function compose(params: Params): AvailablePaymentMethods {\n const {\n hostedPaymentGatewaysHelper: hostedGwsHelper,\n paymentGatewaysHelper: gwsHelper,\n paymentPresetId: presetId,\n paymentMethods: pmds,\n paymentGateway: gw,\n base,\n } = params;\n\n const selfURL = new URL(`./payment_presets/${presetId}/available_payment_methods`, base);\n const values: AvailablePaymentMethods['values'] = {};\n\n Object.entries(hostedGwsHelper.values).forEach(([type, helper]) => {\n values[type] = helper;\n const pmd = pmds.find(pm => pm.type === type);\n if (pmd) values[type].conflict = { type: pmd.type, name: pmd.description };\n });\n\n Object.entries(gwsHelper.values).forEach(([type, helper]) => {\n values[type] = helper;\n if (gw) values[type].conflict = { type: gw.type, name: gw.description };\n });\n\n return { _links: { self: { href: selfURL.toString() } }, values };\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fetchJson } from "../utils.js";
|
|
1
2
|
import { compose } from "../composers/available_fraud_protections.js";
|
|
2
3
|
/**
|
|
3
4
|
* Request handler.
|
|
@@ -11,14 +12,30 @@ export async function handle(params) {
|
|
|
11
12
|
let status = undefined;
|
|
12
13
|
let body;
|
|
13
14
|
try {
|
|
14
|
-
const { request } = params;
|
|
15
|
+
const { request, fetch } = params;
|
|
15
16
|
if (request.method !== 'GET') {
|
|
16
17
|
status = 405;
|
|
17
18
|
throw new Error('Method not allowed. Allowed methods: GET.');
|
|
18
19
|
}
|
|
19
20
|
const pathRegex = /\/payment_presets\/(?<presetId>.+)\/available_fraud_protections/;
|
|
20
21
|
const presetId = pathRegex.exec(new URL(request.url).pathname).groups.presetId;
|
|
22
|
+
const whenFraudProtectionLoaded = (async () => {
|
|
23
|
+
const result = [];
|
|
24
|
+
// eslint-disable-next-line no-constant-condition
|
|
25
|
+
while (true) {
|
|
26
|
+
const base = new URL(request.url).origin;
|
|
27
|
+
const url = new URL(`${base}/payment_presets/${presetId}/fraud_protections`);
|
|
28
|
+
url.searchParams.set('offset', result.length.toString());
|
|
29
|
+
url.searchParams.set('limit', '200');
|
|
30
|
+
const json = await fetchJson(fetch(url.toString()));
|
|
31
|
+
result.push(...json._embedded['fx:fraud_protections']);
|
|
32
|
+
if (json._embedded['fx:fraud_protections'].length < 200)
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
})();
|
|
21
37
|
const output = compose({
|
|
38
|
+
fraudProtections: await whenFraudProtectionLoaded,
|
|
22
39
|
paymentPresetId: presetId,
|
|
23
40
|
base: new URL(request.url).origin,
|
|
24
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"available_fraud_protections.js","sourceRoot":"","sources":["../../../../../../src/elements/public/PaymentsApi/api/handlers/available_fraud_protections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"available_fraud_protections.js","sourceRoot":"","sources":["../../../../../../src/elements/public/PaymentsApi/api/handlers/available_fraud_protections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,oBAAiB;AACrC,OAAO,EAAE,OAAO,EAAE,oDAAiD;AAOnE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,MAAc;IACzC,IAAI,MAAM,GAAuB,SAAS,CAAC;IAC3C,IAAI,IAAY,CAAC;IAEjB,IAAI;QACF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QAElC,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,EAAE;YAC5B,MAAM,GAAG,GAAG,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;SAC9D;QAED,MAAM,SAAS,GAAG,iEAAiE,CAAC;QACpF,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAE,CAAC,MAAO,CAAC,QAAQ,CAAC;QAEjF,MAAM,yBAAyB,GAAG,CAAC,KAAK,IAAI,EAAE;YAC5C,MAAM,MAAM,GAAsB,EAAE,CAAC;YAErC,iDAAiD;YACjD,OAAO,IAAI,EAAE;gBACX,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;gBACzC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,oBAAoB,QAAQ,oBAAoB,CAAC,CAAC;gBAC7E,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACzD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;gBAErC,MAAM,IAAI,GAAG,MAAM,SAAS,CAAmB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACtE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,CAAC;gBAEvD,IAAI,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,MAAM,GAAG,GAAG;oBAAE,MAAM;aAChE;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,EAAE,CAAC;QAEL,MAAM,MAAM,GAAG,OAAO,CAAC;YACrB,gBAAgB,EAAE,MAAM,yBAAyB;YACjD,eAAe,EAAE,QAAQ;YACzB,IAAI,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM;SAClC,CAAC,CAAC;QAEH,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,GAAG,GAAG,CAAC;KACd;IAAC,OAAO,GAAG,EAAE;QACZ,IAAI,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACxD,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,GAAG,CAAC;KACxB;IAED,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import type { FraudProtection, FraudProtections } from '../types';\n\nimport { fetchJson } from '../utils';\nimport { compose } from '../composers/available_fraud_protections';\n\nexport type Params = {\n request: Request;\n fetch: Window['fetch'];\n};\n\n/**\n * Request handler.\n *\n * Endpoint: `/payment_presets/:presetId/available_fraud_protections`;\n * Methods: GET;\n * Curie: `fx:available_fraud_protections`;\n * Type: property helper.\n */\nexport async function handle(params: Params): Promise<Response> {\n let status: number | undefined = undefined;\n let body: string;\n\n try {\n const { request, fetch } = params;\n\n if (request.method !== 'GET') {\n status = 405;\n throw new Error('Method not allowed. Allowed methods: GET.');\n }\n\n const pathRegex = /\\/payment_presets\\/(?<presetId>.+)\\/available_fraud_protections/;\n const presetId = pathRegex.exec(new URL(request.url).pathname)!.groups!.presetId;\n\n const whenFraudProtectionLoaded = (async () => {\n const result: FraudProtection[] = [];\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const base = new URL(request.url).origin;\n const url = new URL(`${base}/payment_presets/${presetId}/fraud_protections`);\n url.searchParams.set('offset', result.length.toString());\n url.searchParams.set('limit', '200');\n\n const json = await fetchJson<FraudProtections>(fetch(url.toString()));\n result.push(...json._embedded['fx:fraud_protections']);\n\n if (json._embedded['fx:fraud_protections'].length < 200) break;\n }\n\n return result;\n })();\n\n const output = compose({\n fraudProtections: await whenFraudProtectionLoaded,\n paymentPresetId: presetId,\n base: new URL(request.url).origin,\n });\n\n body = JSON.stringify(output);\n status = 200;\n } catch (err) {\n body = err instanceof Error ? err.message : String(err);\n status = status ?? 500;\n }\n\n return new Response(body, { status });\n}\n"]}
|
|
@@ -23,6 +23,21 @@ export async function handle(params) {
|
|
|
23
23
|
const whenHostedGwsHelperLoaded = fetchJson(fetch(hostedGwsHelperUrl));
|
|
24
24
|
const whenGwsHelperLoaded = fetchJson(fetch(gwsHelperUrl));
|
|
25
25
|
const set = await fetchJson(fetch(getSetUrl(presetId)));
|
|
26
|
+
const whenPaymentMethodsLoaded = (async () => {
|
|
27
|
+
const result = [];
|
|
28
|
+
// eslint-disable-next-line no-constant-condition
|
|
29
|
+
while (true) {
|
|
30
|
+
const base = new URL(request.url).origin;
|
|
31
|
+
const url = new URL(`${base}/payment_presets/${presetId}/payment_methods`);
|
|
32
|
+
url.searchParams.set('offset', result.length.toString());
|
|
33
|
+
url.searchParams.set('limit', '200');
|
|
34
|
+
const json = await fetchJson(fetch(url.toString()));
|
|
35
|
+
result.push(...json._embedded['fx:payment_methods']);
|
|
36
|
+
if (json._embedded['fx:payment_methods'].length < 200)
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
})();
|
|
26
41
|
const gwUrl = (_a = set._links['fx:payment_gateway']) === null || _a === void 0 ? void 0 : _a.href;
|
|
27
42
|
const gw = gwUrl ? await fetchJson(fetch(gwUrl)) : undefined;
|
|
28
43
|
const output = compose({
|
|
@@ -30,6 +45,7 @@ export async function handle(params) {
|
|
|
30
45
|
paymentGatewaysHelper: await whenGwsHelperLoaded,
|
|
31
46
|
paymentPresetId: presetId,
|
|
32
47
|
paymentGateway: gw,
|
|
48
|
+
paymentMethods: await whenPaymentMethodsLoaded,
|
|
33
49
|
base: new URL(request.url).origin,
|
|
34
50
|
});
|
|
35
51
|
body = JSON.stringify(output);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"available_payment_methods.js","sourceRoot":"","sources":["../../../../../../src/elements/public/PaymentsApi/api/handlers/available_payment_methods.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"available_payment_methods.js","sourceRoot":"","sources":["../../../../../../src/elements/public/PaymentsApi/api/handlers/available_payment_methods.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,oBAAiB;AACrC,OAAO,EAAE,OAAO,EAAE,kDAA+C;AAUjE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,MAAc;;IACzC,IAAI,MAAM,GAAuB,SAAS,CAAC;IAC3C,IAAI,IAAY,CAAC;IAEjB,IAAI;QACF,MAAM,EACJ,8BAA8B,EAAE,kBAAkB,EAClD,wBAAwB,EAAE,YAAY,EACtC,sBAAsB,EAAE,SAAS,EACjC,OAAO,EACP,KAAK,GACN,GAAG,MAAM,CAAC;QAEX,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,EAAE;YAC5B,MAAM,GAAG,GAAG,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;SAC9D;Q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C,CAAC,EAAE,CAAC;QAEL,MAAM,KAAK,GAAG,MAAA,GAAG,CAAC,MAAM,CAAC,oBAAoB,CAAC,0CAAE,IAA0B,CAAC;QAC3E,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,SAAS,CAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEjE,MAAM,MAAM,GAAG,OAAO,CAAC;YACrB,2BAA2B,EAAE,MAAM,yBAAyB;YAC5D,qBAAqB,EAAE,MAAM,mBAAmB;YAChD,eAAe,EAAE,QAAQ;YACzB,cAAc,EAAE,EAAE;YAClB,cAAc,EAAE,MAAM,wBAAwB;YAC9C,IAAI,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM;SAClC,CAAC,CAAC;QAEH,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,GAAG,GAAG,CAAC;KACd;IAAC,OAAO,GAAG,EAAE;QACZ,IAAI,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACxD,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,GAAG,CAAC;KACxB;IAED,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import type { PaymentMethod, PaymentMethods } from '../types';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\nimport { fetchJson } from '../utils';\nimport { compose } from '../composers/available_payment_methods';\n\nexport type Params = {\n hostedPaymentGatewaysHelperUrl: string;\n paymentGatewaysHelperUrl: string;\n getPaymentMethodSetUrl: (id: string) => string;\n request: Request;\n fetch: Window['fetch'];\n};\n\n/**\n * Request handler.\n *\n * Endpoint: `/payment_presets/:presetId/available_payment_methods`;\n * Methods: GET;\n * Curie: `fx:available_payment_methods`;\n * Type: property helper.\n */\nexport async function handle(params: Params): Promise<Response> {\n let status: number | undefined = undefined;\n let body: string;\n\n try {\n const {\n hostedPaymentGatewaysHelperUrl: hostedGwsHelperUrl,\n paymentGatewaysHelperUrl: gwsHelperUrl,\n getPaymentMethodSetUrl: getSetUrl,\n request,\n fetch,\n } = params;\n\n if (request.method !== 'GET') {\n status = 405;\n throw new Error('Method not allowed. Allowed methods: GET.');\n }\n\n const pathRegex = /\\/payment_presets\\/(?<presetId>.+)\\/available_payment_methods/;\n const presetId = pathRegex.exec(new URL(request.url).pathname)!.groups!.presetId;\n\n type HostedGwsHelper = Resource<Rels.HostedPaymentGatewaysHelper>;\n type GwsHelper = Resource<Rels.PaymentGatewaysHelper>;\n type Set = Resource<Rels.PaymentMethodSet>;\n type Gw = Resource<Rels.PaymentGateway>;\n\n const whenHostedGwsHelperLoaded = fetchJson<HostedGwsHelper>(fetch(hostedGwsHelperUrl));\n const whenGwsHelperLoaded = fetchJson<GwsHelper>(fetch(gwsHelperUrl));\n const set = await fetchJson<Set>(fetch(getSetUrl(presetId)));\n\n const whenPaymentMethodsLoaded = (async () => {\n const result: PaymentMethod[] = [];\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const base = new URL(request.url).origin;\n const url = new URL(`${base}/payment_presets/${presetId}/payment_methods`);\n url.searchParams.set('offset', result.length.toString());\n url.searchParams.set('limit', '200');\n\n const json = await fetchJson<PaymentMethods>(fetch(url.toString()));\n result.push(...json._embedded['fx:payment_methods']);\n\n if (json._embedded['fx:payment_methods'].length < 200) break;\n }\n\n return result;\n })();\n\n const gwUrl = set._links['fx:payment_gateway']?.href as string | undefined;\n const gw = gwUrl ? await fetchJson<Gw>(fetch(gwUrl)) : undefined;\n\n const output = compose({\n hostedPaymentGatewaysHelper: await whenHostedGwsHelperLoaded,\n paymentGatewaysHelper: await whenGwsHelperLoaded,\n paymentPresetId: presetId,\n paymentGateway: gw,\n paymentMethods: await whenPaymentMethodsLoaded,\n base: new URL(request.url).origin,\n });\n\n body = JSON.stringify(output);\n status = 200;\n } catch (err) {\n body = err instanceof Error ? err.message : String(err);\n status = status ?? 500;\n }\n\n return new Response(body, { status });\n}\n"]}
|
|
@@ -8,22 +8,22 @@ import { handle as handlePaymentPreset, } from "./handlers/payment_preset.js";
|
|
|
8
8
|
import { handle as handlePaymentMethod, } from "./handlers/payment_method.js";
|
|
9
9
|
export function getHandler(params) {
|
|
10
10
|
const paths = [
|
|
11
|
-
[/\/payment_presets\/(?<presetId
|
|
11
|
+
[/\/payment_presets\/(?<presetId>.+?)\/payment_methods\/(?<methodId>.+?)/, handlePaymentMethod],
|
|
12
12
|
[
|
|
13
|
-
/\/payment_presets\/(?<presetId
|
|
13
|
+
/\/payment_presets\/(?<presetId>.+?)\/available_fraud_protections/,
|
|
14
14
|
handleAvailableFraudProtections,
|
|
15
15
|
],
|
|
16
16
|
[
|
|
17
|
-
/\/payment_presets\/(?<presetId
|
|
17
|
+
/\/payment_presets\/(?<presetId>.+?)\/available_payment_methods/,
|
|
18
18
|
handleAvailablePaymentMethods,
|
|
19
19
|
],
|
|
20
20
|
[
|
|
21
|
-
/\/payment_presets\/(?<presetId
|
|
21
|
+
/\/payment_presets\/(?<presetId>.+?)\/fraud_protections\/(?<protectionId>.+?)/,
|
|
22
22
|
handleFraudProtection,
|
|
23
23
|
],
|
|
24
|
-
[/\/payment_presets\/(?<presetId
|
|
25
|
-
[/\/payment_presets\/(?<presetId
|
|
26
|
-
[/\/payment_presets\/(?<presetId
|
|
24
|
+
[/\/payment_presets\/(?<presetId>.+?)\/fraud_protections/, handleFraudProtections],
|
|
25
|
+
[/\/payment_presets\/(?<presetId>.+?)\/payment_methods/, handlePaymentMethods],
|
|
26
|
+
[/\/payment_presets\/(?<presetId>.+?)/, handlePaymentPreset],
|
|
27
27
|
[/\/payment_presets/, handlePaymentPresets],
|
|
28
28
|
];
|
|
29
29
|
for (const [pathRegex, handler] of paths) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/elements/public/PaymentsApi/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,6BAA6B,GAExC,gDAA6C;AAE9C,OAAO,EACL,MAAM,IAAI,+BAA+B,GAE1C,kDAA+C;AAEhD,OAAO,EACL,MAAM,IAAI,sBAAsB,GAEjC,wCAAqC;AAEtC,OAAO,EACL,MAAM,IAAI,qBAAqB,GAEhC,uCAAoC;AAErC,OAAO,EACL,MAAM,IAAI,oBAAoB,GAE/B,sCAAmC;AAEpC,OAAO,EACL,MAAM,IAAI,oBAAoB,GAE/B,sCAAmC;AAEpC,OAAO,EACL,MAAM,IAAI,mBAAmB,GAE9B,qCAAkC;AAEnC,OAAO,EACL,MAAM,IAAI,mBAAmB,GAE9B,qCAAkC;AAanC,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,MAAM,KAAK,GAAG;QACZ,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/elements/public/PaymentsApi/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,6BAA6B,GAExC,gDAA6C;AAE9C,OAAO,EACL,MAAM,IAAI,+BAA+B,GAE1C,kDAA+C;AAEhD,OAAO,EACL,MAAM,IAAI,sBAAsB,GAEjC,wCAAqC;AAEtC,OAAO,EACL,MAAM,IAAI,qBAAqB,GAEhC,uCAAoC;AAErC,OAAO,EACL,MAAM,IAAI,oBAAoB,GAE/B,sCAAmC;AAEpC,OAAO,EACL,MAAM,IAAI,oBAAoB,GAE/B,sCAAmC;AAEpC,OAAO,EACL,MAAM,IAAI,mBAAmB,GAE9B,qCAAkC;AAEnC,OAAO,EACL,MAAM,IAAI,mBAAmB,GAE9B,qCAAkC;AAanC,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,MAAM,KAAK,GAAG;QACZ,CAAC,wEAAwE,EAAE,mBAAmB,CAAC;QAC/F;YACE,kEAAkE;YAClE,+BAA+B;SAChC;QACD;YACE,gEAAgE;YAChE,6BAA6B;SAC9B;QACD;YACE,8EAA8E;YAC9E,qBAAqB;SACtB;QACD,CAAC,wDAAwD,EAAE,sBAAsB,CAAC;QAClF,CAAC,sDAAsD,EAAE,oBAAoB,CAAC;QAC9E,CAAC,qCAAqC,EAAE,mBAAmB,CAAC;QAC5D,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;KACnC,CAAC;IAEX,KAAK,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,KAAK,EAAE;QACxC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;YAAE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;KAClF;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {\n handle as handleAvailablePaymentMethods,\n Params as AvailablePaymentMethodsParams,\n} from './handlers/available_payment_methods';\n\nimport {\n handle as handleAvailableFraudProtections,\n Params as AvailableFraudProtectionsParams,\n} from './handlers/available_fraud_protections';\n\nimport {\n handle as handleFraudProtections,\n Params as FraudProtectionsParams,\n} from './handlers/fraud_protections';\n\nimport {\n handle as handleFraudProtection,\n Params as FraudProtectionParams,\n} from './handlers/fraud_protection';\n\nimport {\n handle as handlePaymentMethods,\n Params as PaymentMethodsParams,\n} from './handlers/payment_methods';\n\nimport {\n handle as handlePaymentPresets,\n Params as PaymentPresetsParams,\n} from './handlers/payment_presets';\n\nimport {\n handle as handlePaymentPreset,\n Params as PaymentPresetParams,\n} from './handlers/payment_preset';\n\nimport {\n handle as handlePaymentMethod,\n Params as PaymentMethodParams,\n} from './handlers/payment_method';\n\nexport type Handler = () => Promise<Response>;\n\nexport type Params = AvailablePaymentMethodsParams &\n AvailableFraudProtectionsParams &\n FraudProtectionsParams &\n FraudProtectionParams &\n PaymentMethodsParams &\n PaymentPresetsParams &\n PaymentPresetParams &\n PaymentMethodParams;\n\nexport function getHandler(params: Params): Promise<Response> | null {\n const paths = [\n [/\\/payment_presets\\/(?<presetId>.+?)\\/payment_methods\\/(?<methodId>.+?)/, handlePaymentMethod],\n [\n /\\/payment_presets\\/(?<presetId>.+?)\\/available_fraud_protections/,\n handleAvailableFraudProtections,\n ],\n [\n /\\/payment_presets\\/(?<presetId>.+?)\\/available_payment_methods/,\n handleAvailablePaymentMethods,\n ],\n [\n /\\/payment_presets\\/(?<presetId>.+?)\\/fraud_protections\\/(?<protectionId>.+?)/,\n handleFraudProtection,\n ],\n [/\\/payment_presets\\/(?<presetId>.+?)\\/fraud_protections/, handleFraudProtections],\n [/\\/payment_presets\\/(?<presetId>.+?)\\/payment_methods/, handlePaymentMethods],\n [/\\/payment_presets\\/(?<presetId>.+?)/, handlePaymentPreset],\n [/\\/payment_presets/, handlePaymentPresets],\n ] as const;\n\n for (const [pathRegex, handler] of paths) {\n if (pathRegex.test(new URL(params.request.url).pathname)) return handler(params);\n }\n\n return null;\n}\n"]}
|
|
@@ -120,6 +120,11 @@ interface AvailableFraudProtectionsRel extends Graph {
|
|
|
120
120
|
values: {
|
|
121
121
|
[key: string]: {
|
|
122
122
|
name: string;
|
|
123
|
+
/** If this fraud protection can't be used due to a conflict with another fraud protection, the details about it will be here. */
|
|
124
|
+
conflict?: {
|
|
125
|
+
type: string;
|
|
126
|
+
name: string;
|
|
127
|
+
};
|
|
123
128
|
uses_rejection_threshold: boolean;
|
|
124
129
|
json: null | {
|
|
125
130
|
blocks: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/elements/public/PaymentsApi/api/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Rels } from '@foxy.io/sdk/backend';\nimport type { Graph, Resource } from '@foxy.io/sdk/core';\n\nimport type {\n CollectionGraphLinks,\n CollectionGraphProps,\n} from '@foxy.io/sdk/dist/types/core/defaults';\n\ninterface PaymentPresetsRel extends Graph {\n curie: 'fx:payment_presets';\n props: CollectionGraphProps;\n links: CollectionGraphLinks<PaymentPresetsRel>;\n child: PaymentPresetRel;\n}\n\ninterface PaymentPresetRel extends Graph {\n curie: 'fx:payment_preset';\n props: Omit<Rels.PaymentMethodSet['props'], 'gateway_uri'>;\n links: {\n 'self': PaymentPresetRel;\n 'fx:store': Rels.Store;\n 'fx:payment_methods': PaymentMethodsRel;\n 'fx:fraud_protections': FraudProtectionsRel;\n 'fx:available_payment_methods': AvailablePaymentMethodsRel;\n 'fx:available_fraud_protections': AvailableFraudProtectionsRel;\n };\n}\n\ninterface PaymentMethodsRel extends Graph {\n curie: 'fx:payment_methods';\n props: CollectionGraphProps;\n links: CollectionGraphLinks<PaymentMethodsRel>;\n child: PaymentMethodRel;\n}\n\ninterface PaymentMethodRel extends Graph {\n curie: 'fx:payment_method';\n props: (Rels.HostedPaymentGateway['props'] | Rels.PaymentGateway['props']) & {\n helper: (\n | Rels.PaymentGatewaysHelper\n | Rels.HostedPaymentGatewaysHelper\n )['props']['values'][string];\n };\n links: {\n 'self': PaymentMethodRel;\n 'fx:store': Rels.Store;\n 'fx:payment_preset': any;\n };\n}\n\ninterface FraudProtectionsRel extends Graph {\n curie: 'fx:fraud_protections';\n props: CollectionGraphProps;\n links: CollectionGraphLinks<FraudProtectionsRel>;\n child: FraudProtectionRel;\n}\n\ninterface FraudProtectionRel extends Graph {\n curie: 'fx:fraud_protection';\n links: {\n 'self': FraudProtectionRel;\n 'fx:store': Rels.Store;\n 'fx:payment_preset': PaymentPresetRel;\n };\n props: Rels.FraudProtection['props'] & {\n helper: AvailableFraudProtectionsRel['props']['values'][string];\n };\n}\n\ninterface AvailablePaymentMethodsRel extends Graph {\n curie: 'fx:available_payment_methods';\n props: {\n values: {\n [key: string]: {\n /** The name of this payment gateway. */\n name: string;\n /** The default id you can use for testing this gateway. */\n test_id: string;\n /** The default key you can use for testing this gateway. */\n test_key: string;\n /** The description of the id field for this gateway. */\n id_description: string;\n /** The description of the key field for this gateway. */\n key_description: string;\n /** Whether or not this gateway supports 3D Secure functionality. */\n supports_3d_secure: 0 | 1;\n /** Whether or not this gateway supports authorize only instead of auth+capture. */\n supports_auth_only: 0 | 1;\n /** The default third party key you can use for testing this gateway. */\n test_third_party_key: string;\n /** The description of the third party key field for this gateway. */\n third_party_key_description: string;\n /** Whether or not this payment method is deprecated. */\n is_deprecated: boolean;\n /** If this gateway requires additional information, this will contain details about the data which needs to be collected to configure this gateway. */\n additional_fields: null | {\n blocks: {\n id: string;\n is_live: boolean;\n parent_id: string;\n fields: {\n id: string;\n type: string;\n name: string;\n options?: { name: string; value: string }[];\n optional?: boolean;\n file_type?: string;\n description?: string;\n default_value: string;\n }[];\n }[];\n };\n /** If this payment method can't be used due to a conflict with another payment method, the details about it will be here. */\n conflict?: { type: string; name: string };\n };\n };\n };\n links: {\n self: PaymentMethodRel;\n };\n}\n\ninterface AvailableFraudProtectionsRel extends Graph {\n curie: 'fx:available_fraud_protections';\n links: { self: AvailableFraudProtectionsRel };\n props: {\n values: {\n [key: string]: {\n name: string;\n uses_rejection_threshold: boolean;\n json: null | {\n blocks: {\n id: string;\n is_live?: boolean;\n parent_id: string;\n fields: {\n id: string;\n type: string;\n name: string;\n options?: { name: string; value: string }[];\n optional?: boolean;\n file_type?: string;\n description?: string;\n default_value: unknown;\n }[];\n }[];\n };\n };\n };\n };\n}\n\nexport type PaymentMethods = Resource<PaymentMethodsRel>;\nexport type PaymentMethod = Resource<PaymentMethodRel>;\n\nexport type PaymentPresets = Resource<PaymentPresetsRel>;\nexport type PaymentPreset = Resource<PaymentPresetRel>;\n\nexport type FraudProtections = Resource<FraudProtectionsRel>;\nexport type FraudProtection = Resource<FraudProtectionRel>;\n\nexport type AvailablePaymentMethods = Resource<AvailablePaymentMethodsRel>;\nexport type AvailableFraudProtections = Resource<AvailableFraudProtectionsRel>;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/elements/public/PaymentsApi/api/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Rels } from '@foxy.io/sdk/backend';\nimport type { Graph, Resource } from '@foxy.io/sdk/core';\n\nimport type {\n CollectionGraphLinks,\n CollectionGraphProps,\n} from '@foxy.io/sdk/dist/types/core/defaults';\n\ninterface PaymentPresetsRel extends Graph {\n curie: 'fx:payment_presets';\n props: CollectionGraphProps;\n links: CollectionGraphLinks<PaymentPresetsRel>;\n child: PaymentPresetRel;\n}\n\ninterface PaymentPresetRel extends Graph {\n curie: 'fx:payment_preset';\n props: Omit<Rels.PaymentMethodSet['props'], 'gateway_uri'>;\n links: {\n 'self': PaymentPresetRel;\n 'fx:store': Rels.Store;\n 'fx:payment_methods': PaymentMethodsRel;\n 'fx:fraud_protections': FraudProtectionsRel;\n 'fx:available_payment_methods': AvailablePaymentMethodsRel;\n 'fx:available_fraud_protections': AvailableFraudProtectionsRel;\n };\n}\n\ninterface PaymentMethodsRel extends Graph {\n curie: 'fx:payment_methods';\n props: CollectionGraphProps;\n links: CollectionGraphLinks<PaymentMethodsRel>;\n child: PaymentMethodRel;\n}\n\ninterface PaymentMethodRel extends Graph {\n curie: 'fx:payment_method';\n props: (Rels.HostedPaymentGateway['props'] | Rels.PaymentGateway['props']) & {\n helper: (\n | Rels.PaymentGatewaysHelper\n | Rels.HostedPaymentGatewaysHelper\n )['props']['values'][string];\n };\n links: {\n 'self': PaymentMethodRel;\n 'fx:store': Rels.Store;\n 'fx:payment_preset': any;\n };\n}\n\ninterface FraudProtectionsRel extends Graph {\n curie: 'fx:fraud_protections';\n props: CollectionGraphProps;\n links: CollectionGraphLinks<FraudProtectionsRel>;\n child: FraudProtectionRel;\n}\n\ninterface FraudProtectionRel extends Graph {\n curie: 'fx:fraud_protection';\n links: {\n 'self': FraudProtectionRel;\n 'fx:store': Rels.Store;\n 'fx:payment_preset': PaymentPresetRel;\n };\n props: Rels.FraudProtection['props'] & {\n helper: AvailableFraudProtectionsRel['props']['values'][string];\n };\n}\n\ninterface AvailablePaymentMethodsRel extends Graph {\n curie: 'fx:available_payment_methods';\n props: {\n values: {\n [key: string]: {\n /** The name of this payment gateway. */\n name: string;\n /** The default id you can use for testing this gateway. */\n test_id: string;\n /** The default key you can use for testing this gateway. */\n test_key: string;\n /** The description of the id field for this gateway. */\n id_description: string;\n /** The description of the key field for this gateway. */\n key_description: string;\n /** Whether or not this gateway supports 3D Secure functionality. */\n supports_3d_secure: 0 | 1;\n /** Whether or not this gateway supports authorize only instead of auth+capture. */\n supports_auth_only: 0 | 1;\n /** The default third party key you can use for testing this gateway. */\n test_third_party_key: string;\n /** The description of the third party key field for this gateway. */\n third_party_key_description: string;\n /** Whether or not this payment method is deprecated. */\n is_deprecated: boolean;\n /** If this gateway requires additional information, this will contain details about the data which needs to be collected to configure this gateway. */\n additional_fields: null | {\n blocks: {\n id: string;\n is_live: boolean;\n parent_id: string;\n fields: {\n id: string;\n type: string;\n name: string;\n options?: { name: string; value: string }[];\n optional?: boolean;\n file_type?: string;\n description?: string;\n default_value: string;\n }[];\n }[];\n };\n /** If this payment method can't be used due to a conflict with another payment method, the details about it will be here. */\n conflict?: { type: string; name: string };\n };\n };\n };\n links: {\n self: PaymentMethodRel;\n };\n}\n\ninterface AvailableFraudProtectionsRel extends Graph {\n curie: 'fx:available_fraud_protections';\n links: { self: AvailableFraudProtectionsRel };\n props: {\n values: {\n [key: string]: {\n name: string;\n /** If this fraud protection can't be used due to a conflict with another fraud protection, the details about it will be here. */\n conflict?: { type: string; name: string };\n uses_rejection_threshold: boolean;\n json: null | {\n blocks: {\n id: string;\n is_live?: boolean;\n parent_id: string;\n fields: {\n id: string;\n type: string;\n name: string;\n options?: { name: string; value: string }[];\n optional?: boolean;\n file_type?: string;\n description?: string;\n default_value: unknown;\n }[];\n }[];\n };\n };\n };\n };\n}\n\nexport type PaymentMethods = Resource<PaymentMethodsRel>;\nexport type PaymentMethod = Resource<PaymentMethodRel>;\n\nexport type PaymentPresets = Resource<PaymentPresetsRel>;\nexport type PaymentPreset = Resource<PaymentPresetRel>;\n\nexport type FraudProtections = Resource<FraudProtectionsRel>;\nexport type FraudProtection = Resource<FraudProtectionRel>;\n\nexport type AvailablePaymentMethods = Resource<AvailablePaymentMethodsRel>;\nexport type AvailableFraudProtections = Resource<AvailableFraudProtectionsRel>;\n"]}
|
package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Data } from './types';
|
|
2
1
|
import type { PropertyDeclarations } from 'lit-element';
|
|
3
2
|
import type { TemplateResult } from 'lit-html';
|
|
3
|
+
import type { Data } from './types';
|
|
4
4
|
import type { NucleonV8N } from '../NucleonElement/types';
|
|
5
5
|
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
6
6
|
import { InternalForm } from '../../internal/InternalForm/InternalForm';
|