Skip to main content

Django module for interfacing with the CommWeb merchant gateway.

Project description

django-commweb is a Django module for interfacing with the CommWeb merchant gateway, the Commonwealth Bank of Australia’s merchant payment facility.

Source is available on GitHub.

Supported functions

  • Purchase (one-step transaction)

Dependencies

Installation

  1. Install using pip:

    $ pip install django-commweb
  2. Add the ‘commweb’ app to the bottom of your INSTALLED_APPS setting:

    INSTALLED_APPS = (
        ...
        'commweb',
    )
  3. Add the required settings (provided by the CommWeb Support Line) for the test merchant to your project’s settings.py:

    COMMWEB_ACCESS_CODE = 'FOO'
    COMMWEB_MERCHANT = 'TESTMERCHANT'
  4. Run the tests to ensure your merchant details are set up correctly by running a Django shell as follows:

    $ python manage.py shell
    >>> import unittest
    >>> from commweb.test.test_responses import TestResponses
    >>> suite = unittest.TestLoader().loadTestsFromTestCase(TestResponses)
    >>> unittest.TextTestRunner(verbosity=2).run(suite)
    test_approved (commweb.test.test_responses.TestResponses) ... ok
    test_card_expired (commweb.test.test_responses.TestResponses) ... ok
    test_declined_2 (commweb.test.test_responses.TestResponses) ... ok
    test_declined_E (commweb.test.test_responses.TestResponses) ... ok
    test_failed (commweb.test.test_responses.TestResponses) ... ok
    test_insufficient_credit (commweb.test.test_responses.TestResponses) ... ok
    test_no_reply (commweb.test.test_responses.TestResponses) ... ok
    
    ----------------------------------------------------------------------
    Ran 7 tests in 2.593s
    
    OK
    <unittest.runner.TextTestResult run=7 errors=0 failures=0>

Intergration

Two options are available for intergrating django-commweb into your Django app.

Cartridge

A payment handler for Cartridge is provided by commweb.cartridge.cartridge_payment_handler. You only need to set SHOP_HANDLER_PAYMENT in your project’s settings file to activate this functionality:

SHOP_HANDLER_PAYMENT = 'commweb.cartridge_hook.cartridge_payment_handler'

Using the API directly

See commweb.test.test_responses.py for an example of how to call the API directly. The API module is located at commweb.purchase.

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

django-commweb-0.1.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file django-commweb-0.1.tar.gz.

File metadata

  • Download URL: django-commweb-0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-commweb-0.1.tar.gz
Algorithm Hash digest
SHA256 750c7ce49461f125bd2e9a5100e600aa1f3b30424d2c0735f4dd1241d28b5088
MD5 82ab6c43cc1d15435bc583e9cad9c369
BLAKE2b-256 667e8f1725f45be458379159b07b3729522cf33d40364f3b4867d172eddebb84

See more details on using hashes here.

Supported by

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