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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file ecommerce_extensions-1.4.1.tar.gz.

File metadata

  • Download URL: ecommerce_extensions-1.4.1.tar.gz
  • Upload date:
  • Size: 56.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.5.10

File hashes

Hashes for ecommerce_extensions-1.4.1.tar.gz
Algorithm Hash digest
SHA256 240cc2bfb0bc592a82556ef019a1a66b84dfec05080c56f40f14144657134b5d
MD5 77e555c00fce3b6709d92f1905fbe6f0
BLAKE2b-256 3892454f4136156261733b84bde15fb6937763d3bd857d67bb53b7303864697e

See more details on using hashes here.

File details

Details for the file ecommerce_extensions-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: ecommerce_extensions-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 74.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.5.10

File hashes

Hashes for ecommerce_extensions-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c5c3737dab9081394b47858165ee456d795d9614596439e5f4e1265ad72f2f2
MD5 608317949d12b7fa9d632a6d7f9ecf0a
BLAKE2b-256 d3163c2e3d42908c59a43d8850d6ff8973063811ef8eff670a69f14e3b6be105

See more details on using hashes here.

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