updated webhook module

This commit is contained in:
rizwanisready
2024-08-08 14:59:01 +05:30
parent e8b90b8fdb
commit 70c5c815fa

View File

@@ -83,8 +83,7 @@ class PaymentProcessingService:
print("self.charge_data.billing_reason", self.charge_data.get("billing_reason"))
if self.charge_data.get("billing_reason") != "subscription_create":
self.handle_success(txn)
else:
print("Should not be here...")
elif event_type == "checkout.session.expired" or event_type == "invoice.payment_failed":
self.handle_failure(txn)
except Exception as e:
logger.error(f"Transaction Error: {str(e)}")