Django Oscar

Posted onby admin

Oscar ships with one sample project: a ‘sandbox’ site, which is a vanilla install of Oscar using the default templates and styles. The sandbox site ¶ The sandbox site is a minimal implementation of Oscar where everything is left in its default state. Django-oscar-support extend Oscar’s customer account templates and should pick up the styles that are defined there following Oscar’s template customisation process. If you are not sure how this works, take a look atHow to customise templatesin the Oscar docs. Hi i am creating a project in django and installing all oscar dependencies. Pip install django-oscar using this command and configure the project as per documentation.

Latest version

Released:

Integration with PayPal Express, PayPal Payflow Pro and Adaptive Payments for django-oscar

Project description

This package provides integration between django-oscar and both PayPalExpress and PayPal Payflow Pro.

These payment options can be used individually or together. Further, thepackage is structured so that it can be used without Oscar if you so wish.

License

The package is released under the New BSD license.

Support

Having problems or got a question?

  • Have a look at the sandbox site as this is a sample Oscar projectintegrated with both PayPal options. See the contributing guide within thedocs for instructions on how to set up the sandbox locally.
  • Ping @django_oscar with quick queries.
  • Ask more detailed questions on the Oscar mailing list: [email protected]
  • Use Github for submitting issues and pull requests.

Changelog

2.0.0 (released December 20th, 2019)

  • Add support for Oscar 2.0 and Django 2.2.
  • Drop support for Oscar 1.6 and lower and Django 2.0 and lower.
  • Drop support for Python 2.

1.0.0 (released May 30th, 2018)

  • Add support for Oscar 1.6 and Django 2.
  • Drop support for Oscar 1.4 and lower and Django 1.10 and lower.

0.9.7 (released January 12th, 2016)

  • Fix breakage when using Oscar’s DeferredTaxMixin. #98#121

Django Oscar Theme

0.9.6 (released November 13th, 2015)

  • Add support for Oscar 1.1 and Django 1.8.
  • Drop support for Django 1.6 and Oscar 0.7.
  • Store submitted shipping method instead of falling back to FixedPrice. #107
  • Display original Paypal error message instead of generic error message. #101
  • Bugfix: Hide form buttons as expected. #94
  • Bugfix: Correct signature for call to get_shipping_methods. #99
  • Bugfix: Don’t fail in countries without postcode. #100

0.9.5

  • Fix issue with missing templates in PyPI package.

0.9.4

  • Use Bankcard.number instead of the deprecated Bankcard.card_number attribute.
  • Add support for Django 1.7 and Oscar 1.0.
  • Drop support for Oscar 0.6 and Django 1.5.

0.9.3

  • Use the correct key to look up a previous transaction ID (forrefund/capture/void operations). #81

0.9.2

  • Include templates in package (they were missing from 0.9.1)
  • Dynamically load view classes in Express views module

0.9.1

  • Add support for Python 3.3 and 3.4
  • Add preliminary support for (unreleased) Oscar 0.8

0.9

  • Support Oscar 0.7 (note that this release only works with 0.7.1 onwards)
  • Drop support for Oscar 0.5
  • Fix bug around unicode handling
  • Allow scheme of callback URL to be specified in a setting

0.8.1

  • Ensure sandbox demo site works correctly with Oscar 0.6
  • Fix a bug with Payflow Pro using wrong bankcard attribute for expiry dates.
  • Remove Oscar version verification in setup.py
  • Use content-type text/namevalue when submitting key-value pairs toPayPal.

0.8

  • Support Oscar 0.6
  • Fix bug with offers not being applied to basket on return from PayPal site.

0.6.1

  • Persist shipping method name when using PayPal Express as a payment methodonly.

0.6

  • Add support for NO_SHIPPING option with PayPal Express.

0.5

  • Addresses a security issue where baskets could be manipulated while thecustomer was on the PayPal site. This would cause the final order to containmore items that were paid for.

0.4.1

  • Fixes a bug where the second line of a user’s address was not being used tocreate the order shipping address.
Django OscarDjango oscar stripe

0.4

  • We now require Oscar >= 0.5
  • Full i18 support
  • New dashboard views for PayPal Express

0.3.2

  • Pass shipping address name when using Express checkout
  • Docs update

0.3.1

  • Fix issue with currency formatting
  • Fix issue with i18n proxies being passed to PayPal

0.3

  • Order discounts are now passed correctly to PayPal as separate lines
  • Fix unicode issue when reading data back from PayPal
  • Use Tox for testsuite

0.2.4

  • Fix bug with installing templates

0.2.3

  • Fix bug with amount formats not being validated properly
  • Adjust txn model to allow virtually everything to be nullable

0.2.2

  • Add support for specifying transaction currency

0.2.1

  • Fix packaging issues
  • Remove dead templates
  • With API docs

0.1

Includes support for Express Checkout.

Release historyRelease notifications RSS feed

2.0.0

1.0.0

0.9.7

0.9.6

0.9.5

0.9.4

0.9.3

0.9.2

0.9.1

0.9

0.8.1

0.8

0.7

0.6.1

0.6

0.5

0.4.1

0.4

0.3.4

0.3.3

0.3.2

0.3.1

0.3

0.2.5

0.2.4

0.2.3

0.2.2

0.2.1

0.2

0.1.1

0.1

Download files

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

Files for django-oscar-paypal, version 2.0.0
Filename, sizeFile typePython versionUpload dateHashes
Filename, size django_oscar_paypal-2.0.0-py3-none-any.whl (37.5 kB) File type Wheel Python version py3 Upload dateHashes
Filename, size django-oscar-paypal-2.0.0.tar.gz (27.3 kB) File type Source Python version None Upload dateHashes
Close

Hashes for django_oscar_paypal-2.0.0-py3-none-any.whl

Hashes for django_oscar_paypal-2.0.0-py3-none-any.whl
AlgorithmHash digest
SHA2568284a91709a5505af81a17f05028d1558d8dda268fbd6f4e337388cb400abdd4
MD598e34ca8500d51f169a01863a1a62642
BLAKE2-256e188bfb32d32a437a8f6793008b748506d91f1b07eb9207707c996dbe155a1c2
Close

Hashes for django-oscar-paypal-2.0.0.tar.gz

Hashes for django-oscar-paypal-2.0.0.tar.gz
AlgorithmHash digest
SHA2567e6b244bbd7069c9c5c882579c4b66bf89b2379c64ab0fddd849c916dc1f3fcf
MD5f7bbbc754b00af3696a7f855a7d478e0
BLAKE2-256fbb78ee80b952b15982f74c24f6f2d24f212256f65fe487dd88b6ff7ee6e7925
Latest version

Released:

Managed accounts for django-oscar

Project description

A ‘managed account’ is an allocation of money that can be debited and credited.This package provides managed account functionality for use with the e-commerceframework Oscar.

Accounts can be used to implement a variety of interesting components,including:

  • Giftcards
  • Web accounts
  • Loyalty schemes

Basically anything that involves tracking the movement of funds within a closedsystem.

This package uses double-entry bookkeeping where every transaction isrecorded twice (once for the source and once for the destination). Thisensures the books always balance and there is full audit trail of alltransactional activity.

If your project manages money, you should be using a library like this. Yourfinance people will thank you.

Features

  • An account has a credit limit which defaults to zero. Accounts can be set upwith no credit limit so that they are a ‘source’ of money within the system.At least one account must be set up without a credit limit in order for moneyto move around the system.
  • Accounts can have:- No users assigned- A single “primary” user - this is the most common case- A set of users assigned
  • A user can have multiple accounts
  • An account can have a start and end date to allow its usage in a limited timewindow
  • An account can be restricted so that it can only be used to pay for a range ofproducts.
  • Accounts can be categorised

Installation

Install using pip:

and add oscar_accounts.apps.AccountsConfig and oscar_accounts.dashboard.apps.AccountsDashboardConfig to INSTALLED_APPS. Running manage.py migrateoscar_accounts will create the appropriate database tables. To create initialsome core accounts and account-types use manage.py oscar_accounts_init.The names of these accounts can be controlled using settings (see below).

In order to make the accounts accessible via the Oscar dashboard you need toappend it to your OSCAR_DASHBOARD_NAVIGATION

Furthermore you need to add the url-pattern to your urls.py

You should also set-up a cronjob that calls:

to close any expired accounts and transfer their funds to the ‘expired’account.

API

Create account instances using the manager:

Transfer funds using the facade:

Reverse transfers:

If the proposed transfer is invalid, an exception will be raised. Allexceptions are subclasses of oscar_accounts.exceptions.AccountException.Your client code should look for exceptions of this type and handle themappropriately.

Client code should only use the oscar_accounts.models.Budget class and thetwo functions from oscar_accounts.facade - nothing else should be required.

Error handling

Note that the transfer operation is wrapped in its own database transaction toensure that only complete transfers are written out. When using Django’stransaction middleware, you need to be careful. If you have an unhandledexception, then account transfers will still be committed even though nothingelse will be. To handle this, you need to make sure that, if an exceptionoccurs during your post-payment code, then you roll-back any transfers.

Here’s a toy example:

In this situation, you’ll end up with two transfers being created but no order.While this isn’t ideal, it’s the best way of handling exceptions that occurduring order placement.

Multi-transfer payments

Projects will often allow users to have multiple accounts and pay for an orderusing more than one. This will involve several transfers and needs somecareful handling in your application code.

It normally makes sense to write your own wrapper around the accounts API toencapsulate your business logic and error handling. Here’s an example:

As you can see, there is some careful handling of the scenario where not alltransfers can be executed.

If you using Oscar then ensure that you create an OrderSource instance forevery transfer (rather than aggregating them all into one). This will providebetter audit information. Here’s some example code:

Core accounts and account types

A post-syncdb signal will create the common structure for account types andaccounts. Some names can be controlled with settings, as indicated inparentheses.

  • Assets
    • Sales
      • Redemptions (ACCOUNTS_REDEMPTIONS_NAME) - where money istransferred to when an account is used to pay for something.
      • Lapsed (ACCOUNTS_LAPSED_NAME) - where money is transferred towhen an account expires. This is done by the‘close_expired_accounts’ management command. The name of thisaccount can be set using the ACCOUNTS_LAPSED_NAME.
    • Cash
      • “Bank” (ACCOUNTS_BANK_NAME) - the source account for creating newaccounts that are paid for by the customer (eg a giftcard). Thisaccount will not have a credit limit and will normally have anegative balance as money is only transferred out.
    • Unpaid - This contains accounts that are used as sources for otheraccounts but aren’t paid for by the customer. For instance, you mightallow admins to create new accounts in the dashboard. An account of thistype will be the source account for the initial transfer.
  • Liabilities
    • Deferred income - This contains customer accounts/giftcards. You maywant to create additional account types within this type to categoriseaccounts.

Example transactions

Consider the following accounts and account types:

  • Assets
    • Sales
      • Redemptions
      • Lapsed
    • Cash
      • Bank
    • Unpaid
      • Merchant funded
  • Liabilities
    • Deferred income

Note that all accounts start with a balance of 0 and the sum of all balanceswill always be zero.

A customer purchases a £50 giftcard

  • A new account is created of type ‘Deferred income’ with an end date - £50 istransferred from the Bank to this new account

A customer pays for a £30 order using their £50 giftcard

  • £30 is transferred from the giftcard account to the redemptions account

The customer’s giftcard expires with £20 still on it

  • £20 is transferred from the giftcard account to the lapsed account

The customer phones up to complain and a staff member creates a new giftcardfor £20

  • A new account is created of type ‘Deferred income’ - £20 is transferred fromthe “Merchant funded” account to this new account

Settings

There are settings to control the naming and initial unpaid and deferred incomeaccount types:

  • ACCOUNTS_MIN_LOAD_VALUE The minimum value that can be used to create anaccount (or for a top-up)
  • ACCOUNTS_MAX_INITIAL_VALUE The maximum value that can be transferred to anaccount.
  • OSCAR_ACCOUNTS_DASHBOARD_ITEMS_PER_PAGE The amount of items per page that show in dashboard(default=20).

Contributing

Fork repo, set-up virtualenv and run:

Run tests with:

Release historyRelease notifications RSS feed

2.1

2.0.0

Django Oscar Nominations

1.0.0

0.4rc1 pre-release

0.3

0.2

0.1.6

0.1.5

Django Oscar

0.1.4

0.1.3

0.1.2

0.1.1

0.1

Download files

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

Files for django-oscar-accounts, version 2.1
Filename, sizeFile typePython versionUpload dateHashes
Filename, size django_oscar_accounts-2.1-py3-none-any.whl (50.2 kB) File type Wheel Python version py3 Upload dateHashes
Filename, size django-oscar-accounts-2.1.tar.gz (821.4 kB) File type Source Python version None Upload dateHashes
Close

Hashes for django_oscar_accounts-2.1-py3-none-any.whl

Hashes for django_oscar_accounts-2.1-py3-none-any.whl
AlgorithmHash digest
SHA256e7639a2e373aa516148cec411ecb910730c8b2fe310497f65de32ca8f04fccc3
MD5452c5e847c613a5b8b7d5bfc8e09347c
BLAKE2-2567b3eb427f6eaef9605c2a20dfe52e0c3cc82427f22213b178160377f7f8102d0
Close

Hashes for django-oscar-accounts-2.1.tar.gz

Hashes for django-oscar-accounts-2.1.tar.gz
AlgorithmHash digest
SHA2563f94f21b91f1301619904b722790d241d4038bd85ed53d906bf5919646eb3847
MD50b6e92ac33e16fca9c201602f7282419
BLAKE2-25684322cf5c6c5115a3f58faa8851dc97ec0dd3d81978f640244a1ebe4f95fd1d6