1 <?php
2 /**
3 * Copyright 2016 Klarna AB.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 namespace Klarna\XMLRPC;
18
19 /**
20 * Flag Constants class.
21 */
22 class Flags
23 {
24 /**
25 * Specifies that no flag is to be used.
26 *
27 * @var int
28 */
29 const NO_FLAG = 0;
30
31 //Gender flags
32 /**
33 * Indicates that the person is a female.<br>
34 * Use "" or null when unspecified.<br>.
35 *
36 * @var int
37 */
38 const FEMALE = 0;
39
40 /**
41 * Indicates that the person is a male.<br>
42 * Use "" or null when unspecified.<br>.
43 *
44 * @var int
45 */
46 const MALE = 1;
47
48 //Order status constants
49 /**
50 * This signifies that the invoice or reservation is accepted.
51 *
52 * @var int
53 */
54 const ACCEPTED = 1;
55
56 /**
57 * This signifies that the invoice or reservation is pending, will be set
58 * to accepted or denied.
59 *
60 * @var int
61 */
62 const PENDING = 2;
63
64 /**
65 * This signifies that the invoice or reservation is <b>denied</b>.
66 *
67 * @var int
68 */
69 const DENIED = 3;
70
71 //Get_address constants
72 /**
73 * A code which indicates that all first names should be returned with the
74 * address.
75 *
76 * Formerly refered to as GA_OLD.
77 *
78 * @var int
79 */
80 const GA_ALL = 1;
81
82 /**
83 * A code which indicates that only the last name should be returned with
84 * the address.
85 *
86 * Formerly referd to as GA_NEW.
87 *
88 * @var int
89 */
90 const GA_LAST = 2;
91
92 /**
93 * A code which indicates that the given name should be returned with
94 * the address. If no given name is registered, this will behave as
95 * {@link Flags::GA_ALL GA_ALL}.
96 */
97 const GA_GIVEN = 5;
98
99 //Article/goods constants
100 /**
101 * Quantity measured in 1/1000s.
102 *
103 * @var int
104 */
105 const PRINT_1000 = 1;
106
107 /**
108 * Quantity measured in 1/100s.
109 *
110 * @var int
111 */
112 const PRINT_100 = 2;
113
114 /**
115 * Quantity measured in 1/10s.
116 *
117 * @var int
118 */
119 const PRINT_10 = 4;
120
121 /**
122 * Indicates that the item is a shipment fee.
123 *
124 * Update_charge_amount (1)
125 *
126 * @var int
127 */
128 const IS_SHIPMENT = 8;
129
130 /**
131 * Indicates that the item is a handling fee.
132 *
133 * Update_charge_amount (2)
134 *
135 * @var int
136 */
137 const IS_HANDLING = 16;
138
139 /**
140 * Article price including VAT.
141 *
142 * @var int
143 */
144 const INC_VAT = 32;
145
146 //Miscellaneous
147 /**
148 * Signifies that this is to be displayed in the checkout.<br>
149 * Used for part payment.<br>.
150 *
151 * @var int
152 */
153 const CHECKOUT_PAGE = 0;
154
155 /**
156 * Signifies that this is to be displayed in the product page.<br>
157 * Used for part payment.<br>.
158 *
159 * @var int
160 */
161 const PRODUCT_PAGE = 1;
162
163 /**
164 * Signifies that the specified address is billing address.
165 *
166 * @var int
167 */
168 const IS_BILLING = 100;
169
170 /**
171 * Signifies that the specified address is shipping address.
172 *
173 * @var int
174 */
175 const IS_SHIPPING = 101;
176
177 //Invoice and Reservation
178 /**
179 * Indicates that the purchase is a test invoice/part payment.
180 *
181 * @var int
182 */
183 const TEST_MODE = 2;
184
185 /**
186 * PClass id/value for invoices.
187 *
188 * @see PClass::INVOICE.
189 *
190 * @var int
191 */
192 const PCLASS_INVOICE = -1;
193
194 //Invoice
195 /**
196 * Activates an invoices automatically, requires setting in Klarna Online.
197 *
198 * If you designate this flag an invoice is created directly in the active
199 * state, i.e. Klarna will buy the invoice immediately.
200 *
201 * @var int
202 */
203 const AUTO_ACTIVATE = 1;
204
205 /**
206 * Creates a pre-pay invoice.
207 *
208 * @var int
209 *
210 * @deprecated Do not use.
211 */
212 const PRE_PAY = 8;
213
214 /**
215 * Used to flag a purchase as sensitive order.
216 *
217 * @var int
218 */
219 const SENSITIVE_ORDER = 1024;
220
221 /**
222 * Used to return an array with long and short ocr number.
223 *
224 * @see Klarna::addTransaction()
225 *
226 * @var int
227 */
228 const RETURN_OCR = 8192;
229
230 /**
231 * Specifies the shipment type as normal.
232 *
233 * @var int
234 */
235 const NORMAL_SHIPMENT = 1;
236
237 /**
238 * Specifies the shipment type as express.
239 *
240 * @var int
241 */
242 const EXPRESS_SHIPMENT = 2;
243
244 //Mobile (Invoice) flags
245 /**
246 * Marks the transaction as Klarna mobile.
247 *
248 * @var int
249 */
250 const M_PHONE_TRANSACTION = 262144;
251
252 /**
253 * Sends a pin code to the phone sent in pno.
254 *
255 * @var int
256 */
257 const M_SEND_PHONE_PIN = 524288;
258
259 //Reservation flags
260 /**
261 * Signifies that the amount specified is the new amount.
262 *
263 * @var int
264 */
265 const NEW_AMOUNT = 0;
266
267 /**
268 * Signifies that the amount specified is to be added.
269 *
270 * @var int
271 */
272 const ADD_AMOUNT = 1;
273
274 /**
275 * Sends the invoice by mail when activating a reservation.
276 *
277 * @var int
278 */
279 const RSRV_SEND_BY_MAIL = 4;
280
281 /**
282 * Sends the invoice by e-mail when activating a reservation.
283 *
284 * @var int
285 */
286 const RSRV_SEND_BY_EMAIL = 8;
287
288 /**
289 * Used for partial deliveries, this flag saves the reservation number so
290 * it can be used again.
291 *
292 * @var int
293 */
294 const RSRV_PRESERVE_RESERVATION = 16;
295
296 /**
297 * Used to flag a purchase as sensitive order.
298 *
299 * @var int
300 */
301 const RSRV_SENSITIVE_ORDER = 32;
302
303 /**
304 * Marks the transaction as Klarna mobile.
305 *
306 * @var int
307 */
308 const RSRV_PHONE_TRANSACTION = 512;
309
310 /**
311 * Sends a pin code to the mobile number.
312 *
313 * @var int
314 */
315 const RSRV_SEND_PHONE_PIN = 1024;
316 }
317