Skip to content

Commit 98795c0

Browse files
committed
Create payment menthod and generate QR Code
1 parent 28c9ae9 commit 98795c0

File tree

21 files changed

+723
-0
lines changed

21 files changed

+723
-0
lines changed

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Upload Python Package to PyPI when a Release is Created
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
pypi-publish:
9+
name: Publish release to PyPI
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/pretix-pix-openpix
14+
permissions:
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.13"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install setuptools wheel
26+
- name: Build package
27+
run: |
28+
python -m build
29+
- name: Publish package distributions to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/style.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Code Style
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths-ignore:
7+
- 'pretix_pix_openpix/locale/**'
8+
- 'pretix_pix_openpix/static/**'
9+
pull_request:
10+
branches: [ main, master ]
11+
paths-ignore:
12+
- 'pretix_pix_openpix/locale/**'
13+
- 'pretix_pix_openpix/static/**'
14+
15+
jobs:
16+
linter-and-formatting:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-python@v2
21+
with:
22+
python-version: "3.13"
23+
- name: Install dependencies
24+
run: pip install pre-commit
25+
- name: Check pre-commit hooks
26+
run: pre-commit run --all

.github/workflows/tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths-ignore:
7+
- 'pretix_pix_openpix/locale/**'
8+
pull_request:
9+
branches: [ main, master ]
10+
paths-ignore:
11+
- 'pretix_pix_openpix/locale/**'
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
name: Tests
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python 3.11
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: 3.11
23+
- uses: actions/cache@v4
24+
with:
25+
path: ~/.cache/pip
26+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
27+
restore-keys: |
28+
${{ runner.os }}-pip-
29+
- name: Install system dependencies
30+
run: sudo apt update && sudo apt install gettext
31+
- name: Install pretix
32+
run: pip3 install pretix
33+
- name: Install Dependencies
34+
run: pip3 install pytest pytest-django -Ue .
35+
- name: Run checks
36+
run: py.test tests

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ target/
6161

6262
#Ipython Notebook
6363
.ipynb_checkpoints
64+
65+
.venv

.pre-commit-config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-case-conflict
6+
fail_fast: true
7+
- id: check-merge-conflict
8+
fail_fast: true
9+
- id: debug-statements
10+
fail_fast: true
11+
- id: detect-private-key
12+
fail_fast: true
13+
14+
- repo: https://github.com/psf/black
15+
rev: 25.1.0
16+
hooks:
17+
- id: black
18+
fail_fast: true
19+
20+
- repo: https://github.com/pycqa/isort
21+
rev: 6.0.1
22+
hooks:
23+
- id: isort
24+
fail_fast: true
25+
args: ["--profile", "black", "--filter-files"]
26+
27+
- repo: https://github.com/charliermarsh/ruff-pre-commit
28+
rev: 'v0.12.5'
29+
hooks:
30+
- id: ruff
31+
fail_fast: true
32+
args: ["--ignore", "E501"]
33+
34+
- repo: https://github.com/PyCQA/bandit
35+
rev: 1.8.6
36+
hooks:
37+
- id: bandit
38+
fail_fast: true
39+
args: ["-ll"]

.update-locales.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/sh
2+
COMPONENTS=pretix/pretix-plugin-pretix-pix-openpix
3+
DIR=pretix_pix_openpix/locale
4+
# Renerates .po files used for translating the plugin
5+
set -e
6+
set -x
7+
8+
# Lock Weblate
9+
for c in $COMPONENTS; do
10+
wlc lock $c;
11+
done
12+
13+
# Push changes from Weblate to GitHub
14+
for c in $COMPONENTS; do
15+
wlc commit $c;
16+
done
17+
18+
# Pull changes from GitHub
19+
git pull --rebase
20+
21+
# Update po files itself
22+
make localegen
23+
24+
# Commit changes
25+
git add $DIR/*/*/*.po
26+
git add $DIR/*.pot
27+
28+
git commit -s -m "Update po files
29+
[CI skip]"
30+
31+
# Push changes
32+
git push
33+
34+
# Unlock Weblate
35+
for c in $COMPONENTS; do
36+
wlc unlock $c;
37+
done

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
recursive-include pretix_pix_openpix/static *
2+
recursive-include pretix_pix_openpix/templates *
3+
recursive-include pretix_pix_openpix/locale *
4+
include LICENSE

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
all: localecompile
2+
LNGS:=`find pretix_pix_openpix/locale/ -mindepth 1 -maxdepth 1 -type d -printf "-l %f "`
3+
4+
localecompile:
5+
django-admin compilemessages
6+
7+
localegen:
8+
django-admin makemessages --keep-pot -i build -i dist -i "*egg*" $(LNGS)
9+
10+
.PHONY: all localecompile localegen

pretix_pix_openpix/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.0.1"

pretix_pix_openpix/apps.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from django.utils.translation import gettext_lazy
2+
3+
from . import __version__
4+
5+
try:
6+
from pretix.base.plugins import PluginConfig
7+
except ImportError:
8+
raise RuntimeError("Please use pretix 2.7 or above to run this plugin!")
9+
10+
11+
class PluginApp(PluginConfig):
12+
default = True
13+
name = "pretix_pix_openpix"
14+
verbose_name = "Brazilian Pix - OpenPix integration"
15+
16+
class PretixPluginMeta:
17+
name = gettext_lazy("Brazilian Pix - OpenPix integration")
18+
author = "Renne Rocha"
19+
description = gettext_lazy("Brazilian Pix - OpenPix integration")
20+
visible = True
21+
version = __version__
22+
category = "PAYMENT"
23+
compatibility = "pretix>=2.7.0"
24+
settings_links = []
25+
navigation_links = []
26+
27+
def ready(self):
28+
from . import signals # NOQA

0 commit comments

Comments
 (0)