forked from braintree/braintree_python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtransparent_redirect.py
More file actions
37 lines (29 loc) · 1.16 KB
/
transparent_redirect.py
File metadata and controls
37 lines (29 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import braintree
from braintree.configuration import Configuration
class TransparentRedirect:
"""
A class used for Transparent Redirect operations
"""
class Kind(object):
CreateCustomer = "create_customer"
UpdateCustomer = "update_customer"
CreatePaymentMethod = "create_payment_method"
UpdatePaymentMethod = "update_payment_method"
CreateTransaction = "create_transaction"
@staticmethod
def confirm(query_string):
"""
Confirms a transparent redirect request. It expects the query string from the
redirect request. The query string should _not_ include the leading "?" character. ::
result = braintree.TransparentRedirect.confirm("foo=bar&id=12345")
"""
return Configuration.gateway().transparent_redirect.confirm(query_string)
@staticmethod
def tr_data(data, redirect_url):
return Configuration.gateway().transparent_redirect.tr_data(data, redirect_url)
@staticmethod
def url():
"""
Returns the url for POSTing Transparent Redirect HTML forms
"""
return Configuration.gateway().transparent_redirect.url()