Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Rename order method on Payments #43

Merged
merged 1 commit into from
Dec 31, 2021
Merged
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
2 changes: 1 addition & 1 deletion duffel_api/api/booking/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _validate_payment(payment):
if payment["type"] not in ["arc_bsp_cash", "balance", "payments"]:
raise PaymentClient.InvalidPaymentType(payment["type"])

def order_id(self, order_id):
def order(self, order_id):
self._order_id = order_id
return self

Expand Down
4 changes: 2 additions & 2 deletions tests/test_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_create_payment(requests_mock):
}
payment = (
client.payments.create()
.order_id("order-id")
.order("order-id")
.payment(payment_details)
.execute()
)
Expand All @@ -32,7 +32,7 @@ def test_create_payment_with_invalid_payment_details(requests_mock):
"currency": "GBP",
"amount": "30.20",
}
payments_create_client = client.payments.create().order_id("order-id")
payments_create_client = client.payments.create().order("order-id")
with pytest.raises(
PaymentClient.InvalidPayment,
match="{'currency': 'GBP', 'amount': '30.20'}",
Expand Down