@justifi/webcomponents 4.5.0 → 4.6.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/cjs/{Api-d2df6e84.js → Api-35180a85.js} +2 -2
- package/dist/cjs/Api-35180a85.js.map +1 -0
- package/dist/cjs/Payout-4906a445.js.map +1 -1
- package/dist/cjs/form-control-datepart_2.cjs.entry.js +1 -1
- package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
- package/dist/cjs/form-control-number_3.cjs.entry.js +1 -1
- package/dist/cjs/form-control-select.cjs.entry.js +1 -1
- package/dist/cjs/{index-4ffc90c0.js → index-3533152c.js} +1 -6
- package/dist/cjs/index-3533152c.js.map +1 -0
- package/dist/cjs/justifi-additional-questions_5.cjs.entry.js +1 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payment-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1482 -16
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payments-list.cjs.entry.js +20 -20
- package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/select-input_2.cjs.entry.js +1 -1
- package/dist/cjs/{utils-a5b5bfdf.js → utils-d95b09c2.js} +2 -2
- package/dist/cjs/{utils-a5b5bfdf.js.map → utils-d95b09c2.js.map} +1 -1
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/api/Api.js +1 -1
- package/dist/collection/api/Api.js.map +1 -1
- package/dist/collection/api/Payment.js.map +1 -1
- package/dist/collection/components/bank-account-form/bank-account-form.js +6 -1
- package/dist/collection/components/bank-account-form/bank-account-form.js.map +1 -1
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js +8 -0
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -1
- package/dist/collection/components/card-form/card-form.js +6 -1
- package/dist/collection/components/card-form/card-form.js.map +1 -1
- package/dist/collection/components/card-form/card-form.stories.js +8 -0
- package/dist/collection/components/card-form/card-form.stories.js.map +1 -1
- package/dist/collection/components/payment-details/payment-details.stories.js +3 -3
- package/dist/collection/components/payment-details/payment-details.stories.js.map +1 -1
- package/dist/collection/components/payment-method-form/payment-method-form.css +5 -0
- package/dist/collection/components/payment-method-form/payment-method-form.js +25 -35
- package/dist/collection/components/payment-method-form/payment-method-form.js.map +1 -1
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js +7 -7
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js.map +1 -1
- package/dist/collection/components/payments-list/payments-list.js +18 -18
- package/dist/collection/components/payments-list/payments-list.js.map +1 -1
- package/dist/collection/components/payments-list/payments-list.stories.js +3 -3
- package/dist/collection/components/payments-list/payments-list.stories.js.map +1 -1
- package/dist/collection/components/payout-details/payout-details.stories.js +3 -3
- package/dist/collection/components/payout-details/payout-details.stories.js.map +1 -1
- package/dist/collection/components/payouts-list/payouts-list.stories.js +3 -3
- package/dist/collection/components/payouts-list/payouts-list.stories.js.map +1 -1
- package/dist/components/Api.js +1 -1
- package/dist/components/Api.js.map +1 -1
- package/dist/components/Payout.js.map +1 -1
- package/dist/components/justifi-bank-account-form.js +2 -0
- package/dist/components/justifi-bank-account-form.js.map +1 -1
- package/dist/components/justifi-card-form.js +2 -0
- package/dist/components/justifi-card-form.js.map +1 -1
- package/dist/components/justifi-payments-list.js +18 -18
- package/dist/components/justifi-payments-list.js.map +1 -1
- package/dist/components/payment-method-form.js +1483 -18
- package/dist/components/payment-method-form.js.map +1 -1
- package/dist/esm/{Api-a95f17ac.js → Api-60524edb.js} +2 -2
- package/dist/esm/Api-60524edb.js.map +1 -0
- package/dist/esm/Payout-9a1f2859.js.map +1 -1
- package/dist/esm/form-control-datepart_2.entry.js +1 -1
- package/dist/esm/form-control-monetary.entry.js +1 -1
- package/dist/esm/form-control-number_3.entry.js +1 -1
- package/dist/esm/form-control-select.entry.js +1 -1
- package/dist/esm/{index-609a2c67.js → index-fe877d03.js} +1 -6
- package/dist/esm/index-fe877d03.js.map +1 -0
- package/dist/esm/justifi-additional-questions_5.entry.js +1 -1
- package/dist/esm/justifi-bank-account-form.entry.js +3 -1
- package/dist/esm/justifi-bank-account-form.entry.js.map +1 -1
- package/dist/esm/justifi-billing-form_2.entry.js +1 -1
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-business-list.entry.js +2 -2
- package/dist/esm/justifi-card-form.entry.js +3 -1
- package/dist/esm/justifi-card-form.entry.js.map +1 -1
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +3 -3
- package/dist/esm/justifi-payment-form.entry.js +1 -1
- package/dist/esm/justifi-payment-method-form.entry.js +1482 -16
- package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
- package/dist/esm/justifi-payments-list.entry.js +20 -20
- package/dist/esm/justifi-payments-list.entry.js.map +1 -1
- package/dist/esm/justifi-payout-details.entry.js +3 -3
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-proceeds-list.entry.js +2 -2
- package/dist/esm/justifi-table.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/select-input_2.entry.js +1 -1
- package/dist/esm/{utils-cdf0b984.js → utils-1e7d6279.js} +2 -2
- package/dist/esm/{utils-cdf0b984.js.map → utils-1e7d6279.js.map} +1 -1
- package/dist/esm/webcomponents.js +3 -3
- package/dist/types/api/Payment.d.ts +10 -0
- package/dist/types/components/bank-account-form/bank-account-form.stories.d.ts +6 -0
- package/dist/types/components/card-form/card-form.stories.d.ts +6 -0
- package/dist/types/components/payment-method-form/payment-method-form.d.ts +1 -3
- package/dist/types/components/payments-list/payments-list.d.ts +2 -1
- package/dist/types/components.d.ts +2 -0
- package/dist/webcomponents/{p-391b8f1d.entry.js → p-084f3fb5.entry.js} +2 -2
- package/dist/webcomponents/{p-b967262f.entry.js → p-1beaaba3.entry.js} +2 -2
- package/dist/webcomponents/{p-0237a6bc.entry.js → p-2b6f5e35.entry.js} +2 -2
- package/dist/webcomponents/{p-86464cab.entry.js → p-2e66512d.entry.js} +2 -2
- package/dist/webcomponents/{p-f8d49acb.entry.js → p-640bfa9f.entry.js} +2 -2
- package/dist/webcomponents/{p-239564c6.entry.js → p-641883b2.entry.js} +2 -2
- package/dist/webcomponents/{p-e26d7eea.entry.js → p-659ee5b4.entry.js} +2 -2
- package/dist/webcomponents/{p-f0acb27e.entry.js → p-74685901.entry.js} +2 -2
- package/dist/webcomponents/p-74685901.entry.js.map +1 -0
- package/dist/webcomponents/{p-c1e4288d.entry.js → p-84c72d6d.entry.js} +2 -2
- package/dist/webcomponents/{p-b042bf80.entry.js → p-9c9cb767.entry.js} +2 -2
- package/dist/webcomponents/p-9d63fa95.entry.js +2 -0
- package/dist/webcomponents/p-9d63fa95.entry.js.map +1 -0
- package/dist/webcomponents/{p-27b15fe8.entry.js → p-9db1c296.entry.js} +2 -2
- package/dist/webcomponents/{p-e77d8c6e.entry.js → p-a922b908.entry.js} +2 -2
- package/dist/webcomponents/p-ab0756ff.js.map +1 -1
- package/dist/webcomponents/p-c44e1415.js +2 -0
- package/dist/webcomponents/{p-8f421dc6.js.map → p-c44e1415.js.map} +1 -1
- package/dist/webcomponents/{p-7e3bbe32.entry.js → p-cd0eca25.entry.js} +2 -2
- package/dist/webcomponents/{p-7e3bbe32.entry.js.map → p-cd0eca25.entry.js.map} +1 -1
- package/dist/webcomponents/{p-0d6e9f76.entry.js → p-d92116e6.entry.js} +2 -2
- package/dist/webcomponents/{p-0d6e9f76.entry.js.map → p-d92116e6.entry.js.map} +1 -1
- package/dist/webcomponents/{p-d1bbf409.entry.js → p-db9945b1.entry.js} +2 -2
- package/dist/webcomponents/{p-c18d876e.entry.js → p-e1f6c8ec.entry.js} +2 -2
- package/dist/webcomponents/{p-126146d4.js → p-e6695628.js} +2 -2
- package/dist/webcomponents/{p-308b6784.js → p-e70b2a21.js} +2 -2
- package/dist/webcomponents/p-e70b2a21.js.map +1 -0
- package/dist/webcomponents/{p-439fc294.entry.js → p-ecc820e5.entry.js} +2 -2
- package/dist/webcomponents/{p-7abb092c.entry.js → p-f6cc37a6.entry.js} +2 -2
- package/dist/webcomponents/{p-bf9c2be2.entry.js → p-f8067330.entry.js} +2 -2
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/package.json +3 -2
- package/dist/cjs/Api-d2df6e84.js.map +0 -1
- package/dist/cjs/index-4ffc90c0.js.map +0 -1
- package/dist/esm/Api-a95f17ac.js.map +0 -1
- package/dist/esm/index-609a2c67.js.map +0 -1
- package/dist/webcomponents/p-308b6784.js.map +0 -1
- package/dist/webcomponents/p-66f010e5.entry.js +0 -2
- package/dist/webcomponents/p-66f010e5.entry.js.map +0 -1
- package/dist/webcomponents/p-8f421dc6.js +0 -2
- package/dist/webcomponents/p-f0acb27e.entry.js.map +0 -1
- /package/dist/webcomponents/{p-391b8f1d.entry.js.map → p-084f3fb5.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-b967262f.entry.js.map → p-1beaaba3.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-0237a6bc.entry.js.map → p-2b6f5e35.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-86464cab.entry.js.map → p-2e66512d.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-f8d49acb.entry.js.map → p-640bfa9f.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-239564c6.entry.js.map → p-641883b2.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-e26d7eea.entry.js.map → p-659ee5b4.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-c1e4288d.entry.js.map → p-84c72d6d.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-b042bf80.entry.js.map → p-9c9cb767.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-27b15fe8.entry.js.map → p-9db1c296.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-e77d8c6e.entry.js.map → p-a922b908.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-d1bbf409.entry.js.map → p-db9945b1.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-c18d876e.entry.js.map → p-e1f6c8ec.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-126146d4.js.map → p-e6695628.js.map} +0 -0
- /package/dist/webcomponents/{p-439fc294.entry.js.map → p-ecc820e5.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-7abb092c.entry.js.map → p-f6cc37a6.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-bf9c2be2.entry.js.map → p-f8067330.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../../src/api/Api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAwBpC,MAAM,GAAG,GAAG,CAAC,SAAiB,EAAE,eAAwB,EAAE,EAAE;EAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;EAC7C,MAAM,SAAS,GAAG,eAAe,IAAI,aAAa,I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C,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;EAC/D,CAAC;EAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC,CAAC;AAEF,SAAS,WAAW,CAAC,UAAkB;EACrC,OAAO,CAAC,KAAK,CAAC,uBAAuB,UAAU,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,eAAe,GAAG,CAAC","sourcesContent":["import { v4 as uuidv4 } from 'uuid';\nimport { IPagination } from './Pagination';\n\nexport interface IApiResponse<T> {\n data: T;\n error?: IErrorObject | IServerError;\n page_info?: IPagination;\n errors?: string[];\n id: number;\n type: string;\n}\n\nexport type IServerError = string;\n\nexport interface IErrorObject {\n message: string;\n code: string;\n param?: string;\n}\n\nexport interface IApiResponseCollection<T> extends IApiResponse<T> {\n page_info: IPagination;\n}\n\nconst Api = (authToken: string, customApiOrigin?: string) => {\n const originFromEnv = process.env.API_ORIGIN;\n const apiOrigin = customApiOrigin || originFromEnv || 'https://wc-proxy.justifi.ai';\n\n async function getAuthorizationHeader() {\n return {\n 'Authorization': `Bearer ${authToken}`,\n 'Idempotency-Key': uuidv4(),\n 'Content-Type': 'application/json',\n };\n }\n\n async function makeRequest(endpoint: string, method: string, params?: any, body?: any, signal?: AbortSignal) {\n const url = `${apiOrigin}/v1/${endpoint}`;\n let cursor;\n if (params?.paging) {\n cursor = params?.paging && params?.direction ? `${params.direction === 'prev'\n ? '&before_cursor=' + params.paging.start_cursor\n : params.direction === 'next'\n ? '&after_cursor=' + params.paging.end_cursor\n : ''\n }` : null;\n delete params.paging;\n }\n if (params?.direction) {\n delete params.direction;\n }\n const requestUrl = params ? `${url}?${new URLSearchParams(params)}${cursor ? '&' + cursor : ''}` : url;\n const response = await fetch(requestUrl, {\n method: method,\n headers: await getAuthorizationHeader(),\n body: body,\n signal: signal,\n });\n\n if (response) {\n return response.status === 204 ? {} : response.json();\n }\n handleError(requestUrl);\n }\n\n async function get(endpoint: string, params?: any, signal?: AbortSignal) {\n return makeRequest(endpoint, 'GET', params, null, signal);\n }\n\n async function post(endpoint: string, body?: any, params?: any, signal?: AbortSignal) {\n return makeRequest(endpoint, 'POST', params, body, signal);\n }\n\n async function patch(endpoint: string, body?: any, params?: any, signal?: AbortSignal) {\n return makeRequest(endpoint, 'PATCH', params, body, signal);\n }\n\n async function destroy(endpoint: string, params?: any, signal?: AbortSignal) {\n return makeRequest(endpoint, 'DELETE', params, null, signal);\n }\n\n return { get, post, patch, destroy };\n};\n\nfunction handleError(requestUrl: string): void {\n console.error(`Error fetching from ${requestUrl}`);\n}\n\nexport default Api;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payment.js","sourceRoot":"","sources":["../../../src/api/Payment.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;EACzB,0CAAuB,CAAA;EACvB,oCAAiB,CAAA;AACnB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;EAC5B,mCAAa,CAAA;EACb,iDAA2B,CAAA;AAC7B,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,eAQX;AARD,WAAY,eAAe;EACzB,sCAAmB,CAAA;EACnB,4CAAyB,CAAA;EACzB,0CAAuB,CAAA;EACvB,oCAAiB,CAAA;EACjB,wCAAqB,CAAA;EACrB,oDAAiC,CAAA;EACjC,4DAAyC,CAAA;AAC3C,CAAC,EARW,eAAe,KAAf,eAAe,QAQ1B;AAED,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;EACjC,6EAA6E;EAC7E,wCAAa,CAAA;EACb,wCAAa,CAAA;AACf,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC;
|
|
1
|
+
{"version":3,"file":"Payment.js","sourceRoot":"","sources":["../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CACF","sourcesContent":["export enum CaptureStrategy {\n automatic = 'automatic',\n manual = 'manual',\n}\n\nexport enum PaymentMethodTypes {\n card = 'card',\n bankAccount = 'bankAccount',\n}\n\nexport enum PaymentStatuses {\n pending = 'pending',\n authorized = 'authorized',\n succeeded = 'succeeded',\n failed = 'failed',\n disputed = 'disputed',\n fully_refunded = 'fully_refunded',\n partially_refunded = 'partially_refunded',\n}\n\nexport enum PaymentDisputedStatuses {\n // if a dispute is 'won', we don't show a dispute status, just general status\n lost = 'lost',\n open = 'open',\n}\n\nexport interface IPaymentMethod {\n card?: ICard;\n bank_account?: IBankAccount;\n}\n\nexport type CardBrand = 'american_express' | 'diners_club' | 'discover' | 'jcb' | 'mastercard' | 'china_unionpay' | 'visa' | 'unknown';\n\nexport interface IBankAccount {\n id: string;\n acct_last_four: string;\n name: string;\n brand: string;\n token: string\n created_at: string;\n updated_at: string;\n}\n\nexport interface ICard {\n id: string;\n acct_last_four: string;\n name: string;\n brand: CardBrand;\n token: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface IDispute {\n amount_cents: number;\n created_at: string;\n currency: string;\n gateway_ref_id: string;\n id: string;\n payment_id: string;\n reason: null;\n status: string;\n updated_at: string;\n}\n\nexport interface IPayment {\n id: string;\n account_id: string;\n amount: number;\n amount_disputed: number;\n amount_refundable: number;\n amount_refunded: number;\n balance: number;\n captured: boolean;\n capture_strategy: CaptureStrategy;\n currency: 'usd';\n description: string;\n disputed: boolean;\n disputes: IDispute[];\n error_code: string | null;\n error_description: string | null;\n fee_amount: number;\n is_test: boolean;\n metadata: Object | null;\n payment_method: IPaymentMethod;\n payment_intent_id: string | null;\n refunded: boolean;\n status: PaymentStatuses;\n created_at: string;\n updated_at: string;\n}\n\nexport class Payment implements IPayment {\n public id: string;\n public account_id: string;\n public amount: number;\n public amount_disputed: number;\n public amount_refundable: number;\n public amount_refunded: number;\n public balance: number;\n public captured: boolean;\n public capture_strategy: CaptureStrategy;\n public currency: 'usd';\n public description: string;\n public disputed: boolean;\n public disputes: IDispute[];\n public error_code: string | null;\n public error_description: string | null;\n public fee_amount: number;\n public is_test: boolean;\n public metadata: Object | null;\n public payment_method: IPaymentMethod;\n public payment_intent_id: string | null;\n public refunded: boolean;\n public status: PaymentStatuses;\n public created_at: string;\n public updated_at: string;\n public statement_descriptor?: string;\n\n constructor(payment: IPayment) {\n this.id = payment.id;\n this.account_id = payment.account_id;\n this.amount = payment.amount;\n this.amount_disputed = payment.amount_disputed;\n this.amount_refundable = payment.amount_refundable;\n this.amount_refunded = payment.amount_refunded;\n this.balance = payment.balance;\n this.captured = payment.captured;\n this.capture_strategy = payment.capture_strategy;\n this.currency = payment.currency;\n this.description = payment.description;\n this.disputed = payment.disputed;\n this.disputes = payment.disputes;\n this.error_code = payment.error_code;\n this.error_description = payment.error_description;\n this.fee_amount = payment.fee_amount;\n this.is_test = payment.is_test;\n this.metadata = payment.metadata;\n this.payment_method = payment.payment_method;\n this.payment_intent_id = payment.payment_intent_id;\n this.refunded = payment.refunded;\n this.status = payment.status;\n this.created_at = payment.created_at;\n this.updated_at = payment.updated_at;\n }\n\n get disputedStatus(): PaymentDisputedStatuses | null {\n const lost = this.disputes.some(dispute => dispute.status === PaymentDisputedStatuses.lost);\n // if a dispute is 'won', we don't show a dispute status, just general status\n if (!this.disputed) {\n return null;\n } else if (lost) {\n return PaymentDisputedStatuses.lost;\n } else {\n return PaymentDisputedStatuses.open;\n }\n }\n}\n"]}
|
|
@@ -38,8 +38,10 @@ export class BankAccountForm {
|
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Manually resizes the iframe to fit the contents of the iframe
|
|
41
|
+
* @deprecated This method will be removed in future releases.
|
|
41
42
|
*/
|
|
42
43
|
async resize() {
|
|
44
|
+
console.warn(`The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`);
|
|
43
45
|
if (!this.childRef) {
|
|
44
46
|
throw new Error('Cannot call validate');
|
|
45
47
|
}
|
|
@@ -237,7 +239,10 @@ export class BankAccountForm {
|
|
|
237
239
|
},
|
|
238
240
|
"docs": {
|
|
239
241
|
"text": "Manually resizes the iframe to fit the contents of the iframe",
|
|
240
|
-
"tags": [
|
|
242
|
+
"tags": [{
|
|
243
|
+
"name": "deprecated",
|
|
244
|
+
"text": "This method will be removed in future releases."
|
|
245
|
+
}]
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-account-form.js","sourceRoot":"","sources":["../../../../src/components/bank-account-form/bank-account-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ/F,MAAM,OAAO,eAAe;;;;;;EAsC1B,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAC;IACxH,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACzB,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,+MAA+M,CAChN,CAAC;IACF,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,+MAA+M,CAChN,CAAC;IACF,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC;EAID;;KAEG;EAEH,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAiE;IACjF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;EACzC,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,QAAQ;IACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;EAClC,CAAC;EAED
|
|
1
|
+
{"version":3,"file":"bank-account-form.js","sourceRoot":"","sources":["../../../../src/components/bank-account-form/bank-account-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ/F,MAAM,OAAO,eAAe;;;;;;EAsC1B,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAC;IACxH,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACzB,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,+MAA+M,CAChN,CAAC;IACF,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,+MAA+M,CAChN,CAAC;IACF,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC;EAID;;KAEG;EAEH,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAiE;IACjF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;EACzC,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,QAAQ;IACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;EAClC,CAAC;EAED;;;KAGG;EAEH,KAAK,CAAC,MAAM;IACV,OAAO,CAAC,IAAI,CACV,wKAAwK,CACzK,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;EAChC,CAAC;EAED,MAAM;IACJ,OAAO,CACL,mCACE,GAAG,EAAE,EAAE,CAAC,EAAE;QACR,IAAI,EAAE,EAAE;UACN,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;MACH,CAAC,mBACc,IAAI,CAAC,YAAY,8BACP,aAAa,+BACX,IAAI,CAAC,oBAAoB,kCACtB,IAAI,CAAC,uBAAuB,yCACrB,IAAI,CAAC,cAAc,IAAI,UAAU,GACtE,CACH,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Prop, h, EventEmitter, Listen, Method, State } from '@stencil/core';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\nimport { Theme } from '../payment-method-form/theme';\n\n@Component({\n tag: 'justifi-bank-account-form',\n shadow: false,\n})\nexport class BankAccountForm {\n /**\n * When to trigger validation of the form.\n */\n @Prop({ mutable: true }) validationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n\n /**\n * URL for the rendered iFrame. End-users need not use this.\n */\n @Prop({ mutable: true }) iframeOrigin?: string;\n\n @State() internalStyleOverrides: Theme;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-bank-account-form#bankAccountFormReady\n */\n @Event() bankAccountFormReady: EventEmitter<any>;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-bank-account-form#ready\n */\n @Event() ready: EventEmitter<any>;\n\n /**\n * Triggered when the tokenize method is called on the component\n * @event justifi-bank-account-form#bankAccountFormTokenize\n */\n @Event() bankAccountFormTokenize: EventEmitter<{ data: any }>;\n\n /**\n * Triggered when the validate method is called on the component\n * @event justifi-bank-account-form#bankAccountFormValidate\n */\n @Event() bankAccountFormValidate: EventEmitter<{ data: { isValid: boolean } }>;\n\n @Listen('paymentMethodFormReady')\n readyHandler(event: CustomEvent) {\n console.warn(`The 'bankAccountFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);\n this.bankAccountFormReady.emit(event);\n this.ready.emit(event);\n }\n\n @Listen('paymentMethodFormTokenize')\n tokenizeHandler(event: { data: any }) {\n console.warn(\n `The 'bankAccountFormTokenize' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`,\n );\n this.bankAccountFormTokenize.emit(event);\n }\n\n @Listen('paymentMethodFormValidate')\n validateHandler(event: { data: any }) {\n console.warn(\n `The 'bankAccountFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`,\n );\n this.bankAccountFormValidate.emit(event);\n }\n\n private childRef?: HTMLJustifiPaymentMethodFormElement;\n\n /**\n * Makes a tokenization request to the iframe\n */\n @Method()\n async tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<CreatePaymentMethodResponse> {\n if (!this.childRef) {\n throw new Error('Cannot call tokenize');\n }\n return this.childRef.tokenize(...args);\n }\n\n /**\n * Runs a validation on the form and shows errors if any\n */\n @Method()\n async validate() {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.validate();\n }\n\n /**\n * Manually resizes the iframe to fit the contents of the iframe\n * @deprecated This method will be removed in future releases.\n */\n @Method()\n async resize(): Promise<void> {\n console.warn(\n `The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`,\n );\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.resize();\n }\n\n render() {\n return (\n <justifi-payment-method-form\n ref={el => {\n if (el) {\n this.childRef = el;\n }\n }}\n iframe-origin={this.iframeOrigin}\n payment-method-form-type=\"bankAccount\"\n payment-method-form-ready={this.bankAccountFormReady}\n payment-method-form-tokenize={this.bankAccountFormTokenize}\n payment-method-form-validation-mode={this.validationMode || 'onSubmit'}\n />\n );\n }\n}\n"]}
|
|
@@ -52,9 +52,17 @@ export default {
|
|
|
52
52
|
defaultValue: CSSVars,
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
|
+
'resize': {
|
|
56
|
+
description: 'Deprecated: This method will be removed in future releases.',
|
|
57
|
+
table: {
|
|
58
|
+
category: 'methods',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
55
61
|
},
|
|
56
62
|
decorators: [
|
|
57
63
|
story => `
|
|
64
|
+
<!-- Deprecated Notice -->
|
|
65
|
+
<p style="color: red; font-family: 'Roboto Mono', monospace;">Note: The 'resize' method is deprecated and will be removed in future releases.</p>
|
|
58
66
|
${story()}
|
|
59
67
|
<script>${addEvents()}</script>
|
|
60
68
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-account-form.stories.js","sourceRoot":"","sources":["../../../../src/components/bank-account-form/bank-account-form.stories.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AACrD,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCf,CAAC;AAEF,eAAe;EACb,KAAK,EAAE,4BAA4B;EACnC,SAAS,EAAE,2BAA2B;EACtC,QAAQ,EAAE;IACR,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC7B,QAAQ,EAAE,OAAO;OAClB;KACF;IACD,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE,OAAO;OACtB;KACF;GACF;EACD,UAAU,EAAE;IACV,KAAK,CAAC,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"bank-account-form.stories.js","sourceRoot":"","sources":["../../../../src/components/bank-account-form/bank-account-form.stories.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AACrD,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCf,CAAC;AAEF,eAAe;EACb,KAAK,EAAE,4BAA4B;EACnC,SAAS,EAAE,2BAA2B;EACtC,QAAQ,EAAE;IACR,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC7B,QAAQ,EAAE,OAAO;OAClB;KACF;IACD,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE,OAAO;OACtB;KACF;IACD,QAAQ,EAAE;MACR,WAAW,EAAE,6DAA6D;MAC1E,KAAK,EAAE;QACL,QAAQ,EAAE,SAAS;OACpB;KACF;GACF;EACD,UAAU,EAAE;IACV,KAAK,CAAC,EAAE,CAAC;;;QAG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AAC;EACpC,CAAC,CAAC,CAAC;EACH,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;IACxC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;EAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;EACrB,gBAAgB,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;CAgBnB,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAS,EAAE,EAAE;EAC7B,OAAO;;;;UAIC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;;;;;2BAKV,IAAI,CAAC,iBAAiB,CAAC,IAAI,UAAU;yBACvC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;;;MAG9C,WAAW;GACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEvC,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG;EACZ,eAAe,EAAE,OAAO;CACzB,CAAC","sourcesContent":["const isDev = process.env.NODE_ENV === 'development';\nconst CSSVars = `\n--jfi-load-google-font: 'Roboto Mono:wght@200;400;700;900&family=Agdasima';\n--jfi-layout-font-family: Roboto Mono;\n--jfi-layout-padding: 4px;\n--jfi-layout-form-control-spacing-x: .5rem;\n--jfi-layout-form-control-spacing-y: 1rem;\n--jfi-form-label-font-weight: 700;\n--jfi-form-label-font-family: sans-serif;\n--jfi-form-label-margin: 0 0 .5rem 0;\n--jfi-form-control-background-color: #F4F4F6;\n--jfi-form-control-background-color-hover: #EEEEF5;\n--jfi-form-control-border-color: rgba(0, 0, 0, 0.42);\n--jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);\n--jfi-form-control-border-color-focus: #fccc32;\n--jfi-form-control-border-color-error: #C12727;\n--jfi-form-control-border-top-width: 0;\n--jfi-form-control-border-left-width: 0;\n--jfi-form-control-border-bottom-width: 1px;\n--jfi-form-control-border-right-width: 0;\n--jfi-form-control-border-radius: 4px 4px 0 0;\n--jfi-form-control-border-style: solid;\n--jfi-form-control-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n--jfi-form-control-box-shadow-focus: none;\n--jfi-form-control-box-shadow-error-focus: none;\n--jfi-form-control-border-style: solid;\n--jfi-form-control-color: #212529;\n--jfi-form-control-font-size: 1rem;\n--jfi-form-control-font-weight: 400;\n--jfi-form-control-line-height: 2;\n--jfi-form-control-margin: 0;\n--jfi-form-control-padding: .5rem .875rem;\n--jfi-error-message-color: #C12727;\n--jfi-error-message-margin: .25rem 0 0 0;\n--jfi-error-message-font-size: .875rem;\n`;\n\nexport default {\n title: 'Components/BankAccountForm',\n component: 'justifi-bank-account-form',\n argTypes: {\n 'iframe-origin': {\n control: 'text',\n table: {\n disable: isDev ? false : true,\n category: 'props',\n },\n },\n 'css-variables': {\n control: 'text',\n table: {\n category: 'props',\n defaultValue: CSSVars,\n },\n },\n 'resize': {\n description: 'Deprecated: This method will be removed in future releases.',\n table: {\n category: 'methods',\n },\n },\n },\n decorators: [\n story => `\n <!-- Deprecated Notice -->\n <p style=\"color: red; font-family: 'Roboto Mono', monospace;\">Note: The 'resize' method is deprecated and will be removed in future releases.</p>\n ${story()}\n <script>${addEvents()}</script>\n `,\n ],\n};\n\nconst handleValidateClick = async (bankForm: HTMLJustifiBankAccountFormElement) => {\n const valid = await bankForm.validate();\n console.log(valid);\n};\nconst handleTokenizeClick = async (bankForm: HTMLJustifiBankAccountFormElement, paymentMethodData: any) => {\n const tokenizeResponse = await bankForm.tokenize('CLIENT_ID', paymentMethodData);\n console.log(tokenizeResponse);\n};\nconst handleResizeClick = async (bankForm: HTMLJustifiBankAccountFormElement) => {\n await bankForm.resize();\n};\nconst handleReady = () => {\n console.log('bank account form is ready');\n const bankForm = document.querySelector('justifi-bank-account-form') as HTMLJustifiBankAccountFormElement;\n const validateBtn = document.querySelector('#validate-btn');\n const tokenizeBtn = document.querySelector('#tokenize-btn');\n const resizeBtn = document.querySelector('#resize-btn');\n validateBtn?.addEventListener('click', () => {\n handleValidateClick(bankForm);\n });\n tokenizeBtn?.addEventListener('click', () => {\n handleTokenizeClick(bankForm, {});\n });\n resizeBtn?.addEventListener('click', () => {\n handleResizeClick(bankForm);\n });\n};\n\nconst addEvents = () => {\n addEventListener('bankAccountFormReady', handleReady);\n};\n\nconst FormButtons = `\n <style>\n .button-bar {\n display: flex;\n aligin-items: center;\n padding: 10px;\n }\n .button-bar button {\n margin-right: 10px;\n }\n </style>\n <div class=\"button-bar\">\n <button id=\"validate-btn\">Validate</button>\n <button id=\"tokenize-btn\">Tokenize</button>\n <button id=\"resize-btn\">Resize</button>\n </div>\n`;\n\nconst Template = (args: any) => {\n return `\n <div>\n <style>\n :root {\n ${args['css-variables'] || ''}\n }\n </style>\n <justifi-bank-account-form\n data-testid=\"bank-account-form-iframe\"\n validation-mode='${args['validation-mode'] || 'onSubmit'}'\n iframe-origin='${args['iframe-origin'] || ''}'\n />\n </div>\n ${FormButtons}\n `;\n};\n\nexport const Basic = Template.bind({});\n\nexport const Styled = Template.bind({});\nStyled.args = {\n 'css-variables': CSSVars,\n};\n"]}
|
|
@@ -39,8 +39,10 @@ export class CardForm {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Manually resizes the iframe to fit the contents of the iframe
|
|
42
|
+
* @deprecated This method will be removed in future releases.
|
|
42
43
|
*/
|
|
43
44
|
async resize() {
|
|
45
|
+
console.warn(`The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`);
|
|
44
46
|
if (!this.childRef) {
|
|
45
47
|
throw new Error('Cannot call validate');
|
|
46
48
|
}
|
|
@@ -256,7 +258,10 @@ export class CardForm {
|
|
|
256
258
|
},
|
|
257
259
|
"docs": {
|
|
258
260
|
"text": "Manually resizes the iframe to fit the contents of the iframe",
|
|
259
|
-
"tags": [
|
|
261
|
+
"tags": [{
|
|
262
|
+
"name": "deprecated",
|
|
263
|
+
"text": "This method will be removed in future releases."
|
|
264
|
+
}]
|
|
260
265
|
}
|
|
261
266
|
}
|
|
262
267
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-form.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ/F,MAAM,OAAO,QAAQ;;;;sBAcW,KAAK;;;EA+BnC,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,IAAI,CAAC,kGAAkG,CAAC,CAAC;IACjH,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACzB,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,wMAAwM,CACzM,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACpC,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,wMAAwM,CACzM,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACpC,CAAC;EAID;;KAEG;EAEH,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAiE;IACjF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CA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AC,CAAC;EACzC,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,QAAQ;IACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;EAClC,CAAC;EAED;;;KAGG;EAEH,KAAK,CAAC,MAAM;IACV,OAAO,CAAC,IAAI,CACV,wKAAwK,CACzK,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;EAChC,CAAC;EAED,MAAM;IACJ,OAAO,CACL,mCACE,GAAG,EAAE,EAAE,CAAC,EAAE;QACR,IAAI,EAAE,EAAE;UACN,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;MACH,CAAC,mBACc,IAAI,CAAC,YAAY,8BACP,MAAM,iBAClB,IAAI,CAAC,UAAU,+BACD,IAAI,CAAC,aAAa,kCACf,IAAI,CAAC,gBAAgB,yCACd,IAAI,CAAC,cAAc,IAAI,UAAU,GACtE,CACH,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Prop, h, EventEmitter, Method, Listen, State } from '@stencil/core';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\nimport { Theme } from '../payment-method-form/theme';\n\n@Component({\n tag: 'justifi-card-form',\n shadow: false,\n})\nexport class CardForm {\n /**\n * When to trigger validation of the form.\n */\n @Prop({ mutable: true }) validationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n\n /**\n * URL for the rendered iFrame. End-users need not use this.\n */\n @Prop({ mutable: true }) iframeOrigin?: string;\n\n /**\n * Boolean indicating if the Card Form should render in a single line\n */\n @Prop() singleLine: boolean = false;\n\n @State() internalStyleOverrides: Theme;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#cardFormReady\n */\n\n @Event() cardFormReady: EventEmitter;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#ready\n */\n\n @Event() ready: EventEmitter;\n\n /**\n * Triggered when the tokenize method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormTokenize: EventEmitter<{ data: any }>;\n\n /**\n * Triggered when the validate method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormValidate: EventEmitter<{ data: { isValid: boolean } }>;\n\n @Listen('paymentMethodFormReady')\n readyHandler(event: CustomEvent) {\n console.warn(`The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);\n this.cardFormReady.emit(event);\n this.ready.emit(event);\n }\n\n @Listen('paymentMethodFormTokenize')\n tokenizeHandler(event: { data: any }) {\n console.warn(\n `The 'cardFormTokenize' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`,\n );\n this.cardFormTokenize.emit(event);\n }\n\n @Listen('paymentMethodFormValidate')\n validateHandler(event: { data: any }) {\n console.warn(\n `The 'cardFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`,\n );\n this.cardFormValidate.emit(event);\n }\n\n private childRef?: HTMLJustifiPaymentMethodFormElement;\n\n /**\n * Makes a tokenization request to the iframe\n */\n @Method()\n async tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<CreatePaymentMethodResponse> {\n if (!this.childRef) {\n throw new Error('Cannot call tokenize');\n }\n return this.childRef.tokenize(...args);\n }\n\n /**\n * Runs a validation on the form and shows errors if any\n */\n @Method()\n async validate(): Promise<{ isValid: boolean }> {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.validate();\n }\n\n /**\n * Manually resizes the iframe to fit the contents of the iframe\n * @deprecated This method will be removed in future releases.\n */\n @Method()\n async resize(): Promise<void> {\n console.warn(\n `The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`,\n );\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.resize();\n }\n\n render() {\n return (\n <justifi-payment-method-form\n ref={el => {\n if (el) {\n this.childRef = el;\n }\n }}\n iframe-origin={this.iframeOrigin}\n payment-method-form-type=\"card\"\n single-line={this.singleLine}\n payment-method-form-ready={this.cardFormReady}\n payment-method-form-tokenize={this.cardFormTokenize}\n payment-method-form-validation-mode={this.validationMode || 'onSubmit'}\n />\n );\n }\n}\n"]}
|
|
@@ -10,9 +10,17 @@ export default {
|
|
|
10
10
|
category: 'props',
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
|
+
'resize': {
|
|
14
|
+
description: 'Deprecated: This method will be removed in future releases.',
|
|
15
|
+
table: {
|
|
16
|
+
category: 'methods',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
13
19
|
},
|
|
14
20
|
decorators: [
|
|
15
21
|
story => `
|
|
22
|
+
<!-- Deprecated Notice -->
|
|
23
|
+
<p style="color: red; font-family: 'Roboto Mono', monospace;">Note: The 'resize' method is deprecated and will be removed in future releases.</p>
|
|
16
24
|
${story()}
|
|
17
25
|
<script>${addEvents()}</script>
|
|
18
26
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-form.stories.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.stories.ts"],"names":[],"mappings":"AAOA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAErD,eAAe;EACb,KAAK,EAAE,qBAAqB;EAC5B,SAAS,EAAE,mBAAmB;EAC9B,QAAQ,EAAE;IACR,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC7B,QAAQ,EAAE,OAAO;OAClB;KACF;GACF;EACD,UAAU,EAAE;IACV,KAAK,CAAC,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"card-form.stories.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.stories.ts"],"names":[],"mappings":"AAOA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAErD,eAAe;EACb,KAAK,EAAE,qBAAqB;EAC5B,SAAS,EAAE,mBAAmB;EAC9B,QAAQ,EAAE;IACR,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC7B,QAAQ,EAAE,OAAO;OAClB;KACF;IACD,QAAQ,EAAE;MACR,WAAW,EAAE,6DAA6D;MAC1E,KAAK,EAAE;QACL,QAAQ,EAAE,SAAS;OACpB;KACF;GACF;EACD,UAAU,EAAE;IACV,KAAK,CAAC,EAAE,CAAC;;;QAGL,KAAK,EAAE;gBACC,SAAS,EAAE;KACtB;GACF;CACF,CAAC;AAEF,MAAM,mBAAmB,GAAG,KAAK,EAAE,QAAoC,EAAE,EAAE;EACzE,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,CAAC;EACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC,CAAC;AACF,MAAM,mBAAmB,GAAG,KAAK,EAAE,QAAoC,EAAE,iBAAiB,EAAE,EAAE;EAC5F,MAAM,gBAAgB,GAAG,MAAM,QAAQ,CAAC,QAAQ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AAQ,GAAG,CAAC,IAAuB,EAAE,EAAE;EAC3C,MAAM,cAAc,GAAG,IAAI,CAAC;EAE5B,OAAO;;;;UAIC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;;;;;2BAKV,IAAI,CAAC,iBAAiB,CAAC,IAAI,UAAU;yBACvC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;uBAC7B,IAAI,CAAC,aAAa,CAAC;;;MAGpC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;GACpC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;EACX,iBAAiB,EAAE,UAAU;EAC7B,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;EAChB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG;EACZ,aAAa,EAAE,KAAK;EACpB,eAAe,EAAE,eAAe;CACjC,CAAC","sourcesContent":["interface CardFormStoryArgs {\n 'iframe-origin': string;\n 'single-line': boolean;\n 'validation-mode': string;\n 'css-variables': string;\n}\n\nconst isDev = process.env.NODE_ENV === 'development';\n\nexport default {\n title: 'Components/CardForm',\n component: 'justifi-card-form',\n argTypes: {\n 'iframe-origin': {\n control: 'text',\n table: {\n disable: isDev ? false : true,\n category: 'props',\n },\n },\n 'resize': {\n description: 'Deprecated: This method will be removed in future releases.',\n table: {\n category: 'methods',\n },\n },\n },\n decorators: [\n story => `\n <!-- Deprecated Notice -->\n <p style=\"color: red; font-family: 'Roboto Mono', monospace;\">Note: The 'resize' method is deprecated and will be removed in future releases.</p>\n ${story()}\n <script>${addEvents()}</script>\n `,\n ],\n};\n\nconst handleValidateClick = async (cardForm: HTMLJustifiCardFormElement) => {\n const valid = await cardForm.validate();\n console.log(valid);\n};\nconst handleTokenizeClick = async (cardForm: HTMLJustifiCardFormElement, paymentMethodData) => {\n const tokenizeResponse = await cardForm.tokenize('CLIENT_ID', paymentMethodData);\n console.log(tokenizeResponse);\n};\nconst handleResizeClick = async (cardForm: HTMLJustifiCardFormElement) => {\n await cardForm.resize();\n};\nconst handleReady = () => {\n console.log('card form is ready');\n const cardForm = document.querySelector('justifi-card-form') as HTMLJustifiCardFormElement;\n const validateBtn = document.querySelector('#validate-btn');\n const tokenizeBtn = document.querySelector('#tokenize-btn');\n const resizeBtn = document.querySelector('#resize-btn');\n validateBtn?.addEventListener('click', () => {\n handleValidateClick(cardForm);\n });\n tokenizeBtn?.addEventListener('click', () => {\n handleTokenizeClick(cardForm, {});\n });\n resizeBtn?.addEventListener('click', () => {\n handleResizeClick(cardForm);\n });\n};\n\nconst addEvents = () => {\n addEventListener('cardFormReady', handleReady);\n};\n\nconst FormButtons = `\n <style>\n .button-bar {\n display: flex;\n aligin-items: center;\n padding: 10px;\n }\n .button-bar button {\n margin-right: 10px;\n border-radius: 3px;\n border: 1px solid black;\n }\n </style>\n <div class=\"button-bar\">\n <button id=\"validate-btn\">Validate</button>\n <button id=\"tokenize-btn\">Tokenize</button>\n <button id=\"resize-btn\">Resize</button>\n </div>`;\n\nconst Template = (args: CardFormStoryArgs) => {\n const includeButtons = true;\n\n return `\n <div>\n <style>\n :root {\n ${args['css-variables'] || ''}\n }\n </style>\n <justifi-card-form\n data-testid=\"card-form-iframe\"\n validation-mode='${args['validation-mode'] || 'onSubmit'}'\n iframe-origin='${args['iframe-origin'] || ''}'\n single-line='${args['single-line']}'\n />\n </div>\n ${includeButtons ? FormButtons : ''}\n `;\n};\n\nexport const Basic = Template.bind({});\nBasic.args = {\n 'validation-mode': 'onSubmit',\n 'single-line': false,\n};\n\nexport const SingleLine = Template.bind({});\nSingleLine.args = {\n 'single-line': true,\n};\n\nconst styledVariables = `\n --jfi-load-google-font: 'Inter:wght@200;400;700;900&family=Agdasima';\n --jfi-layout-font-family: Agdasima;\n --jfi-layout-padding: 4px;\n --jfi-layout-form-control-spacing-x: .5rem;\n --jfi-layout-form-control-spacing-y: 1rem;\n --jfi-form-label-font-weight: 100;\n --jfi-form-label-font-family: Inter;\n --jfi-form-label-margin: 0 0 .5rem 0;\n --jfi-form-control-background-color: #F4F4F6;\n --jfi-form-control-background-color-hover: #EEEEF5;\n --jfi-form-control-border-color: rgba(0, 0, 0, 0.42);\n --jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);\n --jfi-form-control-border-color-focus: #fccc32;\n --jfi-form-control-border-color-error: #C12727;\n --jfi-form-control-border-top-width: 0;\n --jfi-form-control-border-left-width: 0;\n --jfi-form-control-border-bottom-width: 1px;\n --jfi-form-control-border-right-width: 0;\n --jfi-form-control-border-radius: 4px 4px 0 0;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n --jfi-form-control-box-shadow-focus: none;\n --jfi-form-control-box-shadow-error-focus: none;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-color: #212529;\n --jfi-form-control-font-size: 1rem;\n --jfi-form-control-font-weight: 400;\n --jfi-form-control-line-height: 2;\n --jfi-form-control-margin: 0;\n --jfi-form-control-padding: .5rem .875rem;\n --jfi-error-message-color: #C12727;\n --jfi-error-message-margin: .25rem 0 0 0;\n --jfi-error-message-font-size: .875rem;\n`;\n\nexport const Styled = Template.bind({});\nStyled.args = {\n 'single-line': false,\n 'css-variables': styledVariables,\n};\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title: '
|
|
2
|
+
title: 'Pre-release Components/PaymentDetails',
|
|
3
3
|
component: 'justifi-payment-details',
|
|
4
4
|
parameters: {},
|
|
5
5
|
};
|
|
6
6
|
class PaymentDetailsArgs {
|
|
7
7
|
constructor(args) {
|
|
8
|
-
this['auth-token'] = args['auth-token'] || '';
|
|
9
|
-
this['payment-id'] = args['payment-id'] || '';
|
|
8
|
+
this['auth-token'] = args['auth-token'] || 'eyJraWQiOiJqdXN0aWZpLWUyNDgyMmU3ODE1MmEzZjRkMjU1IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2F1dGguanVzdGlmaS5haS8iLCJhenAiOiJvYXNfMkJMRHpaOHF6dDZndnNvQkxBZnFCbyIsInN1YiI6Im9hc18yQkxEelo4cXp0Nmd2c29CTEFmcUJvQHNlc3Npb25zIiwiYXVkIjoiaHR0cHM6Ly9hcGkuanVzdGlmaS5haS92MSIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsInBlcm1pc3Npb25zIjpbeyJyb2xlIjoicmVhZDphY2NvdW50IiwicmVzb3VyY2VfaWQiOiJhY2NfMUdCS1Mycmc3bUxsMnIzRHM0TlBQWSJ9XSwiZXhwIjoxNzAwNDExOTYyLCJpYXQiOjE2OTc4MTk5NjIsInBsYXRmb3JtX2FjY291bnRfaWQiOiJhY2NfN2NWbmc3ZXNDdmZIZXZXUUxTd2xuayJ9.Xcafn_lBJAPoZf36CITUyENHuIQLgDCXTpkos2ZIufr8tqXN1jVb5_vmd4OYYuxQjfgAjPiQ5KF_-Zn14NsELihth-fAHagOeyFQ4hQNezULOy7oVhf7BpsUMPlMPcIM3beomTY--xqULxeSbTTo9Kt-Pu9sPIARb2wT7WpPlw1Xskm9jHjVRgM_QPxMxaqGa6YFXfivQpdWxCz4H9eD6eijUV2DIOvzkZ8UTRTul6AzIeIXFItynfjXeetrzBihBeirVOWMxlfIgOYNUeGo_IgnriHdyratxF1o3JZQb-mZS5AS-YYIYENm41I9sY6t7slAza3IhwZ400t6_lceww';
|
|
9
|
+
this['payment-id'] = args['payment-id'] || 'py_76nDkjHlXOEFQue5o3tzMj';
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
const Template = (args) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-details.stories.js","sourceRoot":"","sources":["../../../../src/components/payment-details/payment-details.stories.ts"],"names":[],"mappings":"AAAA,eAAe;EACb,KAAK,EAAE
|
|
1
|
+
{"version":3,"file":"payment-details.stories.js","sourceRoot":"","sources":["../../../../src/components/payment-details/payment-details.stories.ts"],"names":[],"mappings":"AAAA,eAAe;EACb,KAAK,EAAE,uCAAuC;EAC9C,SAAS,EAAE,yBAAyB;EACpC,UAAU,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,kBAAkB;EAItB,YAAY,IAAI;IACd,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,w3BAAw3B,CAAC;IACp6B,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,2BAA2B,CAAC;EACzE,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,CAAC,IAAwB,EAAE,EAAE;EAC5C,OAAO,CAAC;;;oBAGU,IAAI,CAAC,YAAY,CAAC;oBAClB,IAAI,CAAC,YAAY,CAAC;;GAEnC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG,IAAI,kBAAkB,CAAC,EAAE,CAAC,CAAC;AAExC,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG,IAAI,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACzC,MAAM,CAAC,UAAU,GAAG;EAClB,CAAC,KAAK,EAAE,EAAE,CAAC;MACP,KAAK,EAAE;;;;;;;;;;;;;;;;;;GAkBV;CACF,CAAA","sourcesContent":["export default {\n title: 'Pre-release Components/PaymentDetails',\n component: 'justifi-payment-details',\n parameters: {},\n};\n\nclass PaymentDetailsArgs {\n 'auth-token': string;\n 'payment-id': string;\n\n constructor(args) {\n this['auth-token'] = args['auth-token'] || 'eyJraWQiOiJqdXN0aWZpLWUyNDgyMmU3ODE1MmEzZjRkMjU1IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2F1dGguanVzdGlmaS5haS8iLCJhenAiOiJvYXNfMkJMRHpaOHF6dDZndnNvQkxBZnFCbyIsInN1YiI6Im9hc18yQkxEelo4cXp0Nmd2c29CTEFmcUJvQHNlc3Npb25zIiwiYXVkIjoiaHR0cHM6Ly9hcGkuanVzdGlmaS5haS92MSIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyIsInBlcm1pc3Npb25zIjpbeyJyb2xlIjoicmVhZDphY2NvdW50IiwicmVzb3VyY2VfaWQiOiJhY2NfMUdCS1Mycmc3bUxsMnIzRHM0TlBQWSJ9XSwiZXhwIjoxNzAwNDExOTYyLCJpYXQiOjE2OTc4MTk5NjIsInBsYXRmb3JtX2FjY291bnRfaWQiOiJhY2NfN2NWbmc3ZXNDdmZIZXZXUUxTd2xuayJ9.Xcafn_lBJAPoZf36CITUyENHuIQLgDCXTpkos2ZIufr8tqXN1jVb5_vmd4OYYuxQjfgAjPiQ5KF_-Zn14NsELihth-fAHagOeyFQ4hQNezULOy7oVhf7BpsUMPlMPcIM3beomTY--xqULxeSbTTo9Kt-Pu9sPIARb2wT7WpPlw1Xskm9jHjVRgM_QPxMxaqGa6YFXfivQpdWxCz4H9eD6eijUV2DIOvzkZ8UTRTul6AzIeIXFItynfjXeetrzBihBeirVOWMxlfIgOYNUeGo_IgnriHdyratxF1o3JZQb-mZS5AS-YYIYENm41I9sY6t7slAza3IhwZ400t6_lceww';\n this['payment-id'] = args['payment-id'] || 'py_76nDkjHlXOEFQue5o3tzMj';\n }\n}\n\nconst Template = (args: PaymentDetailsArgs) => {\n return (`\n <justifi-payment-details\n data-testid=\"justifi-payment-details\"\n auth-token=\"${args['auth-token']}\"\n payment-id=\"${args['payment-id']}\"\n />\n `);\n};\n\nexport const Basic = Template.bind({});\nBasic.args = new PaymentDetailsArgs({});\n\nexport const Styled = Template.bind({});\nStyled.args = new PaymentDetailsArgs({});\nStyled.decorators = [\n (Story) => `\n ${Story()}\n <style>\n justifi-payment-details::part(detail-head) {\n background-color: rgba(100, 200, 250, 0.2);\n border-left: 4px solid rgba(100, 200, 250, 1);\n }\n justifi-payment-details::part(detail-info-item-title),\n justifi-payment-details::part(detail-method-item-title) {\n border-radius: 3px;\n background-color: rgba(0, 0, 0, 0.8);\n text-align: center;\n padding: 0 10px;\n color: white !important;\n }\n justifi-payment-details::part(detail-metadata) {\n background-color: rgba(100,100,100,0.2)\n }\n </style>\n `\n]\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import iFrameResize from "iframe-resizer/js/iframeResizer";
|
|
2
3
|
import { MessageEventType } from "./message-event-types";
|
|
3
4
|
import packageJson from "../../../package.json";
|
|
4
5
|
import getComputedTheme from "./get-computed-theme";
|
|
@@ -9,7 +10,6 @@ export class PaymentMethodForm {
|
|
|
9
10
|
this.paymentMethodFormValidationMode = undefined;
|
|
10
11
|
this.iframeOrigin = undefined;
|
|
11
12
|
this.singleLine = undefined;
|
|
12
|
-
this.height = 55;
|
|
13
13
|
}
|
|
14
14
|
connectedCallback() {
|
|
15
15
|
window.addEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
@@ -17,10 +17,6 @@ export class PaymentMethodForm {
|
|
|
17
17
|
disconnectedCallback() {
|
|
18
18
|
window.removeEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
19
19
|
}
|
|
20
|
-
componentShouldUpdate() {
|
|
21
|
-
this.sendStyleOverrides();
|
|
22
|
-
this.resize();
|
|
23
|
-
}
|
|
24
20
|
sendStyleOverrides() {
|
|
25
21
|
if (this.computedTheme) {
|
|
26
22
|
this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.computedTheme });
|
|
@@ -33,14 +29,14 @@ export class PaymentMethodForm {
|
|
|
33
29
|
if (messageType === MessageEventType[this.paymentMethodFormType].ready) {
|
|
34
30
|
this.paymentMethodFormReady.emit(messageData);
|
|
35
31
|
}
|
|
36
|
-
if (messageType === MessageEventType[this.paymentMethodFormType].resize) {
|
|
37
|
-
this.height = messageData.height;
|
|
38
|
-
}
|
|
39
32
|
}
|
|
40
33
|
postMessage(eventType, payload) {
|
|
41
34
|
var _a, _b;
|
|
42
35
|
(_b = (_a = this.iframeElement) === null || _a === void 0 ? void 0 : _a.contentWindow) === null || _b === void 0 ? void 0 : _b.postMessage(Object.assign({ eventType: eventType }, payload), this.iframeOrigin || process.env.IFRAME_ORIGIN || '*');
|
|
43
36
|
}
|
|
37
|
+
async resize() {
|
|
38
|
+
this.postMessage(MessageEventType[this.paymentMethodFormType].resize);
|
|
39
|
+
}
|
|
44
40
|
async postMessageWithResponseListener(eventType, payload) {
|
|
45
41
|
return new Promise(resolve => {
|
|
46
42
|
const responseListener = (event) => {
|
|
@@ -66,9 +62,6 @@ export class PaymentMethodForm {
|
|
|
66
62
|
async validate() {
|
|
67
63
|
return this.postMessageWithResponseListener(MessageEventType[this.paymentMethodFormType].validate);
|
|
68
64
|
}
|
|
69
|
-
async resize() {
|
|
70
|
-
this.postMessage(MessageEventType[this.paymentMethodFormType].resize);
|
|
71
|
-
}
|
|
72
65
|
composeQueryParams(values) {
|
|
73
66
|
const queryParams = values.map(value => {
|
|
74
67
|
if (value === values[0]) {
|
|
@@ -93,9 +86,11 @@ export class PaymentMethodForm {
|
|
|
93
86
|
return iframeSrc.concat(this.composeQueryParams(paramsList));
|
|
94
87
|
}
|
|
95
88
|
render() {
|
|
96
|
-
return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: el =>
|
|
89
|
+
return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: el => {
|
|
90
|
+
this.iframeElement = el;
|
|
91
|
+
}, onLoad: () => {
|
|
92
|
+
iFrameResize({ log: true }, this.iframeElement);
|
|
97
93
|
this.sendStyleOverrides();
|
|
98
|
-
this.resize();
|
|
99
94
|
} })));
|
|
100
95
|
}
|
|
101
96
|
static get is() { return "justifi-payment-method-form"; }
|
|
@@ -181,11 +176,6 @@ export class PaymentMethodForm {
|
|
|
181
176
|
}
|
|
182
177
|
};
|
|
183
178
|
}
|
|
184
|
-
static get states() {
|
|
185
|
-
return {
|
|
186
|
-
"height": {}
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
179
|
static get events() {
|
|
190
180
|
return [{
|
|
191
181
|
"method": "paymentMethodFormReady",
|
|
@@ -221,6 +211,23 @@ export class PaymentMethodForm {
|
|
|
221
211
|
}
|
|
222
212
|
static get methods() {
|
|
223
213
|
return {
|
|
214
|
+
"resize": {
|
|
215
|
+
"complexType": {
|
|
216
|
+
"signature": "() => Promise<any>",
|
|
217
|
+
"parameters": [],
|
|
218
|
+
"references": {
|
|
219
|
+
"Promise": {
|
|
220
|
+
"location": "global",
|
|
221
|
+
"id": "global::Promise"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"return": "Promise<any>"
|
|
225
|
+
},
|
|
226
|
+
"docs": {
|
|
227
|
+
"text": "",
|
|
228
|
+
"tags": []
|
|
229
|
+
}
|
|
230
|
+
},
|
|
224
231
|
"tokenize": {
|
|
225
232
|
"complexType": {
|
|
226
233
|
"signature": "(clientId: string, paymentMethodMetadata: any, account?: string) => Promise<CreatePaymentMethodResponse>",
|
|
@@ -268,23 +275,6 @@ export class PaymentMethodForm {
|
|
|
268
275
|
"text": "",
|
|
269
276
|
"tags": []
|
|
270
277
|
}
|
|
271
|
-
},
|
|
272
|
-
"resize": {
|
|
273
|
-
"complexType": {
|
|
274
|
-
"signature": "() => Promise<any>",
|
|
275
|
-
"parameters": [],
|
|
276
|
-
"references": {
|
|
277
|
-
"Promise": {
|
|
278
|
-
"location": "global",
|
|
279
|
-
"id": "global::Promise"
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
"return": "Promise<any>"
|
|
283
|
-
},
|
|
284
|
-
"docs": {
|
|
285
|
-
"text": "",
|
|
286
|
-
"tags": []
|
|
287
|
-
}
|
|
288
278
|
}
|
|
289
279
|
};
|
|
290
280
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-method-form.js","sourceRoot":"","sources":["../../../../src/components/payment-method-form/payment-method-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"payment-method-form.js","sourceRoot":"","sources":["../../../../src/components/payment-method-form/payment-method-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,YAAY,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAQpD,MAAM,OAAO,iBAAiB;;IAWpB,kBAAa,GAAU,gBAAgB,EAAE,CAAC;;;;;;EAIlD,iBAAiB;IACf,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;EAC3E,CAAC;EAED,oBAAoB;IAClB,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,oB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OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,0BAA0B,CAAC;IAClG,IAAI,SAAS,GAAG,GAAG,YAAY,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAChE,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,IAAI,CAAC,+BAA+B,EAAE;MACxC,UAAU,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,+BAA+B,EAAE,CAAC,CAAC;KAC3E;IACD,IAAI,IAAI,CAAC,UAAU,EAAE;MACnB,UAAU,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;KAClD;IAED,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;EAC/D,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,cACE,EAAE,EAAE,+BAA+B,IAAI,CAAC,qBAAqB,EAAE,EAC/D,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,EACxB,GAAG,EAAE,EAAE,CAAC,EAAE;UACR,IAAI,CAAC,aAAa,GAAG,EAAuB,CAAC;QAC/C,CAAC,EACD,MAAM,EAAE,GAAG,EAAE;UACX,YAAY,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;UAChD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC5B,CAAC,GACO,CACL,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Host, Prop, h, EventEmitter, Method } from '@stencil/core';\nimport iFrameResize from 'iframe-resizer/js/iframeResizer';\nimport { MessageEventType } from './message-event-types';\nimport { Theme } from './theme';\nimport packageJson from '../../../package.json';\nimport getComputedTheme from './get-computed-theme';\nimport { CreatePaymentMethodResponse } from './payment-method-responses';\n\n@Component({\n tag: 'justifi-payment-method-form',\n styleUrl: 'payment-method-form.css',\n shadow: false,\n})\nexport class PaymentMethodForm {\n @Prop() paymentMethodFormType: 'card' | 'bankAccount';\n @Prop({\n mutable: true,\n })\n paymentMethodFormValidationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n @Prop() iframeOrigin?: string;\n @Prop() singleLine: boolean;\n @Event({ bubbles: true }) paymentMethodFormReady: EventEmitter;\n @Event({ bubbles: true }) paymentMethodFormTokenize: EventEmitter<{ data: any }>;\n\n private computedTheme: Theme = getComputedTheme();\n\n iframeElement!: HTMLIFrameElement;\n\n connectedCallback() {\n window.addEventListener('message', this.dispatchMessageEvent.bind(this));\n }\n\n disconnectedCallback() {\n window.removeEventListener('message', this.dispatchMessageEvent.bind(this));\n }\n\n sendStyleOverrides() {\n if (this.computedTheme) {\n this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.computedTheme });\n }\n }\n\n private dispatchMessageEvent(messageEvent: MessageEvent) {\n const messagePayload = messageEvent.data;\n const messageType = messagePayload.eventType;\n const messageData = messagePayload.data;\n\n if (messageType === MessageEventType[this.paymentMethodFormType].ready) {\n this.paymentMethodFormReady.emit(messageData);\n }\n }\n\n private postMessage(eventType: string, payload?: any) {\n this.iframeElement?.contentWindow?.postMessage({ eventType: eventType, ...payload }, this.iframeOrigin || process.env.IFRAME_ORIGIN || '*');\n }\n\n @Method()\n async resize(): Promise<any> {\n this.postMessage(MessageEventType[this.paymentMethodFormType].resize);\n }\n\n private async postMessageWithResponseListener(eventType: string, payload?: any): Promise<any> {\n return new Promise(resolve => {\n const responseListener = (event: MessageEvent) => {\n if (event.data.eventType !== eventType) return;\n window.removeEventListener('message', responseListener);\n resolve(event.data.data);\n };\n window.addEventListener('message', responseListener);\n this.postMessage(eventType, payload);\n });\n }\n\n @Method()\n async tokenize(clientId: string, paymentMethodMetadata: any, account?: string): Promise<CreatePaymentMethodResponse> {\n const eventType = MessageEventType[this.paymentMethodFormType].tokenize;\n const payload = {\n clientId: clientId,\n componentVersion: packageJson.version,\n paymentMethodMetadata: paymentMethodMetadata,\n account: account,\n };\n\n return this.postMessageWithResponseListener(eventType, payload);\n }\n\n @Method()\n async validate(): Promise<any> {\n return this.postMessageWithResponseListener(MessageEventType[this.paymentMethodFormType].validate);\n }\n\n private composeQueryParams(values: string[]) {\n const queryParams = values.map(value => {\n if (value === values[0]) {\n return (value = `?${value}`);\n } else {\n return (value = `&${value}`);\n }\n });\n return queryParams.join('');\n }\n\n private getIframeSrc() {\n const iframeOrigin = this.iframeOrigin || process.env.IFRAME_ORIGIN || 'https://js.justifi.ai/v2';\n let iframeSrc = `${iframeOrigin}/${this.paymentMethodFormType}`;\n let paramsList = [];\n if (this.paymentMethodFormValidationMode) {\n paramsList.push(`validationMode=${this.paymentMethodFormValidationMode}`);\n }\n if (this.singleLine) {\n paramsList.push(`singleLine=${this.singleLine}`);\n }\n\n return iframeSrc.concat(this.composeQueryParams(paramsList));\n }\n\n render() {\n return (\n <Host>\n <iframe\n id={`justifi-payment-method-form-${this.paymentMethodFormType}`}\n src={this.getIframeSrc()}\n ref={el => {\n this.iframeElement = el as HTMLIFrameElement;\n }}\n onLoad={() => {\n iFrameResize({ log: true }, this.iframeElement);\n this.sendStyleOverrides();\n }}\n ></iframe>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
9
9
|
});
|
|
10
10
|
expect(page.root).toEqualHtml(`
|
|
11
11
|
<justifi-payment-method-form>
|
|
12
|
-
<iframe
|
|
12
|
+
<iframe id="justifi-payment-method-form-card" src="https://js.justifi.ai/v2/card"></iframe>
|
|
13
13
|
</justifi-payment-method-form>
|
|
14
14
|
`);
|
|
15
15
|
});
|
|
@@ -20,7 +20,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
20
20
|
});
|
|
21
21
|
expect(page.root).toEqualHtml(`
|
|
22
22
|
<justifi-payment-method-form>
|
|
23
|
-
<iframe
|
|
23
|
+
<iframe id="justifi-payment-method-form-card" src="https://js.justifi.ai/v2/card"></iframe>
|
|
24
24
|
</justifi-payment-method-form>
|
|
25
25
|
`);
|
|
26
26
|
});
|
|
@@ -31,7 +31,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
31
31
|
});
|
|
32
32
|
expect(page.root).toEqualHtml(`
|
|
33
33
|
<justifi-payment-method-form>
|
|
34
|
-
<iframe
|
|
34
|
+
<iframe id="justifi-payment-method-form-bankAccount" src="https://js.justifi.ai/v2/bankAccount"></iframe>
|
|
35
35
|
</justifi-payment-method-form>
|
|
36
36
|
`);
|
|
37
37
|
});
|
|
@@ -42,7 +42,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
42
42
|
});
|
|
43
43
|
expect(page.root).toEqualHtml(`
|
|
44
44
|
<justifi-payment-method-form>
|
|
45
|
-
<iframe
|
|
45
|
+
<iframe id="justifi-payment-method-form-bankAccount" src="https://js.justifi.ai/v2/bankAccount?validationMode=onChange"></iframe>
|
|
46
46
|
</justifi-payment-method-form>
|
|
47
47
|
`);
|
|
48
48
|
});
|
|
@@ -53,7 +53,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
53
53
|
});
|
|
54
54
|
expect(page.root).toEqualHtml(`
|
|
55
55
|
<justifi-payment-method-form>
|
|
56
|
-
<iframe
|
|
56
|
+
<iframe id="justifi-payment-method-form-bankAccount" src="https://js.justifi.ai/v2/bankAccount?validationMode=onBlur"></iframe>
|
|
57
57
|
</justifi-payment-method-form>
|
|
58
58
|
`);
|
|
59
59
|
});
|
|
@@ -64,7 +64,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
64
64
|
});
|
|
65
65
|
expect(page.root).toEqualHtml(`
|
|
66
66
|
<justifi-payment-method-form>
|
|
67
|
-
<iframe
|
|
67
|
+
<iframe id="justifi-payment-method-form-card" src="https://js.justifi.ai/v2/card"></iframe>
|
|
68
68
|
</justifi-payment-method-form>
|
|
69
69
|
`);
|
|
70
70
|
});
|
|
@@ -75,7 +75,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
75
75
|
});
|
|
76
76
|
expect(page.root).toEqualHtml(`
|
|
77
77
|
<justifi-payment-method-form>
|
|
78
|
-
<iframe
|
|
78
|
+
<iframe id="justifi-payment-method-form-card" src="https://js.justifi.ai/v2/card?singleLine=true"></iframe>
|
|
79
79
|
</justifi-payment-method-form>
|
|
80
80
|
`);
|
|
81
81
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-method-form.spec.js","sourceRoot":"","sources":["../../../../../src/components/payment-method-form/test/payment-method-form.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;EAC3C,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;IACjC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,mCAA6B,qBAAqB,EAAC,MAAM,GAA+B;KACzG,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;GAI/B,CAAC,CAAC;EACH,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;IACxE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,mCAA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E,KAAK,IAAI,EAAE;IAClH,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,mCAA6B,qBAAqB,EAAC,MAAM,EAAC,YAAY,EAAC,0BAA0B,GAA+B;KACjJ,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;KAI7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,gGAAgG,EAAE,KAAK,IAAI,EAAE;IAC9G,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,mCAA6B,qBAAqB,EAAC,MAAM,EAAC,UAAU,EAAE,IAAI,GAAgC;KAC3H,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;KAI7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { PaymentMethodForm } from '../payment-method-form';\n\ndescribe('justifi-payment-method-form', () => {\n it('renders an iframe', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\"></justifi-payment-method-form>,\n });\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe
|
|
1
|
+
{"version":3,"file":"payment-method-form.spec.js","sourceRoot":"","sources":["../../../../../src/components/payment-method-form/test/payment-method-form.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CA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AAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { PaymentMethodForm } from '../payment-method-form';\n\ndescribe('justifi-payment-method-form', () => {\n it('renders an iframe', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\"></justifi-payment-method-form>,\n });\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-card\" src=\"https://js.justifi.ai/v2/card\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe when paymentMethodFormType is card', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\"></justifi-payment-method-form>,\n });\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-card\" src=\"https://js.justifi.ai/v2/card\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a bank iframe when paymentMethodFormType is bank', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"bankAccount\"></justifi-payment-method-form>,\n });\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-bankAccount\" src=\"https://js.justifi.ai/v2/bankAccount\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe with validationMode when paymentMethodFormType is card and paymentMethodFormValidationMode is set', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"bankAccount\" paymentMethodFormValidationMode=\"onChange\"></justifi-payment-method-form>,\n });\n\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-bankAccount\" src=\"https://js.justifi.ai/v2/bankAccount?validationMode=onChange\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe with validationMode when paymentMethodFormType is card and paymentMethodFormValidationMode is set', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"bankAccount\" paymentMethodFormValidationMode=\"onBlur\"></justifi-payment-method-form>,\n });\n\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-bankAccount\" src=\"https://js.justifi.ai/v2/bankAccount?validationMode=onBlur\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe with iframeOrigin when paymentMethodFormType is card and iframeOrigin is set', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\" iframeOrigin=\"https://js.justifi.ai/v2\"></justifi-payment-method-form>,\n });\n\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-card\" src=\"https://js.justifi.ai/v2/card\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe with singleLine when paymentMethodFormType is card and singleLine is set', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\" singleLine={true}></justifi-payment-method-form>,\n });\n\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-card\" src=\"https://js.justifi.ai/v2/card?singleLine=true\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n});\n"]}
|