Commit 1d2bc6fd by Awais

ECOM-1807 Adding provider thumbnail url.

parent 0f94910d
......@@ -87,6 +87,7 @@ def get_credit_provider_info(request, provider_id): # pylint: disable=unused-ar
<li>Sample instruction abc</li>
<li>Sample instruction xyz</li>
</ul>",
"thumbnail_url": "https://credit.example.com/logo.png"
}
"""
......@@ -100,7 +101,8 @@ def get_credit_provider_info(request, provider_id): # pylint: disable=unused-ar
"provider_status_url": credit_provider.provider_status_url,
"provider_description": credit_provider.provider_description,
"enable_integration": credit_provider.enable_integration,
"fulfillment_instructions": credit_provider.fulfillment_instructions
"fulfillment_instructions": credit_provider.fulfillment_instructions,
"thumbnail_url": credit_provider.thumbnail_url
}
return JsonResponse(credit_provider_data)
......
......@@ -129,6 +129,14 @@ class CreditProvider(TimeStampedModel):
)
)
thumbnail_url = models.URLField(
default="",
max_length=255,
help_text=ugettext_lazy(
"Thumbnail image url of the credit provider."
)
)
CREDIT_PROVIDERS_CACHE_KEY = "credit.providers.list"
@classmethod
......@@ -166,6 +174,7 @@ class CreditProvider(TimeStampedModel):
"description": provider.provider_description,
"enable_integration": provider.enable_integration,
"fulfillment_instructions": provider.fulfillment_instructions,
"thumbnail_url": provider.thumbnail_url,
}
for provider in credit_providers
]
......
......@@ -70,6 +70,7 @@ class CreditApiTestBase(ModuleStoreTestCase):
"mailing_address": "123 Fake Street, Cambridge MA",
"country": "US",
}
THUMBNAIL_URL = "https://credit.example.com/logo.png"
def setUp(self, **kwargs):
super(CreditApiTestBase, self).setUp()
......@@ -86,7 +87,8 @@ class CreditApiTestBase(ModuleStoreTestCase):
provider_status_url=self.PROVIDER_STATUS_URL,
provider_description=self.PROVIDER_DESCRIPTION,
enable_integration=self.ENABLE_INTEGRATION,
fulfillment_instructions=self.FULFILLMENT_INSTRUCTIONS
fulfillment_instructions=self.FULFILLMENT_INSTRUCTIONS,
thumbnail_url=self.THUMBNAIL_URL
)
return credit_course
......@@ -516,7 +518,8 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
"status_url": self.PROVIDER_STATUS_URL,
"description": self.PROVIDER_DESCRIPTION,
"enable_integration": self.ENABLE_INTEGRATION,
"fulfillment_instructions": self.FULFILLMENT_INSTRUCTIONS
"fulfillment_instructions": self.FULFILLMENT_INSTRUCTIONS,
"thumbnail_url": self.THUMBNAIL_URL
}
])
......@@ -540,6 +543,7 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
"description": self.PROVIDER_DESCRIPTION,
"enable_integration": self.ENABLE_INTEGRATION,
"fulfillment_instructions": self.FULFILLMENT_INSTRUCTIONS,
"thumbnail_url": self.THUMBNAIL_URL
}]
result = api.get_credit_providers([self.PROVIDER_ID])
self.assertEqual(result, expected_result)
......@@ -838,6 +842,7 @@ class CreditApiFeatureFlagEnabledTests(CreditApiFeatureFlagTest, CreditApiTestBa
"provider_description": self.PROVIDER_DESCRIPTION,
"enable_integration": self.ENABLE_INTEGRATION,
"fulfillment_instructions": self.FULFILLMENT_INSTRUCTIONS,
"thumbnail_url": self.THUMBNAIL_URL
}
path = reverse('credit:get_provider_info', kwargs={'provider_id': self.PROVIDER_ID})
result = self.client.get(path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment