Passed
Pull Request — dev (#9)
by Andrey
07:45 queued 04:11
created

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