What's happening
Transactions.create() (actionkit/transactions.py:97):
order_uri = order_uri or Orders.get_resource_uri_from_id(order_id)
get_resource_uri_from_id is inherited from HttpMethods:
def get_resource_uri_from_id(self, resource_id):
return self.connection.get_resource_uri_from_id(resource_id, self.resource_name)
It's an instance method. Calling it as Orders.get_resource_uri_from_id(order_id) — unbound, on the Orders class rather than an Orders instance — binds order_id to the method's self parameter and leaves the real resource_id parameter unfilled. This raises:
TypeError: get_resource_uri_from_id() missing 1 required positional argument: 'resource_id'
Impact
Transactions.create(order_id=..., ...) (i.e. any caller that supplies order_id instead of order_uri) is currently completely broken — it never reaches the network.
Contrast with the correct pattern elsewhere in the codebase, e.g. actionkit/orders.py:23:
resource_uri = self.get_resource_uri_from_id(resource_id)
Suggested fix
order_uri = order_uri or self.connection.get_resource_uri_from_id(order_id, "order")
or construct an Orders(self.connection) instance and call the bound method on it.
Test coverage
Pinned (not fixed) by tests/test_transactions.py::test_create_with_order_id_is_broken, which asserts the current TypeError. That test should be updated to assert success once this is fixed.
What's happening
Transactions.create()(actionkit/transactions.py:97):get_resource_uri_from_idis inherited fromHttpMethods:It's an instance method. Calling it as
Orders.get_resource_uri_from_id(order_id)— unbound, on theOrdersclass rather than anOrdersinstance — bindsorder_idto the method'sselfparameter and leaves the realresource_idparameter unfilled. This raises:Impact
Transactions.create(order_id=..., ...)(i.e. any caller that suppliesorder_idinstead oforder_uri) is currently completely broken — it never reaches the network.Contrast with the correct pattern elsewhere in the codebase, e.g.
actionkit/orders.py:23:Suggested fix
or construct an
Orders(self.connection)instance and call the bound method on it.Test coverage
Pinned (not fixed) by
tests/test_transactions.py::test_create_with_order_id_is_broken, which asserts the currentTypeError. That test should be updated to assert success once this is fixed.