django-oscar-stripe-sca


Namedjango-oscar-stripe-sca JSON
Version 0.6.1 PyPI version JSON
download
home_page
SummaryStripe Checkout (with Payment Intents) payment module for django-oscar
upload_time2024-02-05 10:10:07
maintainer
docs_urlNone
author
requires_python
license
keywords payment stripe
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===================================
Stripe integration for django-oscar
===================================

pip3 install django-oscar-stripe-sca

This is a framework for using Stripe Checkout with a view for being SCA compliant for payments
in Europe after September 2019.  Requires the Python Stripe API (2.27), django 2 and above, django-oscar 2 and above. 
Based in part on django-oscar-stripe and django-oscar-paypal.

Useful information:

* `Stripe's Python API`_

.. _`Stripe's Python API`: https://stripe.com/docs/libraries

Contributing
============

Please do.  Let me know.

Settings
========
Settings are described in the settings.py file:

 - STRIPE_SEND_RECEIPT: (True/False) - whether to send the payment receipt to the purchaser.
 - STRIPE_PUBLISHABLE_KEY: Your key from Stripe.
 - STRIPE_SECRET_KEY: Your secret key from Stripe.
 - STRIPE_COMPRESS_TO_ONE_LINE_ITEM (default True): If True, send the order to stripe as one combined line item, instead of one for each product.
 - STRIPE_USE_PRICES_API (default True): Use Stripe's Prices API to send line items, rather than the defunct line_item object.
   (See https://stripe.com/docs/payments/checkout/migrating-prices).
 - STRIPE_RETURN_URL_BASE: The common portion of the URL parts of the following two URLs.  Not used itself.
 - STRIPE_PAYMENT_SUCCESS_URL: The URL to which Stripe should redirect upon payment success.
 - STRIPE_PAYMENT_CANCEL_URL: The URL to which Stripe should redirect upon payment cancel.

Views
=====
Three urls are provided in apps.py. Three views are provided in the views.py file. 
 - StripeSCAPaymentDetailsView:  This sets up the variables which will be sent to Stripe and renders a templates which injects those variables and redirects to Stripe. Payment will be taken by Stripe as a "Charge" step.
 - StripeSCASuccessResponseView:  This is a form view that is loaded after a successful payment.  The "Place order" button is a form which ultimately tells Stripe to "capture" the payment.
 - StripeSCACancelResponseView:  This is the view that will be shown if the user cancels the payment for any reason.

The latter two views should be the views to which STRIPE_PAYMENT_SUCCESS_URL and STRIPE_PAYMENT_CANCEL_URL refer.

If you want to extend these views you can.  Extend Oscar's checkout app, add three new views to extend these ones, and overwrite the URLs in your checkout apps apps.py file.

=======================================================
Sandbox for the Stripe SCA integration for django-oscar
=======================================================

To get started with the sandbox (on Windows):

Create a venv.

.. code-block::

    >python -m venv .\venv


Activate the venv.

.. code-block::

    >.\venv\Scripts\activate

Install the dependencies, then Oscar Stripe SCA

.. code-block::

    >pip install -r requirements.txt
    >pip install .


Create a file called "settings_local.py" next to "settings.py" and add the following three keys to override the examples given in "settings.py".  These will be the values for your shop and site integration.

.. code-block::

	STRIPE_PUBLISHABLE_KEY = "XXX"
 	STRIPE_SECRET_KEY = "YYY"
 	STRIPE_RETURN_URL_BASE = "https://www.zzz.com"

Run the migrations and start the server:

.. code-block::

    >cd sandbox
    >python manage.py migrate
    >python manage.py runserver

TODO
====
 - The tests have not been updated yet.
 - The STRIPE_PAYMENT_SUCCESS_URL and STRIPE_PAYMENT_CANCEL_URL settings could probably be removed



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "django-oscar-stripe-sca",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Payment,Stripe",
    "author": "",
    "author_email": "Steve Bradshaw <steve@pcfive.co.uk>",
    "download_url": "",
    "platform": null,
    "description": "===================================\nStripe integration for django-oscar\n===================================\n\npip3 install django-oscar-stripe-sca\n\nThis is a framework for using Stripe Checkout with a view for being SCA compliant for payments\nin Europe after September 2019.  Requires the Python Stripe API (2.27), django 2 and above, django-oscar 2 and above. \nBased in part on django-oscar-stripe and django-oscar-paypal.\n\nUseful information:\n\n* `Stripe's Python API`_\n\n.. _`Stripe's Python API`: https://stripe.com/docs/libraries\n\nContributing\n============\n\nPlease do.  Let me know.\n\nSettings\n========\nSettings are described in the settings.py file:\n\n - STRIPE_SEND_RECEIPT: (True/False) - whether to send the payment receipt to the purchaser.\n - STRIPE_PUBLISHABLE_KEY: Your key from Stripe.\n - STRIPE_SECRET_KEY: Your secret key from Stripe.\n - STRIPE_COMPRESS_TO_ONE_LINE_ITEM (default True): If True, send the order to stripe as one combined line item, instead of one for each product.\n - STRIPE_USE_PRICES_API (default True): Use Stripe's Prices API to send line items, rather than the defunct line_item object.\n   (See https://stripe.com/docs/payments/checkout/migrating-prices).\n - STRIPE_RETURN_URL_BASE: The common portion of the URL parts of the following two URLs.  Not used itself.\n - STRIPE_PAYMENT_SUCCESS_URL: The URL to which Stripe should redirect upon payment success.\n - STRIPE_PAYMENT_CANCEL_URL: The URL to which Stripe should redirect upon payment cancel.\n\nViews\n=====\nThree urls are provided in apps.py. Three views are provided in the views.py file. \n - StripeSCAPaymentDetailsView:  This sets up the variables which will be sent to Stripe and renders a templates which injects those variables and redirects to Stripe. Payment will be taken by Stripe as a \"Charge\" step.\n - StripeSCASuccessResponseView:  This is a form view that is loaded after a successful payment.  The \"Place order\" button is a form which ultimately tells Stripe to \"capture\" the payment.\n - StripeSCACancelResponseView:  This is the view that will be shown if the user cancels the payment for any reason.\n\nThe latter two views should be the views to which STRIPE_PAYMENT_SUCCESS_URL and STRIPE_PAYMENT_CANCEL_URL refer.\n\nIf you want to extend these views you can.  Extend Oscar's checkout app, add three new views to extend these ones, and overwrite the URLs in your checkout apps apps.py file.\n\n=======================================================\nSandbox for the Stripe SCA integration for django-oscar\n=======================================================\n\nTo get started with the sandbox (on Windows):\n\nCreate a venv.\n\n.. code-block::\n\n    >python -m venv .\\venv\n\n\nActivate the venv.\n\n.. code-block::\n\n    >.\\venv\\Scripts\\activate\n\nInstall the dependencies, then Oscar Stripe SCA\n\n.. code-block::\n\n    >pip install -r requirements.txt\n    >pip install .\n\n\nCreate a file called \"settings_local.py\" next to \"settings.py\" and add the following three keys to override the examples given in \"settings.py\".  These will be the values for your shop and site integration.\n\n.. code-block::\n\n\tSTRIPE_PUBLISHABLE_KEY = \"XXX\"\n \tSTRIPE_SECRET_KEY = \"YYY\"\n \tSTRIPE_RETURN_URL_BASE = \"https://www.zzz.com\"\n\nRun the migrations and start the server:\n\n.. code-block::\n\n    >cd sandbox\n    >python manage.py migrate\n    >python manage.py runserver\n\nTODO\n====\n - The tests have not been updated yet.\n - The STRIPE_PAYMENT_SUCCESS_URL and STRIPE_PAYMENT_CANCEL_URL settings could probably be removed\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Stripe Checkout (with Payment Intents) payment module for django-oscar",
    "version": "0.6.1",
    "project_urls": {
        "Homepage": "https://github.com/st8st8/django-oscar-stripe-sca"
    },
    "split_keywords": [
        "payment",
        "stripe"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e3a02fe1f539f8b27616bdc3ec2add6d5945482807291d9034e1e9ca1578ae2f",
                "md5": "065663d6930d9a9c3bb7e48b84f2176e",
                "sha256": "11fd0b51455d3edd1a68e3519cce4d965ed4e44f21f9b2c4fd442dd690466443"
            },
            "downloads": -1,
            "filename": "django_oscar_stripe_sca-0.6.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "065663d6930d9a9c3bb7e48b84f2176e",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 11604,
            "upload_time": "2024-02-05T10:10:07",
            "upload_time_iso_8601": "2024-02-05T10:10:07.641376Z",
            "url": "https://files.pythonhosted.org/packages/e3/a0/2fe1f539f8b27616bdc3ec2add6d5945482807291d9034e1e9ca1578ae2f/django_oscar_stripe_sca-0.6.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-05 10:10:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "st8st8",
    "github_project": "django-oscar-stripe-sca",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "django-oscar-stripe-sca"
}
        
Elapsed time: 0.18048s