diff --git a/poetry.lock b/poetry.lock index 5ab3577..fbb73cc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "certifi" @@ -205,6 +205,20 @@ tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "python-dotenv" +version = "1.0.1" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.8" +files = [ + {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"}, + {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + [[package]] name = "requests" version = "2.31.0" @@ -257,4 +271,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "3f6c449228659ab834356507643a6e518be502930f969c9e2fe0d2df7a121764" +content-hash = "a61ff63c070f59f5b799e0097acab50a5aab1f18ed6cdc38c980cd907d1fb9f1" diff --git a/pyproject.toml b/pyproject.toml index a4346a8..2ab109f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,10 @@ requests = "^2.28.1" [tool.poetry.group.test.dependencies] pytest = "^7.2.0" + +[tool.poetry.group.dev.dependencies] +python-dotenv = "^1.0.1" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/src/nowpayments_api/models/payment.py b/src/nowpayments_api/models/payment.py index 77c3999..50674c5 100644 --- a/src/nowpayments_api/models/payment.py +++ b/src/nowpayments_api/models/payment.py @@ -36,7 +36,7 @@ class PaymentData(Base): # pylint: disable=too-many-instance-attributes payout_address: str = None payout_currency: str = None payout_extra_id: str = None - fixed_rate: bool = None + is_fixed_rate: bool = None is_fee_paid_by_user: bool = None diff --git a/src/nowpayments_api/nowpayments_api.py b/src/nowpayments_api/nowpayments_api.py index a709bfc..9117615 100644 --- a/src/nowpayments_api/nowpayments_api.py +++ b/src/nowpayments_api/nowpayments_api.py @@ -116,12 +116,10 @@ def create_payment( :param str ipn_callback_url: Url to receive callbacks, should contain "http" or "https". :param str order_id: Inner store order ID. :param str order_description: Inner store order description. - :param int purchase_id: id of purchase for which you want to create other payment, - only used for several payments for one order :param str payout_address: Receive funds on another address. :param str payout_currency: Currency of your external payout_address. :param int payout_extra_id: Extra id or memo or tag for external payout_address. - :param bool fixed_rate: Required for fixed-rate exchanges. + :param bool is_fixed_rate: Required for fixed-rate exchanges. :param bool is_fee_paid_by_user: Required for fixed-rate exchanges with all fees paid by users. :return: dict diff --git a/tests/test_nowpayments.py b/tests/test_nowpayments.py index 657c8f6..34e6d12 100644 --- a/tests/test_nowpayments.py +++ b/tests/test_nowpayments.py @@ -157,11 +157,10 @@ def test_create_payment_with_optional_paras( ipn_callback_url="https://example.org", order_id="Order_123456789", order_description="Roland TR-8S", - # purchase_id= "", # I do not understand official documentation # payout_address="d8dA6BF26964aF9D7eEd9e03E53415D37aA96045", # This always returns 400 # payout_currency="eth", # Returns 500 probably related to the 'payout_address' # payout_extra_id=0xbeef, # Returns same error as payout_currency - fixed_rate=True, + is_fixed_rate=True, is_fee_paid_by_user=True, ) assert "payment_id" in response @@ -441,7 +440,7 @@ def test_get_list_of_payments_sort_paras_error( now_payments_email_password.list_of_payments(sort_by="invalid_sort_parameter") -def test_get_list_of_payments_sort_paras_error( +def test_get_list_of_payments_order_paras_error( now_payments_email_password: NOWPaymentsAPI, ) -> None: with pytest.raises(NowPaymentsException, match="Invalid order parameter"):