Skip to content

Commit 04ca6a5

Browse files
committed
feat: serialize CI stripe customer and customer uuid
1 parent 9c1d04f commit 04ca6a5

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

enterprise_access/apps/api/v1/tests/test_checkout_bff_views.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ def setUp(self):
4343
'state': 'created',
4444
'enterprise_name': 'Test Enterprise',
4545
'enterprise_slug': 'test-enterprise',
46+
'enterprise_uuid': None,
4647
'stripe_checkout_session_id': 'cs_test_123abc',
48+
'stripe_customer_id': None,
4749
'last_checkout_error': '',
4850
'last_provisioning_error': '',
4951
'workflow_id': None,
5052
'expires_at': '2025-08-02T13:52:11Z',
51-
'admin_portal_url': 'https://portal.edx.org/test-enterprise',
5253
'country': 'US',
5354
'terms_metadata': {},
5455
}
@@ -76,9 +77,7 @@ def test_context_endpoint_authenticated_access(self, mock_filter):
7677
Test that authenticated users can access the context endpoint.
7778
"""
7879
# Set up a mock checkout intent for the authenticated user
79-
mock_intent = mock.MagicMock()
80-
for key, value in self.mock_checkout_intent_data.items():
81-
setattr(mock_intent, key, value)
80+
mock_intent = CheckoutIntent(**self.mock_checkout_intent_data)
8281
mock_filter.return_value.first.return_value = mock_intent
8382

8483
self.set_jwt_cookie([{

enterprise_access/apps/bffs/checkout/serializers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ class CheckoutIntentMinimalResponseSerializer(serializers.Serializer):
109109
enterprise_slug = serializers.CharField(
110110
help_text='The enterprise slug associated with this record', required=False,
111111
)
112+
enterprise_uuid = serializers.UUIDField(
113+
help_text='The enterprise UUID associated with this record',
114+
required=False,
115+
allow_null=True,
116+
)
112117
quantity = serializers.IntegerField(
113118
help_text='The amount of licences created with this checkout intent', required=False,
114119
)
@@ -117,6 +122,11 @@ class CheckoutIntentMinimalResponseSerializer(serializers.Serializer):
117122
required=False,
118123
allow_null=True,
119124
)
125+
stripe_customer_id = serializers.CharField(
126+
help_text='The stripe checkout id for this intent',
127+
required=False,
128+
allow_null=True,
129+
)
120130
last_checkout_error = serializers.CharField(
121131
help_text='The last checkout error related to this intent',
122132
required=False,

enterprise_access/apps/bffs/tests/test_checkout_response_builder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,10 @@ def setUp(self):
639639
'state': 'created',
640640
'enterprise_name': 'Test Enterprise',
641641
'enterprise_slug': 'test-enterprise',
642+
'enterprise_uuid': str(uuid4()),
642643
'quantity': 5,
643644
'stripe_checkout_session_id': 'cs_test_123',
645+
'stripe_customer_uuid': 'cus_test_123',
644646
'last_checkout_error': '',
645647
'last_provisioning_error': '',
646648
'workflow_id': str(uuid4()),

0 commit comments

Comments
 (0)