diff --git a/webhook/views.py b/webhook/views.py index 85aaf218..7e9175e6 100644 --- a/webhook/views.py +++ b/webhook/views.py @@ -71,13 +71,15 @@ def handle_webhook(request): logger.debug("Tax_id %s is %s" % (tax_id_obj.id, tax_id_obj.verification.status)) if tax_id_obj.verification.status == "verified": - b_addresses = BillingAddress.objects.filter(vat_number=tax_id_obj.value) + b_addresses = BillingAddress.objects.filter(stripe_tax_id=tax_id_obj.id) for b_address in b_addresses: b_address.vat_number_validated_on = datetime.datetime.now() + b_address.save() - ub_addresses = UserBillingAddress.objects.filter(vat_number=tax_id_obj.value) + ub_addresses = UserBillingAddress.objects.filter(stripe_tax_id=tax_id_obj.id) for ub_address in ub_addresses: ub_address.vat_number_validated_on = datetime.datetime.now() + ub_address.save() else: logger.debug("Tax_id %s is %s" % (tax_id_obj.id, tax_id_obj.verification.status))