@bemony/payment-form-react 0.1.11 → 0.1.12

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/README.md CHANGED
@@ -61,3 +61,7 @@ or a public environment variable.
61
61
  Pass the optional `riskCollectors` returned with the CheckoutSession directly to the component or
62
62
  provider. The adapter forwards it only during mounting; it does not remount the secure iframe for
63
63
  ordinary React state changes.
64
+
65
+ The adapter compares `appearance` and `riskCollectors` by value rather than object identity. It
66
+ therefore preserves the mounted iframe when a parent React render recreates equivalent objects. A
67
+ real change to either configuration, or to `clientSecret`, intentionally starts a new mount.
@@ -1 +1 @@
1
- {"version":3,"file":"payment-form.d.ts","sourceRoot":"","sources":["../../src/components/payment-form.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1C,QAAQ,IAAI,gBAAgB,CAAC;IAC7B,OAAO,IAAI,IAAI,CAAC;CACjB,CAAC,CAAC;AAEH,KAAK,UAAU,GAAG,oBAAoB,GACpC,QAAQ,CAAC;IACP,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,OAAO,CAAC,EAAE,QAAQ,CAAC;QAAE,YAAY,CAAC,EAAE,mBAAmB,CAAA;KAAE,CAAC,CAAC;IAC3D,iBAAiB,CA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= forwardRef(function BemonyPaymentForm(props, re
39
39
  const stateRef = useRef(mountingState);
40
40
  const latestConfig = useRef(config);
41
41
  latestConfig.current = config;
42
+ // Parent components often recreate appearance/collector objects inline.
43
+ // Reference-only dependencies would unnecessarily reload the secure iframe
44
+ // on ordinary React state changes. Remount only on semantic changes.
45
+ const appearanceSignature = stableSignature(config.appearance);
46
+ const riskCollectorsSignature = stableSignature(config.riskCollectors);
42
47
  useImperativeHandle(ref, () => ({
43
48
  pay(input) {
44
49
  return instanceRef.current?.pay(input) ?? Promise.reject(notReady());
@@ -111,6 +116,10 @@ export const BemonyPaymentForm = forwardRef(function BemonyPaymentForm(props, re
111
116
  return;
112
117
  latestConfig.current.onError?.(error);
113
118
  publish({ ...stateRef.current, isSubmitting: false, error });
119
+ },
120
+ onEvent(event) {
121
+ if (!disposed)
122
+ latestConfig.current.onEvent?.(event);
114
123
  }
115
124
  });
116
125
  if (disposed) {
@@ -150,7 +159,8 @@ export const BemonyPaymentForm = forwardRef(function BemonyPaymentForm(props, re
150
159
  }, [
151
160
  config.clientSecret,
152
161
  config.threeDS?.presentation,
153
- config.appearance,
162
+ appearanceSignature,
163
+ riskCollectorsSignature,
154
164
  register,
155
165
  setProviderState
156
166
  ]);
@@ -172,7 +182,58 @@ function mountError(error) {
172
182
  'message' in error &&
173
183
  typeof error.code === 'string' &&
174
184
  typeof error.message === 'string') {
175
- return { code: error.code, message: error.message };
185
+ const details = error;
186
+ return {
187
+ code: error.code,
188
+ message: error.message,
189
+ ...(isErrorCategory(details.category) ? { category: details.category } : {}),
190
+ ...(isErrorStage(details.stage) ? { stage: details.stage } : {})
191
+ };
176
192
  }
177
- return { code: 'MOUNT_FAILED', message: 'Não foi possível montar o formulário de pagamento.' };
193
+ return {
194
+ code: 'MOUNT_FAILED',
195
+ message: 'Não foi possível montar o formulário de pagamento.',
196
+ category: 'FRAME',
197
+ stage: 'FORM_SDK'
198
+ };
199
+ }
200
+ function stableSignature(value) {
201
+ if (value === undefined)
202
+ return '';
203
+ return JSON.stringify(value, (_key, item) => {
204
+ if (item !== null && typeof item === 'object' && !Array.isArray(item)) {
205
+ return Object.fromEntries(Object.entries(item).sort(([left], [right]) => left.localeCompare(right)));
206
+ }
207
+ return item;
208
+ });
209
+ }
210
+ function isErrorCategory(value) {
211
+ return (typeof value === 'string' &&
212
+ [
213
+ 'VALIDATION',
214
+ 'CONFIGURATION',
215
+ 'LIFECYCLE',
216
+ 'FRAME',
217
+ 'TOKENIZATION',
218
+ 'THREE_DS',
219
+ 'PAYMENT',
220
+ 'RUNTIME',
221
+ 'UNKNOWN'
222
+ ].includes(value));
223
+ }
224
+ function isErrorStage(value) {
225
+ return (typeof value === 'string' &&
226
+ [
227
+ 'FORM_SDK',
228
+ 'FORM_IFRAME_NAVIGATION',
229
+ 'FORM_HANDSHAKE',
230
+ 'CARD_FRAME_DOCUMENT',
231
+ 'CARD_FRAME_HANDSHAKE',
232
+ 'CARD_FRAME_INITIALIZATION',
233
+ 'CARD_TOKENIZATION',
234
+ 'THREE_DS',
235
+ 'PAYMENT_SUBMISSION',
236
+ 'PAYMENT_RECONCILIATION',
237
+ 'RUNTIME'
238
+ ].includes(value));
178
239
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { BemonyPaymentForm, BemonyPaymentFormProvider, useBemonyPaymentForm } from './components/payment-form';
2
2
  export type { BemonyPaymentFormProps, BemonyPaymentFormProviderProps, BemonyPaymentFormRef } from './components/payment-form';
3
- export type { PayInput, PayOutcome, PaymentFormAppearance, PaymentFormError, PaymentFormErrorAttempt, PaymentFormErrorPayment, PaymentFormState, PaymentFormStatus, RiskCollector, ThreeDSPresentation } from '@bemony/payment-form';
3
+ export type { PayInput, PayOutcome, PaymentFormAppearance, PaymentFormError, PaymentFormErrorAttempt, PaymentFormEvent, PaymentFormErrorPayment, PaymentFormState, PaymentFormStatus, RiskCollector, ThreeDSPresentation } from '@bemony/payment-form';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,sBAAsB,EACtB,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACpB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,sBAAsB,EACtB,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACpB,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -49,6 +49,8 @@ var BemonyPaymentForm = forwardRef(
49
49
  const stateRef = useRef(mountingState);
50
50
  const latestConfig = useRef(config);
51
51
  latestConfig.current = config;
52
+ const appearanceSignature = stableSignature(config.appearance);
53
+ const riskCollectorsSignature = stableSignature(config.riskCollectors);
52
54
  useImperativeHandle(
53
55
  ref,
54
56
  () => ({
@@ -117,6 +119,9 @@ var BemonyPaymentForm = forwardRef(
117
119
  if (disposed) return;
118
120
  latestConfig.current.onError?.(error);
119
121
  publish({ ...stateRef.current, isSubmitting: false, error });
122
+ },
123
+ onEvent(event) {
124
+ if (!disposed) latestConfig.current.onEvent?.(event);
120
125
  }
121
126
  });
122
127
  if (disposed) {
@@ -149,7 +154,8 @@ var BemonyPaymentForm = forwardRef(
149
154
  }, [
150
155
  config.clientSecret,
151
156
  config.threeDS?.presentation,
152
- config.appearance,
157
+ appearanceSignature,
158
+ riskCollectorsSignature,
153
159
  register,
154
160
  setProviderState
155
161
  ]);
@@ -167,9 +173,61 @@ function notReady() {
167
173
  }
168
174
  function mountError(error) {
169
175
  if (typeof error === "object" && error !== null && "code" in error && "message" in error && typeof error.code === "string" && typeof error.message === "string") {
170
- return { code: error.code, message: error.message };
176
+ const details = error;
177
+ return {
178
+ code: error.code,
179
+ message: error.message,
180
+ ...isErrorCategory(details.category) ? { category: details.category } : {},
181
+ ...isErrorStage(details.stage) ? { stage: details.stage } : {}
182
+ };
171
183
  }
172
- return { code: "MOUNT_FAILED", message: "N\xE3o foi poss\xEDvel montar o formul\xE1rio de pagamento." };
184
+ return {
185
+ code: "MOUNT_FAILED",
186
+ message: "N\xE3o foi poss\xEDvel montar o formul\xE1rio de pagamento.",
187
+ category: "FRAME",
188
+ stage: "FORM_SDK"
189
+ };
190
+ }
191
+ function stableSignature(value) {
192
+ if (value === void 0) return "";
193
+ return JSON.stringify(value, (_key, item) => {
194
+ if (item !== null && typeof item === "object" && !Array.isArray(item)) {
195
+ return Object.fromEntries(
196
+ Object.entries(item).sort(
197
+ ([left], [right]) => left.localeCompare(right)
198
+ )
199
+ );
200
+ }
201
+ return item;
202
+ });
203
+ }
204
+ function isErrorCategory(value) {
205
+ return typeof value === "string" && [
206
+ "VALIDATION",
207
+ "CONFIGURATION",
208
+ "LIFECYCLE",
209
+ "FRAME",
210
+ "TOKENIZATION",
211
+ "THREE_DS",
212
+ "PAYMENT",
213
+ "RUNTIME",
214
+ "UNKNOWN"
215
+ ].includes(value);
216
+ }
217
+ function isErrorStage(value) {
218
+ return typeof value === "string" && [
219
+ "FORM_SDK",
220
+ "FORM_IFRAME_NAVIGATION",
221
+ "FORM_HANDSHAKE",
222
+ "CARD_FRAME_DOCUMENT",
223
+ "CARD_FRAME_HANDSHAKE",
224
+ "CARD_FRAME_INITIALIZATION",
225
+ "CARD_TOKENIZATION",
226
+ "THREE_DS",
227
+ "PAYMENT_SUBMISSION",
228
+ "PAYMENT_RECONCILIATION",
229
+ "RUNTIME"
230
+ ].includes(value);
173
231
  }
174
232
  export {
175
233
  BemonyPaymentForm,
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/components/payment-form.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport {\n BemonyPaymentForm as WebPaymentForm,\n type CardState,\n type PayInput,\n type PayOutcome,\n type PaymentFormAppearance,\n type PaymentFormCallbacks,\n type PaymentFormError,\n type PaymentFormInstance,\n type PaymentFormState,\n type RiskCollector,\n type ThreeDSPresentation\n} from '@bemony/payment-form';\nimport {\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ReactNode\n} from 'react';\n\nexport type BemonyPaymentFormRef = Readonly<{\n pay(input: PayInput): Promise<PayOutcome>;\n getState(): PaymentFormState;\n destroy(): void;\n}>;\n\ntype FormConfig = PaymentFormCallbacks &\n Readonly<{\n clientSecret: string;\n riskCollectors?: readonly RiskCollector[];\n appearance?: PaymentFormAppearance;\n threeDS?: Readonly<{ presentation?: ThreeDSPresentation }>;\n onCardStateChange?: (state: CardState) => void;\n }>;\n\nexport type BemonyPaymentFormProps = Partial<FormConfig> & Readonly<{ className?: string }>;\n\ntype ContextValue = Readonly<{\n config: FormConfig;\n instance?: PaymentFormInstance;\n state: PaymentFormState;\n register(instance: PaymentFormInstance | undefined): void;\n setState(state: PaymentFormState): void;\n}>;\n\nconst PaymentFormContext = createContext<ContextValue | undefined>(undefined);\nconst mountingState: PaymentFormState = { status: 'MOUNTING', ready: false, isSubmitting: false };\n\nexport type BemonyPaymentFormProviderProps = FormConfig & Readonly<{ children: ReactNode }>;\n\n/** Optional React-only convenience layer over the single Web SDK instance. */\nexport function BemonyPaymentFormProvider({ children, ...config }: BemonyPaymentFormProviderProps) {\n const [instance, register] = useState<PaymentFormInstance | undefined>(undefined);\n const [state, setState] = useState<PaymentFormState>(mountingState);\n const value = useMemo<ContextValue>(\n () => ({ config, instance, state, register, setState }),\n [config, instance, state]\n );\n return <PaymentFormContext.Provider value={value}>{children}</PaymentFormContext.Provider>;\n}\n\nexport function useBemonyPaymentForm(): Readonly<{\n ready: boolean;\n state: PaymentFormState;\n error: PaymentFormError | null;\n pay(input: PayInput): Promise<PayOutcome>;\n}> {\n const context = useContext(PaymentFormContext);\n if (context === undefined) {\n throw new Error('useBemonyPaymentForm deve ser usado dentro de BemonyPaymentFormProvider.');\n }\n return {\n ready: context.state.ready,\n state: context.state,\n error: context.state.error ?? null,\n pay(input) {\n return context.instance?.pay(input) ?? Promise.reject(notReady());\n }\n };\n}\n\n/**\n * Works standalone with a ref or as the mount point inside\n * BemonyPaymentFormProvider. Both paths mount the same Web SDK instance.\n */\nexport const BemonyPaymentForm = forwardRef<BemonyPaymentFormRef, BemonyPaymentFormProps>(\n function BemonyPaymentForm(props, ref) {\n const context = useContext(PaymentFormContext);\n const config = context?.config ?? completeConfig(props);\n const register = context?.register;\n const setProviderState = context?.setState;\n const targetRef = useRef<HTMLDivElement>(null);\n const instanceRef = useRef<PaymentFormInstance | undefined>(undefined);\n const stateRef = useRef<PaymentFormState>(mountingState);\n const latestConfig = useRef(config);\n latestConfig.current = config;\n\n useImperativeHandle(\n ref,\n () => ({\n pay(input) {\n return instanceRef.current?.pay(input) ?? Promise.reject(notReady());\n },\n getState() {\n return instanceRef.current?.getState() ?? stateRef.current;\n },\n destroy() {\n instanceRef.current?.destroy();\n instanceRef.current = undefined;\n register?.(undefined);\n }\n }),\n [register]\n );\n\n useEffect(() => {\n const target = targetRef.current;\n if (target === null) return;\n const abort = new AbortController();\n let disposed = false;\n let instance: PaymentFormInstance | undefined;\n const publish = (next: PaymentFormState): void => {\n stateRef.current = next;\n setProviderState?.(next);\n };\n const mount = async (): Promise<void> => {\n try {\n const mounted = await WebPaymentForm.mount({\n target,\n clientSecret: config.clientSecret,\n ...(config.riskCollectors === undefined\n ? {}\n : { riskCollectors: config.riskCollectors }),\n ...(config.appearance === undefined ? {} : { appearance: config.appearance }),\n ...(config.threeDS === undefined ? {} : { threeDS: config.threeDS }),\n signal: abort.signal,\n onReady() {\n if (disposed) return;\n latestConfig.current.onReady?.();\n publish({ ...stateRef.current, status: 'READY', ready: true, isSubmitting: false });\n },\n onCardStateChange(state) {\n if (!disposed) latestConfig.current.onCardStateChange?.(state);\n },\n onStatusChange(status) {\n if (disposed) return;\n latestConfig.current.onStatusChange?.(status);\n publish({\n ...stateRef.current,\n status,\n ready: status !== 'MOUNTING' && status !== 'DESTROYED',\n isSubmitting: [\n 'TOKENIZING',\n 'SUBMITTING',\n 'AUTHENTICATING_3DS',\n 'PROCESSING'\n ].includes(status)\n });\n },\n onSuccess(payment) {\n if (disposed) return;\n latestConfig.current.onSuccess?.(payment);\n publish({ status: payment.status, ready: true, isSubmitting: false, payment });\n },\n onError(error) {\n if (disposed) return;\n latestConfig.current.onError?.(error);\n publish({ ...stateRef.current, isSubmitting: false, error });\n }\n });\n if (disposed) {\n mounted.destroy();\n return;\n }\n instance = mounted;\n instanceRef.current = mounted;\n register?.(mounted);\n publish(mounted.getState());\n } catch (error: unknown) {\n if (disposed) return;\n const publicError = mountError(error);\n latestConfig.current.onError?.(publicError);\n publish({ ...stateRef.current, isSubmitting: false, error: publicError });\n }\n };\n // React Strict Mode runs a speculative effect setup/cleanup pair. Deferring\n // the imperative mount to a cancelable task lets that discarded pass clean\n // up before an iframe is inserted, so only the committed effect owns a Frame.\n const scheduledMount = window.setTimeout(() => {\n if (!disposed) void mount();\n }, 0);\n return () => {\n disposed = true;\n window.clearTimeout(scheduledMount);\n abort.abort();\n instance?.destroy();\n if (instanceRef.current === instance) instanceRef.current = undefined;\n register?.(undefined);\n target.replaceChildren();\n };\n }, [\n config.clientSecret,\n config.threeDS?.presentation,\n config.appearance,\n register,\n setProviderState\n ]);\n\n return <div ref={targetRef} className={props.className} data-bemony-payment-form=\"\" />;\n }\n);\n\nfunction completeConfig(value: BemonyPaymentFormProps): FormConfig {\n if (typeof value.clientSecret !== 'string' || value.clientSecret.length === 0) {\n throw new Error('BemonyPaymentForm exige clientSecret fora de BemonyPaymentFormProvider.');\n }\n return { ...value, clientSecret: value.clientSecret };\n}\n\nfunction notReady(): PaymentFormError {\n return { code: 'FORM_NOT_READY', message: 'O formul\u00E1rio de pagamento ainda n\u00E3o est\u00E1 pronto.' };\n}\n\nfunction mountError(error: unknown): PaymentFormError {\n if (\n typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n 'message' in error &&\n typeof error.code === 'string' &&\n typeof error.message === 'string'\n ) {\n return { code: error.code, message: error.message };\n }\n return { code: 'MOUNT_FAILED', message: 'N\u00E3o foi poss\u00EDvel montar o formul\u00E1rio de pagamento.' };\n}\n"],
5
- "mappings": ";AAEA;AAAA,EACE,qBAAqB;AAAA,OAWhB;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAwCE;AAbT,IAAM,qBAAqB,cAAwC,MAAS;AAC5E,IAAM,gBAAkC,EAAE,QAAQ,YAAY,OAAO,OAAO,cAAc,MAAM;AAKzF,SAAS,0BAA0B,EAAE,UAAU,GAAG,OAAO,GAAmC;AACjG,QAAM,CAAC,UAAU,QAAQ,IAAI,SAA0C,MAAS;AAChF,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA2B,aAAa;AAClE,QAAM,QAAQ;AAAA,IACZ,OAAO,EAAE,QAAQ,UAAU,OAAO,UAAU,SAAS;AAAA,IACrD,CAAC,QAAQ,UAAU,KAAK;AAAA,EAC1B;AACA,SAAO,oBAAC,mBAAmB,UAAnB,EAA4B,OAAe,UAAS;AAC9D;AAEO,SAAS,u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,MAAM,MAAM,SAAS,MAAM,QAAQ;AAAA,EACpD;AACA,SAAO,EAAE,MAAM,gBAAgB,SAAS,8DAAqD;AAC/F;",
4
+ "sourcesContent": ["'use client';\n\nimport {\n BemonyPaymentForm as WebPaymentForm,\n type CardState,\n type PayInput,\n type PayOutcome,\n type PaymentFormAppearance,\n type PaymentFormCallbacks,\n type PaymentFormError,\n type PaymentFormEvent,\n type PaymentFormInstance,\n type PaymentFormState,\n type RiskCollector,\n type ThreeDSPresentation\n} from '@bemony/payment-form';\nimport {\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ReactNode\n} from 'react';\n\nexport type BemonyPaymentFormRef = Readonly<{\n pay(input: PayInput): Promise<PayOutcome>;\n getState(): PaymentFormState;\n destroy(): void;\n}>;\n\ntype FormConfig = PaymentFormCallbacks &\n Readonly<{\n clientSecret: string;\n riskCollectors?: readonly RiskCollector[];\n appearance?: PaymentFormAppearance;\n threeDS?: Readonly<{ presentation?: ThreeDSPresentation }>;\n onCardStateChange?: (state: CardState) => void;\n }>;\n\nexport type BemonyPaymentFormProps = Partial<FormConfig> & Readonly<{ className?: string }>;\n\ntype ContextValue = Readonly<{\n config: FormConfig;\n instance?: PaymentFormInstance;\n state: PaymentFormState;\n register(instance: PaymentFormInstance | undefined): void;\n setState(state: PaymentFormState): void;\n}>;\n\nconst PaymentFormContext = createContext<ContextValue | undefined>(undefined);\nconst mountingState: PaymentFormState = { status: 'MOUNTING', ready: false, isSubmitting: false };\n\nexport type BemonyPaymentFormProviderProps = FormConfig & Readonly<{ children: ReactNode }>;\n\n/** Optional React-only convenience layer over the single Web SDK instance. */\nexport function BemonyPaymentFormProvider({ children, ...config }: BemonyPaymentFormProviderProps) {\n const [instance, register] = useState<PaymentFormInstance | undefined>(undefined);\n const [state, setState] = useState<PaymentFormState>(mountingState);\n const value = useMemo<ContextValue>(\n () => ({ config, instance, state, register, setState }),\n [config, instance, state]\n );\n return <PaymentFormContext.Provider value={value}>{children}</PaymentFormContext.Provider>;\n}\n\nexport function useBemonyPaymentForm(): Readonly<{\n ready: boolean;\n state: PaymentFormState;\n error: PaymentFormError | null;\n pay(input: PayInput): Promise<PayOutcome>;\n}> {\n const context = useContext(PaymentFormContext);\n if (context === undefined) {\n throw new Error('useBemonyPaymentForm deve ser usado dentro de BemonyPaymentFormProvider.');\n }\n return {\n ready: context.state.ready,\n state: context.state,\n error: context.state.error ?? null,\n pay(input) {\n return context.instance?.pay(input) ?? Promise.reject(notReady());\n }\n };\n}\n\n/**\n * Works standalone with a ref or as the mount point inside\n * BemonyPaymentFormProvider. Both paths mount the same Web SDK instance.\n */\nexport const BemonyPaymentForm = forwardRef<BemonyPaymentFormRef, BemonyPaymentFormProps>(\n function BemonyPaymentForm(props, ref) {\n const context = useContext(PaymentFormContext);\n const config = context?.config ?? completeConfig(props);\n const register = context?.register;\n const setProviderState = context?.setState;\n const targetRef = useRef<HTMLDivElement>(null);\n const instanceRef = useRef<PaymentFormInstance | undefined>(undefined);\n const stateRef = useRef<PaymentFormState>(mountingState);\n const latestConfig = useRef(config);\n latestConfig.current = config;\n // Parent components often recreate appearance/collector objects inline.\n // Reference-only dependencies would unnecessarily reload the secure iframe\n // on ordinary React state changes. Remount only on semantic changes.\n const appearanceSignature = stableSignature(config.appearance);\n const riskCollectorsSignature = stableSignature(config.riskCollectors);\n\n useImperativeHandle(\n ref,\n () => ({\n pay(input) {\n return instanceRef.current?.pay(input) ?? Promise.reject(notReady());\n },\n getState() {\n return instanceRef.current?.getState() ?? stateRef.current;\n },\n destroy() {\n instanceRef.current?.destroy();\n instanceRef.current = undefined;\n register?.(undefined);\n }\n }),\n [register]\n );\n\n useEffect(() => {\n const target = targetRef.current;\n if (target === null) return;\n const abort = new AbortController();\n let disposed = false;\n let instance: PaymentFormInstance | undefined;\n const publish = (next: PaymentFormState): void => {\n stateRef.current = next;\n setProviderState?.(next);\n };\n const mount = async (): Promise<void> => {\n try {\n const mounted = await WebPaymentForm.mount({\n target,\n clientSecret: config.clientSecret,\n ...(config.riskCollectors === undefined\n ? {}\n : { riskCollectors: config.riskCollectors }),\n ...(config.appearance === undefined ? {} : { appearance: config.appearance }),\n ...(config.threeDS === undefined ? {} : { threeDS: config.threeDS }),\n signal: abort.signal,\n onReady() {\n if (disposed) return;\n latestConfig.current.onReady?.();\n publish({ ...stateRef.current, status: 'READY', ready: true, isSubmitting: false });\n },\n onCardStateChange(state) {\n if (!disposed) latestConfig.current.onCardStateChange?.(state);\n },\n onStatusChange(status) {\n if (disposed) return;\n latestConfig.current.onStatusChange?.(status);\n publish({\n ...stateRef.current,\n status,\n ready: status !== 'MOUNTING' && status !== 'DESTROYED',\n isSubmitting: [\n 'TOKENIZING',\n 'SUBMITTING',\n 'AUTHENTICATING_3DS',\n 'PROCESSING'\n ].includes(status)\n });\n },\n onSuccess(payment) {\n if (disposed) return;\n latestConfig.current.onSuccess?.(payment);\n publish({ status: payment.status, ready: true, isSubmitting: false, payment });\n },\n onError(error) {\n if (disposed) return;\n latestConfig.current.onError?.(error);\n publish({ ...stateRef.current, isSubmitting: false, error });\n },\n onEvent(event: PaymentFormEvent) {\n if (!disposed) latestConfig.current.onEvent?.(event);\n }\n });\n if (disposed) {\n mounted.destroy();\n return;\n }\n instance = mounted;\n instanceRef.current = mounted;\n register?.(mounted);\n publish(mounted.getState());\n } catch (error: unknown) {\n if (disposed) return;\n const publicError = mountError(error);\n latestConfig.current.onError?.(publicError);\n publish({ ...stateRef.current, isSubmitting: false, error: publicError });\n }\n };\n // React Strict Mode runs a speculative effect setup/cleanup pair. Deferring\n // the imperative mount to a cancelable task lets that discarded pass clean\n // up before an iframe is inserted, so only the committed effect owns a Frame.\n const scheduledMount = window.setTimeout(() => {\n if (!disposed) void mount();\n }, 0);\n return () => {\n disposed = true;\n window.clearTimeout(scheduledMount);\n abort.abort();\n instance?.destroy();\n if (instanceRef.current === instance) instanceRef.current = undefined;\n register?.(undefined);\n target.replaceChildren();\n };\n }, [\n config.clientSecret,\n config.threeDS?.presentation,\n appearanceSignature,\n riskCollectorsSignature,\n register,\n setProviderState\n ]);\n\n return <div ref={targetRef} className={props.className} data-bemony-payment-form=\"\" />;\n }\n);\n\nfunction completeConfig(value: BemonyPaymentFormProps): FormConfig {\n if (typeof value.clientSecret !== 'string' || value.clientSecret.length === 0) {\n throw new Error('BemonyPaymentForm exige clientSecret fora de BemonyPaymentFormProvider.');\n }\n return { ...value, clientSecret: value.clientSecret };\n}\n\nfunction notReady(): PaymentFormError {\n return { code: 'FORM_NOT_READY', message: 'O formul\u00E1rio de pagamento ainda n\u00E3o est\u00E1 pronto.' };\n}\n\nfunction mountError(error: unknown): PaymentFormError {\n if (\n typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n 'message' in error &&\n typeof error.code === 'string' &&\n typeof error.message === 'string'\n ) {\n const details = error as Record<string, unknown>;\n return {\n code: error.code,\n message: error.message,\n ...(isErrorCategory(details.category) ? { category: details.category } : {}),\n ...(isErrorStage(details.stage) ? { stage: details.stage } : {})\n };\n }\n return {\n code: 'MOUNT_FAILED',\n message: 'N\u00E3o foi poss\u00EDvel montar o formul\u00E1rio de pagamento.',\n category: 'FRAME',\n stage: 'FORM_SDK'\n };\n}\n\nfunction stableSignature(value: unknown): string {\n if (value === undefined) return '';\n return JSON.stringify(value, (_key, item: unknown) => {\n if (item !== null && typeof item === 'object' && !Array.isArray(item)) {\n return Object.fromEntries(\n Object.entries(item as Record<string, unknown>).sort(([left], [right]) =>\n left.localeCompare(right)\n )\n );\n }\n return item;\n });\n}\n\nfunction isErrorCategory(value: unknown): value is NonNullable<PaymentFormError['category']> {\n return (\n typeof value === 'string' &&\n [\n 'VALIDATION',\n 'CONFIGURATION',\n 'LIFECYCLE',\n 'FRAME',\n 'TOKENIZATION',\n 'THREE_DS',\n 'PAYMENT',\n 'RUNTIME',\n 'UNKNOWN'\n ].includes(value)\n );\n}\n\nfunction isErrorStage(value: unknown): value is NonNullable<PaymentFormError['stage']> {\n return (\n typeof value === 'string' &&\n [\n 'FORM_SDK',\n 'FORM_IFRAME_NAVIGATION',\n 'FORM_HANDSHAKE',\n 'CARD_FRAME_DOCUMENT',\n 'CARD_FRAME_HANDSHAKE',\n 'CARD_FRAME_INITIALIZATION',\n 'CARD_TOKENIZATION',\n 'THREE_DS',\n 'PAYMENT_SUBMISSION',\n 'PAYMENT_RECONCILIATION',\n 'RUNTIME'\n ].includes(value)\n );\n}\n"],
5
+ "mappings": ";AAEA;AAAA,EACE,qBAAqB;AAAA,OAYhB;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAwCE;AAbT,IAAM,qBAAqB,cAAwC,MAAS;AAC5E,IAAM,gBAAkC,EAAE,QAAQ,YAAY,OAAO,OAAO,cAAc,MAAM;AAKzF,SAAS,0BAA0B,EAAE,UAAU,GAAG,OAAO,GAAmC;AACjG,QAAM,CAAC,UAAU,QAAQ,IAAI,SAA0C,MAAS;AAChF,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA2B,aAAa;AAClE,QAAM,QAAQ;AAAA,IACZ,OAAO,EAAE,QAAQ,UAAU,OAAO,UAAU,SAAS;AAAA,IACrD,CAAC,QAAQ,UAAU,KAAK;AAAA,EAC1B;AACA,SAAO,oBAAC,mBAAmB,UAAnB,EAA4B,OAAe,UAAS;AAC9D;AAEO,SAAS,uBAKb;AACD,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC5F;AACA,SAAO;AAAA,IACL,OAAO,QAAQ,MAAM;AAAA,IACrB,OAAO,QAAQ;AAAA,IACf,OAAO,QAAQ,MAAM,SAAS;AAAA,IAC9B,IAAI,OAAO;AACT,aAAO,QAAQ,UAAU,IAAI,KAAK,KAAK,QAAQ,OAAO,SAAS,CAAC;AAAA,IAClE;AAAA,EACF;AACF;AAMO,IA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QAAQ,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;AAAA,IAChE;AAAA,EACF;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEA,SAAS,gBAAgB,OAAwB;AAC/C,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO,KAAK,UAAU,OAAO,CAAC,MAAM,SAAkB;AACpD,QAAI,SAAS,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI,GAAG;AACrE,aAAO,OAAO;AAAA,QACZ,OAAO,QAAQ,IAA+B,EAAE;AAAA,UAAK,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,MAClE,KAAK,cAAc,KAAK;AAAA,QAC1B;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAEA,SAAS,gBAAgB,OAAoE;AAC3F,SACE,OAAO,UAAU,YACjB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,SAAS,KAAK;AAEpB;AAEA,SAAS,aAAa,OAAiE;AACrF,SACE,OAAO,UAAU,YACjB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,SAAS,KAAK;AAEpB;",
6
6
  "names": ["BemonyPaymentForm"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bemony/payment-form-react",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Official React adapter for the hosted Bemony Payment Form.",
5
5
  "keywords": [
6
6
  "bemony",
@@ -34,7 +34,7 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@bemony/payment-form": "^0.1.10"
37
+ "@bemony/payment-form": "^0.1.11"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=19.0.0 <20.0.0",