From a7ddd9a41ea99abe2f5de24494f08ed5423fc126 Mon Sep 17 00:00:00 2001 From: muhamad Date: Thu, 6 Mar 2025 13:53:56 +0300 Subject: [PATCH 1/2] FIBAS-1460-add-redirect-uri-for-python-package --- src/fib_payments/client.py | 6 ++++-- tests/test_fib_payments_client.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fib_payments/client.py b/src/fib_payments/client.py index 6931286..e51ed34 100644 --- a/src/fib_payments/client.py +++ b/src/fib_payments/client.py @@ -50,12 +50,14 @@ async def _request(self, method: str, endpoint: str, **kwargs) -> Dict[str, Any] return response.json() async def create_payment(self, amount: float, currency: Optional[str] = None, - callback_url: Optional[str] = None, - description: Optional[str] = None) -> Dict[str, Any]: + callback_url: Optional[str] = None, + description: Optional[str] = None, + redirect_uri: Optional[str] = None) -> Dict[str, Any]: """Create a new payment.""" data = { 'monetaryValue': {'amount': amount, 'currency': currency or self.config.currency}, 'statusCallbackUrl': callback_url or self.config.callback_url, + 'redirectUri': redirect_uri or '', 'description': description or '', 'refundableFor': self.config.refundable_for, } diff --git a/tests/test_fib_payments_client.py b/tests/test_fib_payments_client.py index 7622094..fd2a70f 100644 --- a/tests/test_fib_payments_client.py +++ b/tests/test_fib_payments_client.py @@ -80,7 +80,7 @@ async def test_request_failure(client, mock_http_client): async def test_create_payment(client): client._request = AsyncMock(return_value={'id': 'payment_id'}) - result = await client.create_payment(100.0, 'EUR', 'https://custom-callback.com', 'Test payment') + result = await client.create_payment(100.0, 'EUR', 'https://custom-callback.com', 'Test payment', 'https://custom-redirect-uri.com') assert result == {'id': 'payment_id'} client._request.assert_called_once_with( @@ -89,6 +89,7 @@ async def test_create_payment(client): json={ 'monetaryValue': {'amount': 100.0, 'currency': 'EUR'}, 'statusCallbackUrl': 'https://custom-callback.com', + 'redirectUri': 'https://custom-redirect-uri.com', 'description': 'Test payment', 'refundableFor': client.config.refundable_for, } From 47b05960ff40f1c4bea7f79cb1ecd3708a3672dc Mon Sep 17 00:00:00 2001 From: muhamad Date: Sun, 9 Mar 2025 14:02:47 +0300 Subject: [PATCH 2/2] fixed --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d95b4e9..dd00787 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="fib-python-payment-sdk", - version='0.1.10', + version='0.2.0', description="SDK for integrating with the FIB payment system, enabling user authentication and payment " "transactions.", long_description=long_description,