Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add an alias to new_preauthorization_url. #9

Merged
merged 2 commits into from

2 participants

@karls

To fix an inconsistency between the docs and the Python client library,
this commit adds an alias method called new_pre_authorization_url.

@karls karls Add an alias to new_preauthorization_url.
To fix an inconsistency between the docs and the Python client library,
this commit adds an alias method called new_pre_authorization_url.
486468a
@karls

@gocardless/backend review please?

gocardless/client.py
@@ -297,6 +297,9 @@ def new_preauthorization_url(self, max_amount, interval_length,
return builder.build_and_sign(params, redirect_uri=redirect_uri,
cancel_uri=cancel_uri, state=state)
+ def new_pre_authorization_url(self, *args, **kwargs):
@KMahoney
KMahoney added a note

new_pre_authorization_url = new_preauthorization_url should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@KMahoney KMahoney merged commit e7122ae into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 30, 2012
  1. @karls

    Add an alias to new_preauthorization_url.

    karls authored
    To fix an inconsistency between the docs and the Python client library,
    this commit adds an alias method called new_pre_authorization_url.
Commits on Dec 3, 2012
  1. @karls

    Refactor as per suggestions

    karls authored
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 0 deletions.
  1. +4 −0 gocardless/client.py
  2. +12 −0 test/test_client.py
View
4 gocardless/client.py
@@ -297,6 +297,10 @@ def new_preauthorization_url(self, max_amount, interval_length,
return builder.build_and_sign(params, redirect_uri=redirect_uri,
cancel_uri=cancel_uri, state=state)
+ # Create an alias to new_preauthorization_url to conform to the
+ # documentation
+ new_pre_authorization_url = new_preauthorization_url
+
def confirm_resource(self, params):
"""Confirm a payment
View
12 test/test_client.py
@@ -435,6 +435,11 @@ def test_new_preauth_calls_urlbuilder(self):
urlbuilder.PreAuthorizationParams,
3, 7, "day")
+ def test_new_pre_auth_calls_urlbuilder(self):
+ self.urlbuilder_argument_check("new_pre_authorization_url",
+ urlbuilder.PreAuthorizationParams,
+ 3, 7, "day")
+
def test_new_preauth_params_constructor(self):
self.params_argument_check("new_preauthorization_url",
urlbuilder.PreAuthorizationParams,
@@ -442,6 +447,13 @@ def test_new_preauth_params_constructor(self):
name="aname", description="desc", interval_count=5,
calendar_intervals=False, user={"somekey":"somval"})
+ def test_new_pre_auth_params_constructor(self):
+ self.params_argument_check("new_pre_authorization_url",
+ urlbuilder.PreAuthorizationParams,
+ 3, 7, "day", expires_at=datetime.datetime.now(),
+ name="aname", description="desc", interval_count=5,
+ calendar_intervals=False, user={"somekey":"somval"})
+
def test_new_bill_calls_urlbuilder(self):
self.urlbuilder_argument_check("new_bill_url",
urlbuilder.BillParams,
Something went wrong with that request. Please try again.