Passed
Branch feature/ECO-965-refactoring (c9cdee)
by Andrey
06:34 queued 01:51
created

AmazonPayConfig::getWidgetScriptPathSandbox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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_EVENT_UPDATE_AUTH_STATUS = 'update authorization status';
34
    const OMS_EVENT_UPDATE_CAPTURE_STATUS = 'update capture status';
35
    const OMS_EVENT_UPDATE_REFUND_STATUS = 'update refund status';
36
    const OMS_EVENT_CAPTURE = 'capture';
37
    const OMS_EVENT_UPDATE_SUSPENDED_ORDER = 'update suspended order';
38
39
    const OMS_FLAG_NOT_AUTH = 'not auth';
40
    const OMS_FLAG_NOT_CAPTURED = 'not captured';
41
42
    const STATUS_DECLINED = 'STATUS_DECLINED';//setIsDeclined
43
    const STATUS_CANCELLED = 'STATUS_CANCELLED';//setIsCancelled
44
    const STATUS_CLOSED = 'STATUS_CLOSED';//setIsClosed
45
    const STATUS_SUSPENDED = 'STATUS_SUSPENDED';
46
    const STATUS_PENDING = 'STATUS_PENDING';//setIsPending
47
    const STATUS_OPEN = 'STATUS_OPEN';//setIsOpen
48
    const STATUS_COMPLETED = 'STATUS_COMPLETED';//setIsCompleted
49
    const STATUS_EXPIRED = 'STATUS_EXPIRED';//setIsReauthorizable
50
    const STATUS_PAYMENT_METHOD_INVALID = 'STATUS_CODE_PAYMENT_METHOD_INVALID';//setIsPaymentMethodInvalid
51
    const STATUS_AMAZON_CLOSED = 'STATUS_CODE_AMAZON_CLOSED';//setIsClosedByAmazon
52
    const STATUS_TRANSACTION_TIMED_OUT = 'STATUS_CODE_TRANSACTION_TIMED_OUT';//setIsTransactionTimedOut
53
    const STATUS_PAYMENT_METHOD_CHANGED = 'STATUS_PAYMENT_METHOD_CHANGED';//setIsTransactionTimedOut
54
55
    const IPN_REQUEST_TYPE_PAYMENT_AUTHORIZE = 'PaymentAuthorize';
56
    const IPN_REQUEST_TYPE_PAYMENT_CAPTURE = 'PaymentCapture';
57
    const IPN_REQUEST_TYPE_PAYMENT_REFUND = 'PaymentRefund';
58
    const IPN_REQUEST_TYPE_ORDER_REFERENCE_NOTIFICATION = 'OrderReferenceNotification';
59
60
    const PREFIX_AMAZONPAY_PAYMENT_ERROR = 'amazonpay.payment.error.';
61
62
    /**
63
     * @return string
64
     */
65
    public function getClientId()
66
    {
67
        return $this->get(AmazonPayConstants::CLIENT_ID);
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getAccessKeyId()
74
    {
75
        return $this->get(AmazonPayConstants::ACCESS_KEY_ID);
76
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function getSellerId()
82
    {
83
        return $this->get(AmazonPayConstants::SELLER_ID);
84
    }
85
86
    /**
87
     * @return string
88
     */
89
    public function getSecretAccessKey()
90
    {
91
        return $this->get(AmazonPayConstants::SECRET_ACCESS_KEY);
92
    }
93
94
    /**
95
     * @return string
96
     */
97
    public function getClientSecret()
98
    {
99
        return $this->get(AmazonPayConstants::CLIENT_SECRET);
100
    }
101
102
    /**
103
     * @return string
104
     */
105
    public function getRegion()
106
    {
107
        return $this->get(AmazonPayConstants::REGION);
108
    }
109
110
    /**
111
     * @return string
112
     */
113
    public function getCurrencyIsoCode()
114
    {
115
        return Store::getInstance()->getCurrencyIsoCode();
116
    }
117
118
    /**
119
     * @return bool
120
     */
121
    public function isSandbox()
122
    {
123
        return (bool)$this->get(AmazonPayConstants::SANDBOX);
124
    }
125
126
    /**
127
     * @return string
128
     */
129
    public function getErrorReportLevel()
130
    {
131
        return $this->get(AmazonPayConstants::ERROR_REPORT_LEVEL);
132
    }
133
134
    /**
135
     * @return bool
136
     */
137
    public function getCaptureNow()
138
    {
139
        return (bool)$this->get(AmazonPayConstants::CAPTURE_NOW);
140
    }
141
142
    /**
143
     * @return int
144
     */
145
    public function getAuthTransactionTimeout()
146
    {
147
        return (int)$this->get(AmazonPayConstants::AUTH_TRANSACTION_TIMEOUT);
148
    }
149
150
    /**
151
     * @return string
152
     */
153
    public function getWidgetScriptPath()
154
    {
155
        return $this->get(AmazonPayConstants::WIDGET_SCRIPT_PATH);
156
    }
157
158
    /**
159
     * @return string
160
     */
161
    public function getWidgetScriptPathSandbox()
162
    {
163
        return $this->get(AmazonPayConstants::WIDGET_SCRIPT_PATH_SANDBOX);
164
    }
165
166
    /**
167
     * @return bool
168
     */
169
    public function getPopupLogin()
170
    {
171
        return (bool)$this->get(AmazonPayConstants::WIDGET_POPUP_LOGIN);
172
    }
173
174
    /**
175
     * @return string
176
     */
177
    public function getButtonSize()
178
    {
179
        return $this->get(AmazonPayConstants::WIDGET_BUTTON_SIZE);
180
    }
181
182
    /**
183
     * @return string
184
     */
185
    public function getButtonColor()
186
    {
187
        return $this->get(AmazonPayConstants::WIDGET_BUTTON_COLOR);
188
    }
189
190
    /**
191
     * @return string
192
     */
193
    public function getButtonType()
194
    {
195
        return $this->get(AmazonPayConstants::WIDGET_BUTTON_TYPE);
196
    }
197
198
    /**
199
     * @return string
200
     */
201
    public function getPaymentRejectRoute()
202
    {
203
        return $this->get(AmazonPayConstants::PAYMENT_REJECT_ROUTE);
204
    }
205
}
206