Metadata-Version: 2.1
Name: django-purchase-core
Version: 0.1.5
Summary: A reusable Django app for creating, logging and verifying purchases.
Home-page: https://github.com/boy-scouts/game-core-purchase
License: MIT
Author: Qmobi
Author-email: info@qmobi.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: Django (>=4.0.1,<5.0.0)
Requires-Dist: Pygments (>=2.10.0,<3.0.0)
Requires-Dist: django-admin-rangefilter (>=0.8.1,<0.9.0)
Requires-Dist: django-filter (>=2.4.0,<3.0.0)
Requires-Dist: djangorestframework (>=3.12.4,<4.0.0)
Requires-Dist: google (>=3.0.0,<4.0.0)
Requires-Dist: google-api-python-client (>=2.21.0,<3.0.0)
Requires-Dist: google-auth (>=2.1.0,<3.0.0)
Requires-Dist: google-auth-oauthlib (>=0.4.6,<0.5.0)
Requires-Dist: requests (>=2.26.0,<3.0.0)
Project-URL: Repository, https://github.com/boy-scouts/game-core-purchase
Description-Content-Type: text/x-rst

Purchase Core
===============

A reusable Django app for creating, logging and verifying purchases.

Quick start
-----------

1. Install Django Purchase Core & Dependancies:

    >>> pip install django-purchase-core


2. Add "purchase", "rest_framework', and "rangefilter" to your INSTALLED_APPS setting like this:

.. code:: python

        INSTALLED_APPS = [
            ...,
            'rest_framework',
            'purchase',
            'rangefilter',
            ...,
        ]

3. Add the following to app_config.urls:

.. code:: python

    from django.conf.urls import url, include

    urlpatterns = [
        ...,
        path("api/", include("purchase.urls")),
        ...,
    ]


4. Run Django Commands:

    >>> python manage.py makemigrations
    >>> python manage.py migrate


5. Configure configuration and credentials for your game in the admin panel.

Add progress level update processing
-------------------------------------

1. Set update_player_progress_class in ProcessPurchaseView

.. code:: python

        from purchase.view import ProcessPurchaseView
        from my_app import UpdateClass

        class ProcessPurchaseViewWithUpdate(ProcessPurchaseView):
            update_player_progress_class = UpdateClass

2. Describe the player's update logic in the update_player_progress method

.. code:: python

        from purchase.view import ProcessPurchaseView
        from my_app import UpdateClass

        class ProcessPurchaseViewWithUpdate(ProcessPurchaseView):
            update_player_progress_class = UpdateClass

            def update_player_progress(self):
                handler = self.update_player_progress_class()
                handler.update_player_progress()

