Skip to main content

Django eduNEXT ecommerce-extensions app.

Project description

https://circleci.com/gh/eduNEXT/ecommerce-extensions.svg?style=shield https://codecov.io/gh/eduNEXT/ecommerce-extensions/branch/main/graph/badge.svg

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.

Installation

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',
)

Usage

  1. Add model TenantOptions: This model allows to override settings by tenant and it can be found in <ecommerce-site>/admin/edunext/tenantoptions/

  2. Add new payment processors.

Integrate 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.

  1. Add urls. File ecommerce/extensions/payment/urls.py

from ecommerce_extensions.urls import urlpatterns as url_extensions
...

urlpatterns = [
    url('', include((url_extensions, 'ecommerce_extensions'))),
    ...
]
  1. Add payment processors. File ecommerce/settings/_oscar.py

PAYMENT_PROCESSORS = (
    ...
    'ecommerce_extensions.payment.processors.payu.Payu',
    'ecommerce_extensions.payment.processors.fomopay.Fomopay',
)
  1. 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 %}

How to Contribute

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecommerce_extensions-1.4.1.tar.gz (56.3 kB view hashes)

Uploaded Source

Built Distribution

ecommerce_extensions-1.4.1-py3-none-any.whl (74.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page