Skip to content

Commit

Permalink
fix: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aht007 committed Dec 13, 2024
1 parent 7a7fc93 commit 32d1494
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 57 deletions.
2 changes: 1 addition & 1 deletion commerce_coordinator/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 3 additions & 0 deletions commerce_coordinator/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
}

Expand Down
115 changes: 59 additions & 56 deletions commerce_coordinator/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,101 @@
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",
},
},
}
# END PAYMENT PROCESSING

# 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

# 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",
}

0 comments on commit 32d1494

Please sign in to comment.