Skip to content

Commit

Permalink
fix (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
syvlabs authored Oct 4, 2024
1 parent 1cc8d4c commit 2de60c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions lib/hooks/use-payment-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,26 @@ const startPaymentRequestUserFlow = async (
params?: PaymentRequestStartParams
): Promise<void> => {
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));
}
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <info@getopenpay.com> (https://getopenpay.com)",
"type": "module",
Expand Down

0 comments on commit 2de60c2

Please sign in to comment.