Skip to content

Commit

Permalink
fix: call config.onError if present if isReadyToPay throws (#73)
Browse files Browse the repository at this point in the history
* fix: call config.onError if present if isReadyToPay throws

* fix: lint
  • Loading branch information
axelniklasson committed Feb 17, 2021
1 parent 2bd7528 commit 63fee4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/button-manager.ts
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 63fee4f

Please sign in to comment.