Skip to content

Commit

Permalink
use post method instead of put for retry invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
annvelents committed Sep 10, 2024
1 parent 4af3421 commit 30aebc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lago_python_client/invoices/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def refresh(self, resource_id: str) -> InvoiceResponse:
)

def retry(self, resource_id: str) -> InvoiceResponse:
api_response: Response = send_put_request(
api_response: Response = send_post_request(
url=make_url(
origin=self.base_url,
path_parts=(self.API_RESOURCE, resource_id, 'retry'),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_invoice_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def test_valid_refresh_invoice_request(httpx_mock: HTTPXMock):
def test_valid_retry_invoice_request(httpx_mock: HTTPXMock):
client = Client(api_key='886fe239-927d-4072-ab72-6dd345e8dd0d')

httpx_mock.add_response(method='PUT', url='https://api.getlago.com/api/v1/invoices/5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba/retry', content=mock_response())
httpx_mock.add_response(method='POST', url='https://api.getlago.com/api/v1/invoices/5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba/retry', content=mock_response())
response = client.invoices.retry('5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba')

assert response.lago_id == '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba'
Expand Down

0 comments on commit 30aebc6

Please sign in to comment.