You can avoid the whole flags shenanigans by just saying 

```js
}).fail(function() {
    notification.notification({message: gettext('Payment cancelled')});
});
```

Login deferreds reject when failed or cancelled.