Skip to content

Commit

Permalink
Call config.onError if present if isReadyToPay throws
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Niklasson committed Feb 16, 2021
1 parent 2bd7528 commit b8ff29c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/button-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,11 @@ export class ButtonManager {
|| (readyToPay.result && readyToPay.paymentMethodPresent && this.config.existingPaymentMethodRequired)
|| false;
} catch (err) {
console.error(err);
if (this.config.onError) {
this.config.onError(err)
} else {
console.error(err);
}
}

if (!this.isMounted()) return;
Expand Down

0 comments on commit b8ff29c

Please sign in to comment.