Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/nowpayments_api/models/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 1 addition & 3 deletions src/nowpayments_api/nowpayments_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions tests/test_nowpayments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"):
Expand Down