stripe-api 0.3.1__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stripe-api
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Stripe API Client
5
5
  Home-page: http://stripe-api.hive.pt
6
6
  Author: Hive Solutions Lda.
@@ -33,7 +33,7 @@ import setuptools
33
33
 
34
34
  setuptools.setup(
35
35
  name="stripe-api",
36
- version="0.3.1",
36
+ version="0.3.2",
37
37
  author="Hive Solutions Lda.",
38
38
  author_email="development@hive.pt",
39
39
  description="Stripe API Client",
@@ -39,9 +39,11 @@ class IntentAPI(object):
39
39
  capture_method=None,
40
40
  confirm=None,
41
41
  description=None,
42
+ automatic_payment_methods=None,
42
43
  three_d_secure=None,
43
44
  return_url=None,
44
45
  payment_method_types=[],
46
+ payment_method_options={},
45
47
  metadata={},
46
48
  ):
47
49
  url = self.base_url + "payment_intents"
@@ -54,6 +56,10 @@ class IntentAPI(object):
54
56
  params["confirm"] = confirm
55
57
  if description:
56
58
  params["description"] = description
59
+ if not automatic_payment_methods == None:
60
+ params["automatic_payment_methods[enabled]"] = (
61
+ "true" if automatic_payment_methods else "false"
62
+ )
57
63
  if three_d_secure:
58
64
  params["payment_method_options[card][request_three_d_secure]"] = (
59
65
  three_d_secure
@@ -62,6 +68,9 @@ class IntentAPI(object):
62
68
  params["return_url"] = return_url
63
69
  for payment_method_type in payment_method_types:
64
70
  params["payment_method_types[]"] = payment_method_type
71
+ for key, value in payment_method_options.items():
72
+ for _key, _value in value.items():
73
+ params["payment_method_options[" + key + "][" + _key + "]"] = _value
65
74
  for key, value in metadata.items():
66
75
  params["metadata[" + key + "]"] = value
67
76
  contents = self.post(url, params=params)
@@ -71,3 +80,11 @@ class IntentAPI(object):
71
80
  url = self.base_url + "payment_intents/%s/capture" % identifier
72
81
  contents = self.post(url)
73
82
  return contents
83
+
84
+ def confirm_intent(self, identifier, return_url=None):
85
+ url = self.base_url + "payment_intents/%s/confirm" % identifier
86
+ params = {}
87
+ if return_url:
88
+ params["return_url"] = return_url
89
+ contents = self.post(url, params=params)
90
+ return contents
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stripe-api
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Stripe API Client
5
5
  Home-page: http://stripe-api.hive.pt
6
6
  Author: Hive Solutions Lda.
File without changes
File without changes