diff --git a/goodtimes/webhook.py b/goodtimes/webhook.py index 25b45eb..b1448a5 100644 --- a/goodtimes/webhook.py +++ b/goodtimes/webhook.py @@ -182,14 +182,13 @@ class SubscriptionService: class PaymentProcessingService: def __init__(self, webhook_data): self.webhook_service = WebhookService(webhook_data) - self.subscription_service = SubscriptionService() # self.notification_service = NotificationService() - # Retrieve objects self.principal = self.webhook_service.get_principal() self.transaction = self.webhook_service.get_transaction() self.subscription = self.webhook_service.get_subscription() self.order_id = self.webhook_service.get_order_id() + self.subscription_service = SubscriptionService() self.principal_subscription = None def process_event(self): @@ -206,19 +205,19 @@ class PaymentProcessingService: self.principal, self.subscription, self.order_id ) ) - + print("First Part Done....!!!!!") # Update transaction status to success self.subscription_service.update_transaction_success( self.transaction, self.principal_subscription ) - + print("Second Part Done....!!!!!") # Now handle referral rewards, if applicable if self.principal_subscription: referral_service = ReferralRewardService( self.principal, self.principal_subscription, self.subscription ) referral_service.credit_referral_reward_if_applicable() - + print("Third Part Done....!!!!!") # self.notification_service.payment_success_notification( # self.principal, self.subscription, self.transaction.amount # )