diff --git a/lib/hooks/use-payment-requests.ts b/lib/hooks/use-payment-requests.ts index 56b368f..926a1f5 100644 --- a/lib/hooks/use-payment-requests.ts +++ b/lib/hooks/use-payment-requests.ts @@ -155,25 +155,26 @@ const startPaymentRequestUserFlow = async ( params?: PaymentRequestStartParams ): Promise => { try { - console.log('[startFlow] triggered'); + const log = window.console.log; + log('[startFlow] triggered'); if (!validateFormFields(formDiv, onValidationError, stripeCpm)) { return; } - console.log('[startFlow] post-validate'); + log('[startFlow] post-validate'); const pr = getGlobalPaymentRequest(); - console.log('[startFlow] pr:', pr, 'override:', params?.overridePaymentRequest); + log('[startFlow] pr:', pr, 'override:', params?.overridePaymentRequest); if (params?.overridePaymentRequest) { const override = params?.overridePaymentRequest; updatePrWithAmount(pr, override.amount, override.pending); } - console.log('[startFlow] showing PR...'); + log('[startFlow] showing PR...'); pr.show(); - console.log('[startFlow] PR shown. Waiting...'); + log('[startFlow] PR shown. Waiting...'); const pmAddedEvent = await waitForUserToAddPaymentMethod(pr); - console.log('[startFlow] PR fulfilled. Completing flow...'); + log('[startFlow] PR fulfilled. Completing flow...'); onUserCompleteUIFlow(pmAddedEvent, stripeCpm); } catch (e) { - console.error('[startFlow] Error:', e); + window.console.error('[startFlow] Error:', e); onError(getErrorMessage(e)); } }; diff --git a/package.json b/package.json index 1eec1ac..f671df6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getopenpay/openpay-js-react", - "version": "0.0.18", + "version": "0.0.19", "description": "Accept payments through OpenPay, right on your site", "author": "OpenPay (https://getopenpay.com)", "type": "module",