Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix argument name conflict #592

Merged
merged 1 commit into from
Jul 8, 2019
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
8 changes: 5 additions & 3 deletions stripe/api_resources/abstract/api_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ def instance_url(self):
extn = quote_plus(id)
return "%s/%s" % (base, extn)

# The `method_` and `url_` arguments are suffixed with an underscore to
# avoid conflicting with actual request parameters in `params`.
@classmethod
def _static_request(
cls,
method,
url,
method_,
url_,
api_key=None,
idempotency_key=None,
stripe_version=None,
Expand All @@ -59,7 +61,7 @@ def _static_request(
api_key, api_version=stripe_version, account=stripe_account
)
headers = util.populate_headers(idempotency_key)
response, api_key = requestor.request(method, url, params, headers)
response, api_key = requestor.request(method_, url_, params, headers)
return util.convert_to_stripe_object(
response, api_key, stripe_version, stripe_account
)
4 changes: 3 additions & 1 deletion tests/api_resources/test_webhook_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def test_is_saveable(self, request_mock):

def test_is_modifiable(self, request_mock):
resource = stripe.WebhookEndpoint.modify(
TEST_RESOURCE_ID, enabled_events=["charge.succeeded"]
TEST_RESOURCE_ID,
enabled_events=["charge.succeeded"],
url="https://stripe.com",
)
request_mock.assert_requested(
"post", "/v1/webhook_endpoints/%s" % TEST_RESOURCE_ID
Expand Down