updated webhook module
This commit is contained in:
@@ -80,9 +80,11 @@ class PaymentProcessingService:
|
||||
if event_type == "checkout.session.completed":
|
||||
self.handle_success(txn)
|
||||
elif event_type == "invoice.payment_succeeded":
|
||||
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...")
|
||||
self.handle_failure(txn)
|
||||
except Exception as e:
|
||||
logger.error(f"Transaction Error: {str(e)}")
|
||||
|
||||
Reference in New Issue
Block a user