Completed
Push — feature/ECO-1185-eco-ci ( 4da4ac...5d4add )
by Andrey
13:41 queued 10:25
created

AmazonPayConfig   A

Complexity

Total Complexity 19

Size/Duplication

Total Lines 205
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 205
rs 10
c 0
b 0
f 0
wmc 19

19 Methods

Rating   Name   Duplication   Size   Complexity  
A getEnableIsolateLevelRead() 0 3 1
A getWidgetScriptPathSandbox() 0 3 1
A getButtonSize() 0 3 1
A getButtonColor() 0 3 1
A getRegion() 0 3 1
A isSandbox() 0 3 1
A getButtonType() 0 3 1
A getPaymentRejectRoute() 0 3 1
A getWidgetScriptPath() 0 3 1
A getCaptureNow() 0 3 1
A getAuthTransactionTimeout() 0 3 1
A getAccessKeyId() 0 3 1
A getPopupLogin() 0 3 1
A getSellerId() 0 3 1
A getSecretAccessKey() 0 3 1
A getCurrencyIsoCode() 0 3 1
A getClientId() 0 3 1
A getClientSecret() 0 3 1
A getErrorReportLevel() 0 3 1
1
<?php
2
3
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Shared\AmazonPay;
9
10
use Spryker\Shared\Kernel\AbstractBundleConfig;
11
use Spryker\Shared\Kernel\Store;
12
13
class AmazonPayConfig extends AbstractBundleConfig implements AmazonPayConfigInterface
14
{
15
    const WIDGET_BUTTON_TYPE_FULL = 'PwA';
16
    const WIDGET_BUTTON_TYPE_SHORT = 'Pay';
17
    const WIDGET_BUTTON_TYPE_SQUARE = 'A';
18
    const WIDGET_BUTTON_COLOR_GOLD = 'Gold';
19
    const WIDGET_BUTTON_COLOR_LIGHT_GRAY = 'LightGray';
20
    const WIDGET_BUTTON_COLOR_DARK_GRAY = 'DarkGray';
21
    const WIDGET_BUTTON_SIZE_SMALL = 'small';
22
    const WIDGET_BUTTON_SIZE_MEDIUM = 'medium';
23
    const WIDGET_BUTTON_SIZE_LARGE = 'large';
24
    const WIDGET_BUTTON_SIZE_XLARGE = 'x-large';
25
    const PROVIDER_NAME = 'Amazon Pay';
26
27
    const OMS_STATUS_AUTH_OPEN = 'auth open';
28
    const OMS_STATUS_AUTH_OPEN_WITHOUT_CANCEL = 'auth open without cancel';
29
    const OMS_STATUS_CAPTURE_COMPLETED = 'capture completed';
30
    const OMS_STATUS_CAPTURE_PENDING = 'capture pending';
31
    const OMS_STATUS_CANCELLED = 'cancelled';
32
33
    const OMS_STATUS_REFUND_PENDING = 'refund pending';
34
    const OMS_STATUS_REFUND_COMPLETED = 'refund completed';
35
    const OMS_STATUS_REFUND_DECLINED = 'refund declined';
36
    const OMS_STATUS_REFUND_WAITING_FOR_STATUS = 'waiting for refund status';
37
38
    const OMS_EVENT_UPDATE_AUTH_STATUS = 'update authorization status';
39
    const OMS_EVENT_CANCEL = 'cancel';
40
    const OMS_EVENT_UPDATE_CAPTURE_STATUS = 'update capture status';
41
    const OMS_EVENT_UPDATE_REFUND_STATUS = 'update refund status';
42
    const OMS_EVENT_CAPTURE = 'capture';
43
    const OMS_EVENT_UPDATE_SUSPENDED_ORDER = 'update suspended order';
44
45
    const OMS_FLAG_NOT_AUTH = 'not auth';
46
    const OMS_FLAG_NOT_CAPTURED = 'not captured';
47
48
    const STATUS_DECLINED = 'STATUS_DECLINED';//setIsDeclined
49
    const STATUS_CANCELLED = 'STATUS_CANCELLED';//setIsCancelled
50
    const STATUS_CLOSED = 'STATUS_CLOSED';//setIsClosed
51
    const STATUS_SUSPENDED = 'STATUS_SUSPENDED';
52
    const STATUS_PENDING = 'STATUS_PENDING';//setIsPending
53
    const STATUS_OPEN = 'STATUS_OPEN';//setIsOpen
54
    const STATUS_COMPLETED = 'STATUS_COMPLETED';//setIsCompleted
55
    const STATUS_EXPIRED = 'STATUS_EXPIRED';//setIsReauthorizable
56
    const STATUS_PAYMENT_METHOD_INVALID = 'STATUS_CODE_PAYMENT_METHOD_INVALID';//setIsPaymentMethodInvalid
57
    const STATUS_AMAZON_CLOSED = 'STATUS_CODE_AMAZON_CLOSED';//setIsClosedByAmazon
58
    const STATUS_TRANSACTION_TIMED_OUT = 'STATUS_CODE_TRANSACTION_TIMED_OUT';//setIsTransactionTimedOut
59
    const STATUS_PAYMENT_METHOD_CHANGED = 'STATUS_PAYMENT_METHOD_CHANGED';//setIsTransactionTimedOut
60
61
    const IPN_REQUEST_TYPE_PAYMENT_AUTHORIZE = 'PaymentAuthorize';
62
    const IPN_REQUEST_TYPE_PAYMENT_CAPTURE = 'PaymentCapture';
63
    const IPN_REQUEST_TYPE_PAYMENT_REFUND = 'PaymentRefund';
64
    const IPN_REQUEST_TYPE_ORDER_REFERENCE_NOTIFICATION = 'OrderReferenceNotification';
65
66
    const PREFIX_AMAZONPAY_PAYMENT_ERROR = 'amazonpay.payment.error.';
67
68
    /**
69
     * @return string
70
     */
71
    public function getClientId()
72
    {
73
        return $this->get(AmazonPayConstants::CLIENT_ID);
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function getAccessKeyId()
80
    {
81
        return $this->get(AmazonPayConstants::ACCESS_KEY_ID);
82
    }
83
84
    /**
85
     * @return string
86
     */
87
    public function getSellerId()
88
    {
89
        return $this->get(AmazonPayConstants::SELLER_ID);
90
    }
91
92
    /**
93
     * @return string
94
     */
95
    public function getSecretAccessKey()
96
    {
97
        return $this->get(AmazonPayConstants::SECRET_ACCESS_KEY);
98
    }
99
100
    /**
101
     * @return string
102
     */
103
    public function getClientSecret()
104
    {
105
        return $this->get(AmazonPayConstants::CLIENT_SECRET);
106
    }
107
108
    /**
109
     * @return string
110
     */
111
    public function getRegion()
112
    {
113
        return $this->get(AmazonPayConstants::REGION);
114
    }
115
116
    /**
117
     * @return string
118
     */
119
    public function getCurrencyIsoCode()
120
    {
121
        return Store::getInstance()->getCurrencyIsoCode();
122
    }
123
124
    /**
125
     * @return bool
126
     */
127
    public function isSandbox()
128
    {
129
        return (bool)$this->get(AmazonPayConstants::SANDBOX, true);
130
    }
131
132
    /**
133
     * @return string
134
     */
135
    public function getErrorReportLevel()
136
    {
137
        return $this->get(AmazonPayConstants::ERROR_REPORT_LEVEL);
138
    }
139
140
    /**
141
     * @return bool
142
     */
143
    public function getCaptureNow()
144
    {
145
        return (bool)$this->get(AmazonPayConstants::CAPTURE_NOW, false);
146
    }
147
148
    /**
149
     * @return int
150
     */
151
    public function getAuthTransactionTimeout()
152
    {
153
        return (int)$this->get(AmazonPayConstants::AUTH_TRANSACTION_TIMEOUT, 0);
154
    }
155
156
    /**
157
     * @return string
158
     */
159
    public function getWidgetScriptPath()
160
    {
161
        return $this->get(AmazonPayConstants::WIDGET_SCRIPT_PATH);
162
    }
163
164
    /**
165
     * @return string
166
     */
167
    public function getWidgetScriptPathSandbox()
168
    {
169
        return $this->get(AmazonPayConstants::WIDGET_SCRIPT_PATH_SANDBOX);
170
    }
171
172
    /**
173
     * @return bool
174
     */
175
    public function getPopupLogin()
176
    {
177
        return (bool)$this->get(AmazonPayConstants::WIDGET_POPUP_LOGIN, false);
178
    }
179
180
    /**
181
     * @return string
182
     */
183
    public function getButtonSize()
184
    {
185
        return $this->get(AmazonPayConstants::WIDGET_BUTTON_SIZE);
186
    }
187
188
    /**
189
     * @return string
190
     */
191
    public function getButtonColor()
192
    {
193
        return $this->get(AmazonPayConstants::WIDGET_BUTTON_COLOR);
194
    }
195
196
    /**
197
     * @return string
198
     */
199
    public function getButtonType()
200
    {
201
        return $this->get(AmazonPayConstants::WIDGET_BUTTON_TYPE);
202
    }
203
204
    /**
205
     * @return string
206
     */
207
    public function getPaymentRejectRoute()
208
    {
209
        return $this->get(AmazonPayConstants::PAYMENT_REJECT_ROUTE);
210
    }
211
212
    /**
213
     * @return bool
214
     */
215
    public function getEnableIsolateLevelRead()
216
    {
217
        return (bool)$this->get(AmazonPayConstants::ENABLE_ISOLATE_LEVEL_READ, false);
218
    }
219
}
220