From 6f76d67da10a48511d144fd02b9516a2274dd2ee Mon Sep 17 00:00:00 2001 From: pmaryska Date: Thu, 11 Jul 2024 15:26:01 +0200 Subject: [PATCH 1/3] Added BNPL payment method --- gopay/enums.py | 2 ++ tests/conftest.py | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gopay/enums.py b/gopay/enums.py index 1dc772d..c6e9dbb 100644 --- a/gopay/enums.py +++ b/gopay/enums.py @@ -82,6 +82,8 @@ class PaymentInstrument(StrEnum): ACCOUNT = "ACCOUNT" APPLE_PAY = "APPLE_PAY" CLICK_TO_PAY = "CLICK_TO_PAY" + TWISTO = "TWISTO" + SKIPPAY = "SKIPPAY" class StatementGeneratingFormat(StrEnum): diff --git a/tests/conftest.py b/tests/conftest.py index 35d4a46..de754b5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -61,13 +61,18 @@ def base_payment() -> dict: "allowed_payment_instruments": [ PaymentInstrument.BANK_ACCOUNT, PaymentInstrument.PAYMENT_CARD, + # PaymentInstrument.TWISTO, + # PaymentInstrument.SKIPPAY ], + # "default_payment_instrument": PaymentInstrument.TWISTO, "allowed_swifts": [ BankSwiftCode.CESKA_SPORITELNA, BankSwiftCode.RAIFFEISENBANK, ], - #'default_swift': BankSwiftCode.CESKA_SPORITELNA, - #'default_payment_instrument': PaymentInstrument.BANK_ACCOUNT, + # "allowed_bnpl_types": ["THIRDS", "LATER"], + # "default_bnpl_type": "THIRDS", + "default_swift": BankSwiftCode.CESKA_SPORITELNA, + "default_payment_instrument": PaymentInstrument.BANK_ACCOUNT, "contact": { "email": "test.test@gopay.cz", }, From bdff167c151e1b9a1271dfd414dc68e66060f846 Mon Sep 17 00:00:00 2001 From: pmaryska Date: Thu, 29 Aug 2024 15:22:25 +0200 Subject: [PATCH 2/3] Added BnplType enum --- gopay/enums.py | 4 ++++ tests/conftest.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gopay/enums.py b/gopay/enums.py index c6e9dbb..5194bb0 100644 --- a/gopay/enums.py +++ b/gopay/enums.py @@ -271,3 +271,7 @@ class PaymentSubStatus(StrEnum): class ContentType(StrEnum): FORM = "application/x-www-form-urlencoded" JSON = "application/json" + +class BnplType(StrEnum): + DEFERRED_PAYMENT = "DEFERRED_PAYMENT" + PAY_IN_THREE = "PAY_IN_THREE" diff --git a/tests/conftest.py b/tests/conftest.py index de754b5..a701c9c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,7 @@ import pytest import gopay -from gopay.enums import BankSwiftCode, Currency, Language, PaymentInstrument +from gopay.enums import BankSwiftCode, Currency, Language, PaymentInstrument, BnplType from gopay.http import Request, Response @@ -69,8 +69,8 @@ def base_payment() -> dict: BankSwiftCode.CESKA_SPORITELNA, BankSwiftCode.RAIFFEISENBANK, ], - # "allowed_bnpl_types": ["THIRDS", "LATER"], - # "default_bnpl_type": "THIRDS", + # "allowed_bnpl_types": [BnplType.DEFERRED_PAYMENT, BnplType.PAY_IN_THREE], + # "default_bnpl_type": BnplType.DEFERRED_PAYMENT, "default_swift": BankSwiftCode.CESKA_SPORITELNA, "default_payment_instrument": PaymentInstrument.BANK_ACCOUNT, "contact": { From 15d59f77b856d18893f9928d156dca25ade775a8 Mon Sep 17 00:00:00 2001 From: pmaryska Date: Fri, 6 Sep 2024 13:17:40 +0200 Subject: [PATCH 3/3] Final BNPL version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b7e872b..05242da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ name = "gopay" packages = [{include = "gopay"}] readme = "README.md" repository = "https://github.com/gopaycommunity/gopay-python-api" -version = "2.1.0" +version = "2.2.0" [tool.poetry.dependencies] deprecated = "^1.2.14"