forked from mollie/mollie-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethod.py
More file actions
84 lines (70 loc) · 1.98 KB
/
method.py
File metadata and controls
84 lines (70 loc) · 1.98 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from .base import ObjectBase
from .issuer import Issuer
from .list import ObjectList
class Method(ObjectBase):
# Payment methods for Payments and Orders
APPLEPAY = "applepay"
BANCONTACT = "bancontact"
BANKTRANSFER = "banktransfer"
BELFIUS = "belfius"
CREDITCARD = "creditcard"
DIRECTDEBIT = "directdebit"
EPS = "eps"
GIFTCARD = "giftcard"
GIROPAY = "giropay"
IDEAL = "ideal"
KBC = "kbc"
MYBANK = "mybank"
PAYPAL = "paypal"
PAYSAFECARD = "paysafecard"
SOFORT = "sofort"
# Payment methods for Payments only
# (none)
# Payment methods for Orders only
BILLIE = "billie"
IN3 = "in3"
KLARNAPAYLATER = "klarnapaylater"
KLARNAPAYNOW = "klarnapaynow"
KLARNASLICEIT = "klarnasliceit"
VOUCHER = "voucher"
@property
def description(self):
return self._get_property("description")
@property
def id(self):
return self._get_property("id")
@property
def resource(self):
return self._get_property("resource")
@property
def minimum_amount(self):
return self._get_property("minimumAmount")
@property
def maximum_amount(self):
return self._get_property("maximumAmount")
@property
def pricing(self):
return self._get_property("pricing")
@property
def image_svg(self):
images = self._get_property("image")
return images["svg"]
@property
def image_size1x(self):
images = self._get_property("image")
return images["size1x"]
@property
def image_size2x(self):
images = self._get_property("image")
return images["size2x"]
@property
def issuers(self):
"""Return the list of available issuers for this payment method."""
issuers = self._get_property("issuers") or []
result = {
"_embedded": {
"issuers": issuers,
},
"count": len(issuers),
}
return ObjectList(result, Issuer)