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, 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, }