Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading package to M4 #11

Open
wants to merge 33 commits into
base: 4.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bf677e7
start upgrading layout
girardinsamuel Oct 29, 2021
da2ce1a
Fixed install steps
josephmancuso Oct 29, 2021
24e41bf
upgraded masonite billing to M4
josephmancuso Oct 29, 2021
d3ba19f
update requirements for M4
girardinsamuel Oct 30, 2021
1904659
Merge branch 'upgrade/masonite4' of github.com:MasoniteFramework/bill…
girardinsamuel Oct 30, 2021
ad9a188
refactor to use drivers
girardinsamuel Oct 30, 2021
02a8b33
clean code
girardinsamuel Oct 30, 2021
a8995f4
update .gitignore
girardinsamuel Oct 30, 2021
3fd7a45
update package files
girardinsamuel Oct 30, 2021
409ae4d
update lint and setup file
girardinsamuel Oct 30, 2021
a4326ed
lint
girardinsamuel Oct 30, 2021
3f1cec2
update gitub ci config
girardinsamuel Oct 30, 2021
4f94e62
remove git submodule which were there for no reason
girardinsamuel Oct 30, 2021
9cac602
fix readme description
girardinsamuel Oct 30, 2021
50c8e4d
Create __init__.py
josephmancuso Oct 31, 2021
f1badba
Update WebhookController.py
josephmancuso Oct 31, 2021
d3c8972
bump
josephmancuso Oct 31, 2021
13eb6dc
added env
josephmancuso Oct 31, 2021
e21c544
fix loading secrets in github ci
girardinsamuel Nov 1, 2021
5172d48
update key not found message
girardinsamuel Nov 1, 2021
e2e6c1f
fix linting
girardinsamuel Nov 1, 2021
9863159
debug
girardinsamuel Nov 1, 2021
61fd9a8
try to use normal env loaded before masonite one
girardinsamuel Nov 1, 2021
3503919
debug
girardinsamuel Nov 1, 2021
0daab4a
debug again
girardinsamuel Nov 1, 2021
0c348e0
remove value in copied .env which will we override the current env
girardinsamuel Nov 1, 2021
27b6fa8
remove debug statements
girardinsamuel Nov 1, 2021
4c38772
apply migrations before running tests in ci
girardinsamuel Nov 1, 2021
780c7c5
fix lint
girardinsamuel Nov 1, 2021
c5a1bb0
fix serialization of datetime before saving
girardinsamuel Nov 7, 2021
2d5cf36
fix providers
girardinsamuel Nov 7, 2021
498b245
fix pendulum method name
girardinsamuel Nov 7, 2021
b8920a8
fix tests
girardinsamuel Nov 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
DB_DATABASE=test.db
DB_DRIVER=sqlite
DB_CONNECTION=sqlite

STRIPE_CLIENT=
STRIPE_SECRET=
DB_CONFIG_PATH=tests/integrations/config/database
50 changes: 27 additions & 23 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,37 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.5', '3.6', '3.7', '3.8' ]
python-version: ["3.7", "3.8", "3.9", "3.10"]
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make init
- name: Test with pytest
run: |
make test
- name: Install dependencies
run: |
make init
- name: Apply migrations
run: |
masonite-orm migrate -C tests/integrations/config/database -d tests/integrations/databases/migrations
- name: Test with pytest
env:
STRIPE_SECRET: ${{ secrets.STRIPE_SECRET }}
STRIPE_CLIENT: ${{ secrets.STRIPE_CLIENT }}
run: |
make test
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Intall Flake8
run: |
pip install flake8
- name: Lint
run: make lint


- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Intall Flake8
run: |
pip install flake8
- name: Lint
run: make lint
36 changes: 18 additions & 18 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
make init
make test
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
make init
make test
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
25 changes: 17 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
venv
masonite_billing.egg-info
venv2
.python-version
.vscode
.cache
.env
dist
.pytest_cache
.idea/
build/
.pypirc
.coverage
coverage.xml
.pytest_*
**/*__pycache__*
**/*.DS_Store*
**.pyc

# local test
test.db
dist
.env
*.db
masonite_billing.egg-info
node_modules
tests/integrations/storage/compiled/
storage/logs/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021, Joseph Mancuso

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
init:
cp .env-example .env
pip install --upgrade pip
pip install .
pip install ".[test]"
pip install -r requirements.txt
pip install pytest
test:
orator migrate -p tests/migrations -c config/database.py -f
python -m pytest tests
ci:
make test
make lint
lint:
python -m flake8 billing/ --ignore=E501,F401,E128,E402,E731,F821,E712,W503
python -m flake8 .
format:
black billing
black .
coverage:
python -m pytest --cov-report term --cov-report xml --cov=billing tests/
python -m pytest --cov-report term --cov-report xml --cov=src/masonite/billing tests/
python -m coveralls
publish:
pip install 'twine>=1.5.0'
python setup.py sdist bdist_wheel
twine upload dist/*
rm -fr build dist .egg masonite.egg-info
rm -fr build dist .egg src/masonite_billing.egg-info

70 changes: 67 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,68 @@
# Masonite billing package
<p align="center">
<img src="https://banners.beyondco.de/Masonite%20Billing.png?theme=light&packageManager=pip+install&packageName=masonite-billing&pattern=topography&style=style_1&description=Masonite%20billing%20management&md=1&showWatermark=1&fontSize=100px&images=https%3A%2F%2Fgblobscdn.gitbook.com%2Fspaces%2F-L9uc-9XAlqhXkBwrLMA%2Favatar.png">
</p>

[Github Actions status](https://github.com/MasoniteFramework/billing/workflows/Test%20Application/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/MasoniteFramework/billing/badge.svg?branch=master)](https://coveralls.io/github/MasoniteFramework/billing?branch=master)
<p align="center">
<a href="https://docs.masoniteproject.com">
<img alt="Masonite Package" src="https://img.shields.io/static/v1?label=Masonite&message=package&labelColor=grey&color=blue&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAA6gAwAEAAAAAQAAAA4AAAAATspU+QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAnxJREFUKBVNUl1IVEEUPjPObdd1VdxWM0rMIl3bzbVWLSofVm3th0AhMakHHyqRiNSHEAq5b2HSVvoQRUiEECQUQkkPbRslRGigG8auoon2oPSjpev+3PWeZq7eaC5nDt93vplz5txDQJYpNxX4st4JFiwj9aCqmswUFQNS/A2YskrZJPYefkECC2GhQwAqvLYybwXrwBvq8HSNOXRO92+aH7nW8vc/wS2Z9TqneYt2KHjlf9Iv+43wFJMExzO0YE5OKe60N+AOW6OmE+WJTBrg23jjzWxMBauOlfyycsV24F+cH+zAXYUOGl+DaiDxfl245/W9OnVrSY+O2eqPkyz4sVvHoKp9gOihf5KoAVv3hkQgbj/ihG9fI3RixKcUVx7lJVaEc0vnyf2FFll+ny80ZHZiGhIKowWJBCEAKr+FSuNDLt+lxybSF51lo74arqs113dOZqwsptxNs5bwi7Q3q8npSC2AWmvjTncZf1l61e5DEizNn5mtufpsqk5+CZTuq00sP1wkNPv8jeEikVVlJso+GEwRtNs3QeBt2YP2V2ZI3Tx0e+7T89zK5tNASOLEytJAryGtkLc2PcBM5byyUWYkMQpMioYcDcchC6xN220Iv36Ot8pV0454RHLEwmmD7UWfIdX0zq3GjMPG5NKBtv5qiPEPekK2U51j1451BZoc3i+1ohSQ/UzzG5uYFFn2mwVUnO4O3JblXA91T51l3pB3QweDl7sNXMyEjbguSjrPcQNmwDkNc8CbCvDd0+xCC7RFi9wFulD3mJeXqxQevB4prrqgc0TmQ85NG/K43e2UwnMVAJIEBNfWRYR3HfnvivrIzMyo4Hgy+hfscvLo53jItAAAAABJRU5ErkJggg==">
</a>
<img alt="GitHub Workflow Status (branch)" src="https://img.shields.io/github/workflow/status/MasoniteFramework/billing/Test%20Application/master">
<img src="https://codecov.io/gh/MasoniteFramework/billing/branch/master/graph/badge.svg?token=7W8Y6UVUAT"/>
<img src="https://img.shields.io/badge/python-3.6+-blue.svg" alt="Python Version">
<img alt="PyPI" src="https://img.shields.io/pypi/v/masonite-billing">
<img alt="License" src="https://img.shields.io/github/license/MasoniteFramework/billing">
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>

## Introduction

Easily use Stripe's subscription billing services in your Masonite app. It can handle all of the boilerplate subscription billing code.

[Documentation 📚](#)

## Official Masonite Documentation

New to Masonite ? Please first read the [Official Documentation](https://docs.masoniteproject.com/).
Masonite strives to have extremely comprehensive documentation 😃. It would be wise to go through the tutorials there.
If you find any discrepencies or anything that doesn't make sense, be sure to comment directly on the documentation to start a discussion!

Also be sure to join the [Slack channel](http://slack.masoniteproject.com/)!

## Installation

```bash
pip install masonite-billing
```

## Configuration

Add BillingProvider to your project in `config/providers.py`:

```python
# config/providers.py
# ...
from masonite.billing import BillingProvider

# ...
PROVIDERS = [
# ...

# Third Party Providers
BillingProvider,
]
```

Define your users as billable:

```python
from masonite.billing import Billable

class User(Billable):

```

Finally publish the package configuration (to get `config/billing.py`) to your project:

```bash
python craft install:billing
```
127 changes: 0 additions & 127 deletions billing/contracts/BillingProcessorContract.py

This file was deleted.

1 change: 0 additions & 1 deletion billing/contracts/__init__.py

This file was deleted.

2 changes: 0 additions & 2 deletions billing/exceptions.py

This file was deleted.

Loading