From 32d1494d0a4160e08e3b750b9ba5e0de4b20d6ab Mon Sep 17 00:00:00 2001 From: Mohammad Ahtasham ul Hassan Date: Fri, 13 Dec 2024 22:51:25 +0500 Subject: [PATCH] fix: fixes --- commerce_coordinator/settings/base.py | 2 +- commerce_coordinator/settings/local.py | 3 + commerce_coordinator/settings/test.py | 115 +++++++++++++------------ 3 files changed, 63 insertions(+), 57 deletions(-) diff --git a/commerce_coordinator/settings/base.py b/commerce_coordinator/settings/base.py index 62bbae5b..46751645 100644 --- a/commerce_coordinator/settings/base.py +++ b/commerce_coordinator/settings/base.py @@ -419,7 +419,7 @@ def root(*path_fragments): } STRIPE_WEBHOOK_ENDPOINT_SECRET = 'SET-ME-PLEASE' -PAYPAL_WEBHOOK_ID="" +PAYPAL_WEBHOOK_ID="SET-ME-PLEASE" # PAYMENT PROCESSING PAYMENT_PROCESSOR_CONFIG = { diff --git a/commerce_coordinator/settings/local.py b/commerce_coordinator/settings/local.py index 6d7803d6..c2b030ab 100644 --- a/commerce_coordinator/settings/local.py +++ b/commerce_coordinator/settings/local.py @@ -144,6 +144,9 @@ 'source_system_identifier': 'edx/commerce_coordinator?v=1', 'webhook_endpoint_secret': 'SET-ME-PLEASE', }, + "paypal": { + "paypal_webhook_id": "SET-ME-PLEASE", + }, }, } diff --git a/commerce_coordinator/settings/test.py b/commerce_coordinator/settings/test.py index 36178042..e548897b 100644 --- a/commerce_coordinator/settings/test.py +++ b/commerce_coordinator/settings/test.py @@ -3,17 +3,20 @@ from commerce_coordinator.settings.base import * PAYMENT_PROCESSOR_CONFIG = { - 'edx': { - 'stripe': { - 'api_version': '2022-08-01; server_side_confirmation_beta=v1', - 'enable_telemetry': None, - 'log_level': 'info', - 'max_network_retries': 0, - 'proxy': None, - 'publishable_key': 'SET-ME-PLEASE', - 'secret_key': 'SET-ME-PLEASE', - 'source_system_identifier': 'edx/commerce_coordinator?v=1', - 'webhook_endpoint_secret': 'SET-ME-PLEASE', + "edx": { + "stripe": { + "api_version": "2022-08-01; server_side_confirmation_beta=v1", + "enable_telemetry": None, + "log_level": "info", + "max_network_retries": 0, + "proxy": None, + "publishable_key": "SET-ME-PLEASE", + "secret_key": "SET-ME-PLEASE", + "source_system_identifier": "edx/commerce_coordinator?v=1", + "webhook_endpoint_secret": "SET-ME-PLEASE", + }, + "paypal": { + "paypal_webhook_id": "SET-ME-PLEASE", }, }, } @@ -21,13 +24,13 @@ # IN-MEMORY TEST DATABASE DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': ':memory:', - 'USER': '', - 'PASSWORD': '', - 'HOST': '', - 'PORT': '', + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": ":memory:", + "USER": "", + "PASSWORD": "", + "HOST": "", + "PORT": "", }, } # END IN-MEMORY TEST DATABASE @@ -35,66 +38,66 @@ # CACHE CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#caches CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + "default": { + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", } } CC_SIGNALS = { # DEMO: This configuration is just for proof-of-concept and can # be removed once we have real signals - 'commerce_coordinator.apps.core.signals.test_signal': [ - 'commerce_coordinator.apps.demo_lms.signals.test_receiver', - 'commerce_coordinator.apps.core.signals.test_receiver_exception', - 'commerce_coordinator.apps.core.signals.test_celery_task', + "commerce_coordinator.apps.core.signals.test_signal": [ + "commerce_coordinator.apps.demo_lms.signals.test_receiver", + "commerce_coordinator.apps.core.signals.test_receiver_exception", + "commerce_coordinator.apps.core.signals.test_celery_task", ], - 'commerce_coordinator.apps.demo_lms.signals.purchase_complete_signal': [ - 'commerce_coordinator.apps.demo_lms.signals.demo_purchase_complete_order_history', - 'commerce_coordinator.apps.demo_lms.signals.demo_purchase_complete_send_confirmation_email', - 'commerce_coordinator.apps.demo_lms.signals.demo_purchase_complete_enroll_in_course', + "commerce_coordinator.apps.demo_lms.signals.purchase_complete_signal": [ + "commerce_coordinator.apps.demo_lms.signals.demo_purchase_complete_order_history", + "commerce_coordinator.apps.demo_lms.signals.demo_purchase_complete_send_confirmation_email", + "commerce_coordinator.apps.demo_lms.signals.demo_purchase_complete_enroll_in_course", ], - 'commerce_coordinator.apps.demo_lms.signals.enroll_learner_signal': [ - 'commerce_coordinator.apps.demo_lms.signals.demo_enroll_learner_in_course', + "commerce_coordinator.apps.demo_lms.signals.enroll_learner_signal": [ + "commerce_coordinator.apps.demo_lms.signals.demo_enroll_learner_in_course", ], # Actual Production Signals - 'commerce_coordinator.apps.ecommerce.signals.enrollment_code_redemption_requested_signal': [ - 'commerce_coordinator.apps.titan.signals.enrollment_code_redemption_requested_create_order', + "commerce_coordinator.apps.ecommerce.signals.enrollment_code_redemption_requested_signal": [ + "commerce_coordinator.apps.titan.signals.enrollment_code_redemption_requested_create_order", ], - 'commerce_coordinator.apps.titan.signals.fulfill_order_placed_signal': [ - 'commerce_coordinator.apps.lms.signal_handlers.fulfill_order_placed_send_enroll_in_course', + "commerce_coordinator.apps.titan.signals.fulfill_order_placed_signal": [ + "commerce_coordinator.apps.lms.signal_handlers.fulfill_order_placed_send_enroll_in_course", ], - 'commerce_coordinator.apps.ecommerce.signals.order_created_signal': [ - 'commerce_coordinator.apps.titan.signals.order_created_save', + "commerce_coordinator.apps.ecommerce.signals.order_created_signal": [ + "commerce_coordinator.apps.titan.signals.order_created_save", ], - 'commerce_coordinator.apps.stripe.signals.payment_processed_signal': [ - 'commerce_coordinator.apps.titan.signals.payment_processed_save', + "commerce_coordinator.apps.stripe.signals.payment_processed_signal": [ + "commerce_coordinator.apps.titan.signals.payment_processed_save", ], - 'commerce_coordinator.apps.commercetools.signals.fulfill_order_placed_signal': [ - 'commerce_coordinator.apps.lms.signal_handlers.fulfill_order_placed_send_enroll_in_course', + "commerce_coordinator.apps.commercetools.signals.fulfill_order_placed_signal": [ + "commerce_coordinator.apps.lms.signal_handlers.fulfill_order_placed_send_enroll_in_course", ], - 'commerce_coordinator.apps.lms.signals.fulfillment_completed_signal': [ - 'commerce_coordinator.apps.commercetools.signals.fulfill_order_completed_send_line_item_state', + "commerce_coordinator.apps.lms.signals.fulfillment_completed_signal": [ + "commerce_coordinator.apps.commercetools.signals.fulfill_order_completed_send_line_item_state", ], - 'commerce_coordinator.apps.commercetools.sub_messages.signals_dispatch.fulfill_order_placed_message_signal': [ - 'commerce_coordinator.apps.commercetools.sub_messages.signals_delayed.fulfill_order_placed_message_signal', + "commerce_coordinator.apps.commercetools.sub_messages.signals_dispatch.fulfill_order_placed_message_signal": [ + "commerce_coordinator.apps.commercetools.sub_messages.signals_delayed.fulfill_order_placed_message_signal", ], - 'commerce_coordinator.apps.commercetools.sub_messages.signals_dispatch.fulfill_order_sanctioned_message_signal': [ - 'commerce_coordinator.apps.commercetools.sub_messages.signals_delayed.fulfill_order_sanctioned_message_signal', + "commerce_coordinator.apps.commercetools.sub_messages.signals_dispatch.fulfill_order_sanctioned_message_signal": [ + "commerce_coordinator.apps.commercetools.sub_messages.signals_delayed.fulfill_order_sanctioned_message_signal", ], - 'commerce_coordinator.apps.commercetools.sub_messages.signals_dispatch.fulfill_order_returned_signal': [ - 'commerce_coordinator.apps.commercetools.sub_messages.signals_delayed.fulfill_order_returned_signal', + "commerce_coordinator.apps.commercetools.sub_messages.signals_dispatch.fulfill_order_returned_signal": [ + "commerce_coordinator.apps.commercetools.sub_messages.signals_delayed.fulfill_order_returned_signal", ], - 'commerce_coordinator.apps.stripe.signals.payment_refunded_signal': [ - 'commerce_coordinator.apps.commercetools.signals.refund_from_stripe', + "commerce_coordinator.apps.stripe.signals.payment_refunded_signal": [ + "commerce_coordinator.apps.commercetools.signals.refund_from_stripe", ], } COMMERCETOOLS_CONFIG = { # These values have special meaning to the CT SDK Unit Testing, and will fail if changed. - 'clientId': "mock-client-id", - 'clientSecret': "mock-client-secret", - 'scopes': "manage_project:test", - 'apiUrl': "https://localhost", - 'authUrl': "https://localhost/oauth/token", - 'projectKey': "test", + "clientId": "mock-client-id", + "clientSecret": "mock-client-secret", + "scopes": "manage_project:test", + "apiUrl": "https://localhost", + "authUrl": "https://localhost/oauth/token", + "projectKey": "test", }