feat(dangerous protections): disable dangerous operations by default
This commit is contained in:
@@ -97,6 +97,12 @@ export class BunqCard {
|
||||
* Update card settings
|
||||
*/
|
||||
public async update(updates: any): Promise<void> {
|
||||
// Check if this is a dangerous operation
|
||||
if ((updates.status === 'CANCELLED' || updates.status === 'BLOCKED') &&
|
||||
!this.bunqAccount.options.dangerousOperations) {
|
||||
throw new Error('Dangerous operations are not enabled. Initialize the BunqAccount with dangerousOperations: true to allow cancelling or blocking cards.');
|
||||
}
|
||||
|
||||
await this.bunqAccount.apiContext.ensureValidSession();
|
||||
|
||||
const cardType = this.type === 'MASTERCARD' ? 'CardCredit' : 'CardDebit';
|
||||
|
Reference in New Issue
Block a user