refactored webhook realted to coupon 3
This commit is contained in:
@@ -219,18 +219,8 @@ class StripeWebhookTest(APIView):
|
||||
current_period_start=current_period_start,
|
||||
current_period_end=current_period_end,
|
||||
)
|
||||
transaction = payment_service.create_transaction()
|
||||
try:
|
||||
payment_service.process_event(transaction)
|
||||
transaction.transaction_status = TransactionStatus.SUCCESS
|
||||
except Exception as e:
|
||||
transaction.transaction_status = TransactionStatus.FAIL
|
||||
transaction.error_message = str(e)
|
||||
logger.error(f"Transaction Error: {str(e)}")
|
||||
raise e
|
||||
finally:
|
||||
transaction.save()
|
||||
|
||||
payment_service.process_event()
|
||||
webhook_event.status = "processed"
|
||||
webhook_event.processed_at = timezone.now()
|
||||
webhook_event.save()
|
||||
|
||||
Reference in New Issue
Block a user