'Cancels the payment account.
If `disable_refs` is set, existing apps that use this payment account
will be set to STATUS_NULL.'

def cancel(self, disable_refs=False):

    account_refs = AddonPaymentAccount.objects.filter(account_uri=self.uri)
    if (self.shared and account_refs):
        log.error('Cannot    cancel    a    shared    payment    account    that    has    apps    using    it.')
        raise CantCancel('You    cannot    cancel    a    shared    payment    account.')
    self.update(inactive=True)
    log.info(('Soft-deleted    payment    account    (uri:    %s)' % self.uri))
    for acc_ref in account_refs:
        if (disable_refs and (not acc_ref.addon.has_multiple_payment_accounts())):
            log.info('Changing    app    status    to    NULL    for    app:    {0}because    of    payment    account    deletion'.format(acc_ref.addon_id))
            acc_ref.addon.update(status=mkt.STATUS_NULL)
        log.info('Deleting    AddonPaymentAccount    for    app:    {0}    because    of    payment    account    deletion'.format(acc_ref.addon_id))
        acc_ref.delete()
