This repository contains an external django application, which adds multiple funtionalities in order to extend the ecommerce behaviour and avoid changing the base code directly.
Install with pip:
pip install django-oauth-toolkit
Add ecommerce_extensions.apps.EcommerceExtensionsConfig to your INSTALLED_APPS, if you want to use payment processors, and add ecommerce_extensions.tenant.apps.TenantConfig to your INSTALLED_APPS, if you want to use TenantOptions.
INSTALLED_APPS = (
...
'ecommerce_extensions.apps.EcommerceExtensionsConfig',
'ecommerce_extensions.tenant.apps.TenantConfig',
)
- Add model TenantOptions: This model allows to override settings by tenant and it can be found in <ecommerce-site>/admin/edunext/tenantoptions/
- Add new payment processors.
The django application offers some integrations listed below:
- Payu payment processor.
- Fomopay payment processor.
In order to activate these processor some configuratios are required.
- Add urls. File ecommerce/extensions/payment/urls.py
from ecommerce_extensions.urls import urlpatterns as url_extensions
...
urlpatterns = [
url('', include((url_extensions, 'ecommerce_extensions'))),
...
]
- Add payment processors. File ecommerce/settings/_oscar.py
PAYMENT_PROCESSORS = (
...
'ecommerce_extensions.payment.processors.payu.Payu',
'ecommerce_extensions.payment.processors.fomopay.Fomopay',
)
- Add html buttons. File ecommerce/templates/oscar/basket/partials/hosted_checkout_basket.html
{% for processor in payment_processors %}
<button data-track-type="click"
data-track-event="edx.bi.ecommerce.basket.payment_selected"
data-track-category="checkout"
data-processor-name="{{ processor.NAME|lower }}"
data-track-checkout-type="hosted"
class="btn payment-button"
id="{{ processor.NAME|lower }}">
{% if processor.NAME == 'cybersource' %}
{% trans "Checkout" as tmsg %}{{ tmsg | force_escape }}
{% elif processor.NAME == 'paypal' %}
{# Translators: Do NOT translate the name PayPal. #}
{% trans "Checkout with PayPal" as tmsg %}{{ tmsg | force_escape }}
{% elif processor.NAME == 'payu' %}
{# Translators: Do NOT translate the name PayU. #}
{% trans "Checkout with PayU" as tmsg %}{{ tmsg | force_escape }}
{% elif processor.NAME == 'fomopay' %}
{# Translators: Do NOT translate the name WeChat. #}
{% trans "Checkout with WeChat" as tmsg %}{{ tmsg | force_escape }}
{% endif %}
</button>
{% endfor %}
Contributions are welcome! See our CONTRIBUTING file for more information – it also contains guidelines for how to maintain high code quality, which will make your contribution more likely to be accepted.