-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.php
161 lines (145 loc) · 5.24 KB
/
Config.php
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
namespace SwagNuvei;
/**
* @author Nuvei
*/
class Config
{
const NUVEI_PLUGIN_VERSION = '2.0.2';
const NUVEI_GATEWAY_TITLE = 'Nuvei';
const NUVEI_CODE = 'nuvei_payments';
const NUVEI_DESCR = 'Nuvei Payments';
const NUVEI_ENDPOINT_SANDBOX = 'https://ppp-test.nuvei.com/ppp/api/v1/';
const NUVEI_ENDPOINT_PROD = 'https://secure.safecharge.com/ppp/api/v1/';
const NUVEI_CASHIER_SANDBOX = 'https://ppp-test.nuvei.com/ppp/purchase.do';
const NUVEI_CASHIER_PROD = 'https://secure.safecharge.com/ppp/purchase.do';
const NUVEI_CPANEL_SANDBOX = 'sandbox.safecharge.com';
const NUVEI_CPANEL_PROD = 'cpanel.safecharge.com';
const NUVEI_REFUND_PAYMETNS = ['cc_card', 'apmgw_expresscheckout'];
// const NUVEI_DEVICES = ['iphone', 'ipad', 'android', 'silk', 'blackberry', 'touch', 'linux', 'windows', 'mac'];
// const NUVEI_BROWSERS = ['ucbrowser', 'firefox', 'chrome', 'opera', 'msie', 'edge', 'safari', 'blackberry', 'trident'];
//
// const NUVEI_DEVICES_TYPES = ['tablet', 'mobile', 'tv', 'windows', 'linux'];
// const NUVEI_DEVICES_OS = ['android', 'windows', 'linux', 'mac os'];
const NUVEI_WEB_MASTER_ID = 'ShopWare ';
// constants for order status, see db_name.s_core_states
// states
const SC_ORDER_NOT_VISIBLE = -1; // this is hidden Order. Described as 'cancelled' into DB.
const SC_ORDER_OPEN = 0; // this must be our Auth
const SC_ORDER_IN_PROGRESS = 1;
const SC_ORDER_COMPLETED = 2;
const SC_ORDER_PART_COMPLETED = 3;
const SC_ORDER_REJECTED = 4;
// payment states
const SC_ORDER_PAID = 12;
const SC_PAYMENT_OPEN = 17;
// const SC_PARTIALLY_REFUNDED = 31;
// const SC_COMPLETE_REFUNDED = 32;
const SC_REFUNDED_ACCEPTED = 32;
const SC_PAYMENT_CANCELLED = 35;
const NUVEI_PARAMS_VALIDATION = [
// deviceDetails
'deviceType' => array(
'length' => 10,
'flag' => FILTER_SANITIZE_STRING
),
'deviceName' => array(
'length' => 255,
'flag' => FILTER_DEFAULT
),
'deviceOS' => array(
'length' => 255,
'flag' => FILTER_DEFAULT
),
'browser' => array(
'length' => 255,
'flag' => FILTER_DEFAULT
),
// deviceDetails END
// userDetails, shippingAddress, billingAddress
'firstName' => array(
'length' => 30,
'flag' => FILTER_DEFAULT
),
'lastName' => array(
'length' => 40,
'flag' => FILTER_DEFAULT
),
'address' => array(
'length' => 60,
'flag' => FILTER_DEFAULT
),
'cell' => array(
'length' => 18,
'flag' => FILTER_DEFAULT
),
'phone' => array(
'length' => 18,
'flag' => FILTER_DEFAULT
),
'zip' => array(
'length' => 10,
'flag' => FILTER_DEFAULT
),
'city' => array(
'length' => 30,
'flag' => FILTER_DEFAULT
),
'country' => array(
'length' => 20,
'flag' => FILTER_SANITIZE_STRING
),
'state' => array(
'length' => 2,
'flag' => FILTER_SANITIZE_STRING
),
'county' => array(
'length' => 255,
'flag' => FILTER_DEFAULT
),
// userDetails, shippingAddress, billingAddress END
// specific for shippingAddress
'shippingCounty' => array(
'length' => 255,
'flag' => FILTER_DEFAULT
),
'addressLine2' => array(
'length' => 50,
'flag' => FILTER_DEFAULT
),
'addressLine3' => array(
'length' => 50,
'flag' => FILTER_DEFAULT
),
// specific for shippingAddress END
// urlDetails
'successUrl' => array(
'length' => 1000,
'flag' => FILTER_VALIDATE_URL
),
'failureUrl' => array(
'length' => 1000,
'flag' => FILTER_VALIDATE_URL
),
'pendingUrl' => array(
'length' => 1000,
'flag' => FILTER_VALIDATE_URL
),
'notificationUrl' => array(
'length' => 1000,
'flag' => FILTER_VALIDATE_URL
),
// urlDetails END
];
const NUVEI_PARAMS_VALIDATION_EMAIL = [
'length' => 79,
'flag' => FILTER_VALIDATE_EMAIL
];
const NUVEI_BROWSERS_LIST = ['ucbrowser', 'firefox', 'chrome', 'opera', 'msie', 'edge', 'safari', 'blackberry', 'trident'];
const NUVEI_DEVICES_LIST = ['iphone', 'ipad', 'android', 'silk', 'blackberry', 'touch', 'linux', 'windows', 'mac'];
const NUVEI_DEVICES_TYPES_LIST = ['macintosh', 'tablet', 'mobile', 'tv', 'windows', 'linux', 'tv', 'smarttv', 'googletv', 'appletv', 'hbbtv', 'pov_tv', 'netcast.tv', 'bluray'];
public function __contruct()
{
define('NUVEI_PLUGIN_DIR', dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR);
}
}