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

Commit

Permalink
Merge pull request #43 from duffelhq/order-payments-rename-order
Browse files Browse the repository at this point in the history
Rename `order` method on Payments
  • Loading branch information
sgerrand authored Dec 31, 2021
2 parents 1029b92 + 85c1f35 commit 7393dbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 7393dbc

Please sign in to comment.