Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
pequeños updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofix committed Sep 24, 2024
1 parent be54385 commit baa53cf
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 54 deletions.
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{html,py,json,md}]
charset = utf-8

[*.py]
indent_style = space
indent_size = 4
max_line_length = 119

[*.md]
indent_style = space
indent_size = 4
max_line_length = 119

[*.html]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab

[*.json]
indent_style = space
indent_size = 2
15 changes: 2 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,13 @@ repos:
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: "7.1.1"
hooks:
- id: flake8
additional_dependencies:
- flake8-comprehensions
- toml
exclude: docs\/.*
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: "24.8.0"
hooks:
- id: black
- repo: https://github.com/hhatto/autopep8
rev: v2.3.1
hooks:
- id: autopep8
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ creación, confirmación y expiración de pagos realizados a través de Khipu. E
módulo proporciona integración con la API de Khipu para facilitar el
procesamiento y gestión de pagos en tu aplicación web Django.

![PyPI - Status](https://img.shields.io/pypi/status/django-payments-khipu)
[![Downloads](https://pepy.tech/badge/django-payments-khipu)](https://pepy.tech/project/django-payments-khipu)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/7dc3c8d6fe844fdaa1de0cb86c242934)](https://app.codacy.com/gh/mariofix/django-payments-khipu/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/7dc3c8d6fe844fdaa1de0cb86c242934)](https://app.codacy.com/gh/mariofix/django-payments-khipu/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/mariofix/django-payments-khipu/main.svg)](https://results.pre-commit.ci/latest/github/mariofix/django-payments-khipu/main)
![PyPI](https://img.shields.io/pypi/v/django-payments-khipu)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-payments-khipu)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/django-payments-khipu)
![PyPI - License](https://img.shields.io/pypi/l/django-payments-khipu)
![PyPI - Status](https://img.shields.io/pypi/status/django-payments-khipu)



## Introducción
Expand Down
14 changes: 12 additions & 2 deletions django_payments_khipu/KhipuProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ class KhipuProvider(BasicProvider):
bank_id: str | None = None
_client: Any = None

def __init__(self, receiver_id: str, secret: str, use_notification: str | None, bank_id: str | None, **kwargs):
def __init__(
self,
receiver_id: str,
secret: str,
use_notification: str | None,
bank_id: str | None,
**kwargs,
):
"""
Inicializa una instancia de KhipuProvider con el ID de receptor y el secreto de Khipu proporcionados.
Expand Down Expand Up @@ -70,7 +77,10 @@ def get_form(self, payment, data: dict | None = None) -> Any:
datos_para_khipu.update(**self._extra_data(payment.attrs))
try:
payment = self._client.payments.post(
payment.description, payment.currency, int(payment.total), **datos_para_khipu
payment.description,
payment.currency,
int(payment.total),
**datos_para_khipu,
)

except (ValidationError, AuthorizationError, ServiceError) as pe:
Expand Down
1 change: 1 addition & 0 deletions docs/uso.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ modelo de Pagos.

Por ejemplo, si deseas enviar el nombre del cliente en cada compra, puedes
utilizar el siguiente código:

```python
datos_extra: dict = {
"payer_name": "Nombre de Cliente",
Expand Down
63 changes: 26 additions & 37 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,86 +1,75 @@
[tool.poetry]
name = "django-payments-khipu"
version = "0.1.3"
version = "2024.9.23"
description = "Soporte Khipu para Django Payments"
authors = ["Mario Hernandez <[email protected]>"]
license = "MIT"
readme = "README.md"
packages = [{include = "django_payments_khipu"}]
packages = [{ include = "django_payments_khipu" }]
repository = "https://github.com/mariofix/django-payments-khipu"
documentation = "https://mariofix.github.io/django-payments-khipu/"
homepage = "https://www.khipu.com/page/guia-de-implementacion/"
keywords = [
"khipu",
"pagos",
"django",
"payment",
"django-payments"
]
classifiers=[
"Development Status :: 2 - Pre-Alpha",
keywords = ["khipu", "pagos", "django", "payment", "django-payments", "pago"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Topic :: Software Development :: Libraries :: Python Modules",
"Framework :: Django",
"Operating System :: OS Independent"
"Operating System :: OS Independent",
]

[tool.poetry.dependencies]
python = "^3.8.1"
pykhipu = "0.1.9"
django-payments = "2.0.0"
python = "^3.9"
pykhipu = "<=0.1.9"
django-payments = ">=2.0.0, <=3.1"

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.3.3"
black = "^23.3.0"
isort = "^5.12.0"
coverage = "^7.2.7"
pytest = "^7.4.0"
faker = "^18.13.0"
pre-commit = "^3.8.0"
black = "^24.8.0"
isort = "^5.13.2"
coverage = "^7.6.1"
pytest = "^8.3.3"
faker = "^29.0.0"

[tool.poetry.group.docs]
optional = true


[tool.poetry.group.docs.dependencies]
mkdocs = "^1.4.3"
mkdocs-material = "^9.1.18"
mkdocstrings = {extras = ["python"], version = "^0.22.0"}
mkdocs-git-revision-date-localized-plugin = "^1.2.0"
mkdocs-git-committers-plugin-2 = "^1.1.2"
# mkdocs = "^1.4.3"
# mkdocs-material = "^9.1.18"
# mkdocstrings = { extras = ["python"], version = "^0.22.0" }
# mkdocs-git-revision-date-localized-plugin = "^1.2.0"
# mkdocs-git-committers-plugin-2 = "^1.1.2"
pillow = "^10.0.0"
cairosvg = "^2.7.0"
lxml = "^4.9.3"



[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "tests.django_settings"
minversion = "6.0"
addopts = "-ra"
testpaths = [
"tests",
]
python_files =[
"test*.py"
]
testpaths = ["tests"]
python_files = ["test*.py"]

[tool.black]
line-length = 120
target-version = ['py38']
line-length = 119
target-version = ['py39']

[tool.isort]
profile = "black"
multi_line_output = 3
py_version = 38
py_version = 39

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit baa53cf

Please sign in to comment.