Skip to content

Commit

Permalink
Merge pull request #119 from edly-io/ALI/EDLY-4936
Browse files Browse the repository at this point in the history
Fix authorizenet enrollment issue - EDLY-4936
  • Loading branch information
muhammadali124 authored Dec 1, 2022
2 parents 52dc0b8 + 1043c5a commit ead9df1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ecommerce/extensions/fulfillment/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,11 @@ class EnrollmentFulfillmentModule(BaseFulfillmentModule):
messages if the LMS user id cannot be found.
"""

def _post_to_enrollment_api(self, data, user, usage):
def _post_to_enrollment_api(self, data, user, usage, site=None):
enrollment_api_url = get_lms_enrollment_api_url()
if site:
enrollment_api_url = '{}/api/enrollment/v1/enrollment'.format(site.siteconfiguration.lms_url_root)

timeout = settings.ENROLLMENT_FULFILLMENT_TIMEOUT
headers = {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -423,7 +426,7 @@ def fulfill_product(self, order, lines, email_opt_in=False):

# Post to the Enrollment API. The LMS will take care of posting a new EnterpriseCourseEnrollment to
# the Enterprise service if the user+course has a corresponding EnterpriseCustomerUser.
response = self._post_to_enrollment_api(data, user=order.user, usage='fulfill enrollment')
response = self._post_to_enrollment_api(data, user=order.user, usage='fulfill enrollment', site=order.site)

if response.status_code == status.HTTP_200_OK:
line.set_status(LINE.COMPLETE)
Expand Down

0 comments on commit ead9df1

Please sign in to comment.