1: <?php
2:
3: /**
4: * Partner API Library
5: *
6: * @copyright Copyright (c) 2020 Asseco Data Systems SA
7: * @license license.txt
8: */
9: require_once 'operation.php';
10: require_once 'certumPartnerAPI/messages/messageQuickOrder.php';
11: require_once 'certumPartnerAPI/messages/messageQuickOrderResponse.php';
12:
13: /*
14: <operation name="quickOrder" parameterOrder="quickOrder">
15: <input message="tns:PartnerServicePortType_quickOrder">
16: </input>
17: <output message="tns:PartnerServicePortType_quickOrderResponse">
18: </output>
19: </operation>
20: */
21:
22: /**
23: * This class represents the quickOrder WSDL operation.
24: *
25: * It is based on the PartnerAPIOperation class and derives some properties and methods from that class.
26: *
27: * @method PartnerAPIMessageQuickOrderResponse getResponseMessage() A complete response from a service
28: *
29: * @package operations
30: */
31: class PartnerAPIOperationQuickOrder extends PartnerAPIOperation {
32:
33: /**
34: * @var PartnerAPIMessageQuickOrder
35: */
36: protected $_input = NULL;
37:
38: /**
39: * @var PartnerAPIMessageQuickOrderResponse
40: */
41: protected $_output = NULL;
42:
43: /**
44: * @var string
45: */
46: protected $_operation = 'quickOrder';
47:
48: /**
49: * The constructor.
50: *
51: * It initializes input and output data.
52: */
53: public function __construct() {
54: $this->_input = new PartnerAPIMessageQuickOrder();
55: $this->_output = new PartnerAPIMessageQuickOrderResponse();
56: }
57:
58: /**
59: * Sets a CSR for the request.
60: *
61: * Setting this value is required.
62: *
63: * @param string $csr
64: * @return PartnerAPIOperationQuickOrder
65: */
66: public function setCSR($csr) {
67: $this->_input->quickOrder->orderParameters->setCSR($csr);
68: return $this;
69: }
70:
71: /**
72: * Sets a customer name.
73: *
74: * Setting this value is required.
75: *
76: * @param string $customer
77: * @return PartnerAPIOperationQuickOrder
78: */
79: public function setCustomer($customer) {
80: $this->_input->quickOrder->orderParameters->setCustomer($customer);
81: return $this;
82: }
83:
84: /**
85: * Sets a language to be used for e-mails.
86: *
87: * Default is 'pl'. Also acceptable are 'en' and 'ru'.
88: *
89: * @param string $lang
90: * @return PartnerAPIOperationQuickOrder
91: */
92: public function setLanguage($lang) {
93: $this->_input->quickOrder->orderParameters->setLanguage($lang);
94: return $this;
95: }
96:
97: /**
98: * Sets an order identificator.
99: *
100: * If not set it will be generated automatically by the system.
101: * This identificator have to be unique and it is used to refer to the request.
102: *
103: * @param string $id
104: * @return PartnerAPIOperationQuickOrder
105: */
106: public function setOrderID($id) {
107: $this->_input->quickOrder->orderParameters->setOrderID($id);
108: return $this;
109: }
110:
111: /**
112: * Sets a three-letter product code.
113: *
114: * Setting this value is required.
115: *
116: * @param string $code
117: * @return PartnerAPIOperationQuickOrder
118: */
119: public function setProductCode($code) {
120: $this->_input->quickOrder->orderParameters->setProductCode($code);
121: return $this;
122: }
123:
124: /**
125: * Sets a string identifying web browser and operating system.
126: *
127: * @param string $userAgent
128: * @return PartnerAPIOperationQuickOrder
129: */
130: public function setUserAgent($userAgent) {
131: $this->_input->quickOrder->orderParameters->setUserAgent($userAgent);
132: return $this;
133: }
134:
135: /**
136: * Sets a hash algorithm for a certificate.
137: *
138: * @param string $hashAlgorithm
139: * @return PartnerAPIOperationQuickOrder
140: */
141: public function setHashAlgorithm($hashAlgorithm) {
142: $this->_input->quickOrder->orderParameters->setHashAlgorithm($hashAlgorithm);
143: return $this;
144: }
145:
146: /**
147: * Sets an email for a SSL certificate.
148: *
149: * @param string $email
150: * @return PartnerAPIOperationQuickOrder
151: */
152: public function setEmail($email) {
153: $this->_input->quickOrder->orderParameters->setEmail($email);
154: return $this;
155: }
156:
157: /**
158: * Sets all the contact data of a requestor.
159: *
160: * All arguments are required apart from the last which can be NULL.
161: *
162: * @param string $firstName
163: * @param string $lastName
164: * @param string $email
165: * @param string $phone
166: * @return PartnerAPIOperationQuickOrder
167: */
168: public function setRequestorInfo($firstName, $lastName, $email, $phone) {
169: $ri = $this->_input->quickOrder->requestorInfo;
170: $ri->setFirstName($firstName)->setLastName($lastName)
171: ->setEmail($email)->setPhone($phone);
172: return $this;
173: }
174:
175: /**
176: * Sets an organization information.
177: *
178: * It is not required to set organization information but if you need or have to set it
179: * all the arguments are required.
180: *
181: * @param string $taxNumber The tax identification number
182: * @return PartnerAPIOperationQuickOrder
183: */
184: public function setOrganizationInfo($taxNumber) {
185: $oi = new PartnerAPITypeOrganizationInfo();
186: $oi->setTaxIdentificationNumber($taxNumber);
187: $this->_input->quickOrder->setOrganizationInfo($oi);
188: return $this;
189: }
190:
191: /**
192: * Sets an overrided CSR commonName.
193: *
194: * It is not required to set this but if you need to override a commonName from CSR
195: * then you have to change this as same as SAN entries and approvers.
196: *
197: * @param string $commonName The commonName to override CN given in CSR
198: * @return PartnerAPIOperationQuickOrder
199: */
200: public function setCommonName($commonName) {
201: $this->_input->quickOrder->orderParameters->setCommonName($commonName);
202: return $this;
203: }
204:
205: /**
206: * Sets an overrided CSR organization.
207: *
208: * It is not required to set this but if you need to override a organization from CSR
209: * use this method.
210: *
211: * @param string $organization The organization to override O given in CSR
212: * @return PartnerAPIOperationQuickOrder
213: */
214: public function setOrganization($organization) {
215: $this->_input->quickOrder->orderParameters->setOrganization($organization);
216: return $this;
217: }
218:
219: /**
220: * Sets an overrided CSR organizational unit.
221: *
222: * It is not required to set this but if you need to override a organizational unit from CSR
223: * use this method.
224: *
225: * @param string $organizationalUnit The Organizational Unit to override OU given in CSR
226: * @return PartnerAPIOperationQuickOrder
227: */
228: public function setOrganizationalUnit($organizationalUnit) {
229: $this->_input->quickOrder->orderParameters->setOrganizationalUnit($organizationalUnit);
230: return $this;
231: }
232:
233: /**
234: * Sets an overrided CSR locality.
235: *
236: * It is not required to set this but if you need to override a locality from CSR
237: * use this method.
238: *
239: * @param string $locality The locality to override L given in CSR
240: * @return PartnerAPIOperationQuickOrder
241: */
242: public function setLocality($locality) {
243: $this->_input->quickOrder->orderParameters->setLocality($locality);
244: return $this;
245: }
246:
247: /**
248: * Sets an overrided CSR country.
249: *
250: * It is not required to set this but if you need to override a country from CSR
251: * use this method.
252: *
253: * @param string $country The country to override C given in CSR
254: * @return PartnerAPIOperationQuickOrder
255: */
256: public function setCountry($country) {
257: $this->_input->quickOrder->orderParameters->setCountry($country);
258: return $this;
259: }
260:
261: /**
262: * Sets an overrided CSR state.
263: *
264: * It is not required to set this but if you need to override a state from CSR
265: * use this method.
266: *
267: * @param string $state The state to override state given in CSR
268: * @return PartnerAPIOperationQuickOrder
269: */
270: public function setState($state) {
271: $this->_input->quickOrder->orderParameters->setState($state);
272: return $this;
273: }
274:
275: /**
276: * Sets an overrided CSR serialNumber.
277: *
278: * It is not required to set this but if you need to override a serialNumber from CSR
279: * use this method.
280: *
281: * @param string $serialNumber The serialNumber to override serialNumber given in CSR
282: * @return PartnerAPIOperationQuickOrder
283: */
284: public function setSerialNumber($serialNumber) {
285: $this->_input->quickOrder->orderParameters->setSerialNumber($serialNumber);
286: return $this;
287: }
288:
289: /**
290: * Sets an overrided CSR businessCategory.
291: *
292: * It is not required to set this but if you need to override a businessCategory from CSR
293: * use this method.
294: *
295: * @param string $businessCategory The businessCategory to override businessCategory given in CSR
296: * @return PartnerAPIOperationQuickOrder
297: */
298: public function setBusinessCategory($businessCategory) {
299: $this->_input->quickOrder->orderParameters->setBusinessCategory($businessCategory);
300: return $this;
301: }
302:
303: /**
304: * Sets an overrided CSR streetAddress.
305: *
306: * It is not required to set this but if you need to override a streetAddress from CSR
307: * use this method.
308: *
309: * @param string $streetAddress The streetAddress to override streetAddress given in CSR
310: * @return PartnerAPIOperationQuickOrder
311: */
312: public function setStreetAddress($streetAddress) {
313: $this->_input->quickOrder->orderParameters->setStreetAddress($streetAddress);
314: return $this;
315: }
316:
317: /**
318: * Sets an overrided CSR postalCode.
319: *
320: * It is not required to set this but if you need to override a postalCode from CSR
321: * use this method.
322: *
323: * @param string $postalCode The postalCode to override postalCode given in CSR
324: * @return PartnerAPIOperationQuickOrder
325: */
326: public function setPostalCode($postalCode) {
327: $this->_input->quickOrder->orderParameters->setPostalCode($postalCode);
328: return $this;
329: }
330:
331: /**
332: * Sets an overrided CSR joiln.
333: *
334: * It is not required to set this but if you need to override a joiln from CSR
335: * use this method.
336: *
337: * @param string $joiln The joiln to override joiln given in CSR
338: * @return PartnerAPIOperationQuickOrder
339: */
340: public function setJoiln($joiln) {
341: $this->_input->quickOrder->orderParameters->setJoiln($joiln);
342: return $this;
343: }
344:
345: /**
346: * Sets an overrided CSR joisopn.
347: *
348: * It is not required to set this but if you need to override a joisopn from CSR
349: * use this method.
350: *
351: * @param string $joisopn The joisopn to override joisopn given in CSR
352: * @return PartnerAPIOperationQuickOrder
353: */
354: public function setJoisopn($joisopn) {
355: $this->_input->quickOrder->orderParameters->setJoisopn($joisopn);
356: return $this;
357: }
358:
359: /**
360: * Sets an overrided CSR joisocn.
361: *
362: * It is not required to set this but if you need to override a joisocn from CSR
363: * use this method.
364: *
365: * @param string $joisocn The joisocn to override joisocn given in CSR
366: * @return PartnerAPIOperationQuickOrder
367: */
368: public function setJoisocn($joisocn) {
369: $this->_input->quickOrder->orderParameters->setJoisocn($joisocn);
370: return $this;
371: }
372:
373: /**
374: * Sets a revocation contact email.
375: *
376: * It is not required to set this but if your certificate needs to be revoked
377: * we will contact you using provided email.
378: *
379: * @param string $revocationContactEmail Contact email used in certificate's revocation process
380: * @return PartnerAPIOperationQuickOrder
381: */
382: public function setRevocationContactEmail($revocationContactEmail) {
383: $this->_input->quickOrder->orderParameters->setRevocationContactEmail($revocationContactEmail);
384: return $this;
385: }
386:
387: /**
388: * Sets a shortened validity period.
389: *
390: * It is not required to set this unless you want your certificate to be valid less days than the product allows.
391: * In that case please specify your requested certificate's expiration date within product's allowed validity range.
392: *
393: * @param string $shortenedValidityPeriod Custom certificate's expiration date
394: * @return PartnerAPIOperationQuickOrder
395: */
396: public function setShortenedValidityPeriod($shortenedValidityPeriod) {
397: $this->_input->quickOrder->orderParameters->setShortenedValidityPeriod($shortenedValidityPeriod);
398: return $this;
399: }
400:
401: /**
402: * Adds a domain name as a SAN entry in a certificate.
403: *
404: * SAN entries are optional.
405: * If given, the $domain argument must be a correct domain name or an array
406: * of such domain names.
407: *
408: * @param string|string[] $domain
409: * @return PartnerAPIOperationQuickOrder
410: */
411: public function addSANEntry($domain) {
412: if (!is_array($domain))
413: $domain = array($domain);
414: $SANEntries = $this->_input->quickOrder->SANEntries;
415: if (is_null($SANEntries)) {
416: $SANEntries = new PartnerAPITypeSanEntries();
417: $this->_input->quickOrder->setSANEntries($SANEntries);
418: }
419: foreach ($domain as $d) {
420: $san = new PartnerAPITypeSanEntry();
421: $san->setDNSName($d);
422: $SANEntries->addSANEntry($san);
423: }
424: return $this;
425: }
426:
427: /**
428: * Sets the approverMethod option for SANApprover.
429: *
430: * This option determines which approve method will be used for domain verification.
431: *
432: * @param string $approverMethod
433: * @return PartnerAPIOperationQuickOrder
434: */
435: public function setApproverMethod($approverMethod) {
436: $approver = $this->_input->quickOrder->SANApprover;
437: if (is_null($approver)) {
438: $approver = new PartnerAPITypeSanApprover();
439: $this->_input->quickOrder->setSANApprover($approver);
440: }
441: $approver->setApproverMethod($approverMethod);
442: return $this;
443: }
444:
445: /**
446: * Sets the approverEmail option for SANApprover.
447: *
448: * This option determines where will be sent e-mail with instructions for FILE or DNS approve method.
449: * This method cannot be used with EMAIL approve method.
450: *
451: * @param string $approverEmail
452: * @return PartnerAPIOperationQuickOrder
453: */
454: public function setApproverEmail($approverEmail) {
455: $approver = $this->_input->quickOrder->SANApprover;
456: if (is_null($approver)) {
457: $approver = new PartnerAPITypeSanApprover();
458: $this->_input->quickOrder->setSANApprover($approver);
459: }
460: $approver->setApproverEmail($approverEmail);
461: return $this;
462: }
463:
464: /**
465: * Sets the approverEmailPrefix option for SANApprover.
466: *
467: * This option determines which e-mail prefix will be used for EMAIL approve method.
468: * This method cannot be used with FILE or DNS approve method.
469: *
470: * @param string $approverEmailPrefix
471: * @return PartnerAPIOperationQuickOrder
472: */
473: public function setApproverEmailPrefix($approverEmailPrefix) {
474: $approver = $this->_input->quickOrder->SANApprover;
475: if (is_null($approver)) {
476: $approver = new PartnerAPITypeSanApprover();
477: $this->_input->quickOrder->setSANApprover($approver);
478: }
479: $approver->setApproverEmailPrefix($approverEmailPrefix);
480: return $this;
481: }
482:
483: /**
484: * Sets the verificationNotificationEnabled option for SANApprover.
485: *
486: * This option determines if verification e-mails for all approvers will be sent or not.
487: *
488: * @param boolean $yes_or_no
489: * @return PartnerAPIOperationQuickOrder
490: */
491: public function setVerificationNotificationEnabled($yes_or_no) {
492: $approver = $this->_input->quickOrder->SANApprover;
493: if (is_null($approver)) {
494: $approver = new PartnerAPITypeSanApprover();
495: $this->_input->quickOrder->setSANApprover($approver);
496: }
497: $approver->setVerificationNotificationEnabled($yes_or_no);
498: return $this;
499: }
500:
501: /**
502: * Gets an order ID returned in a response.
503: *
504: * Notice: this method returns the order ID returned in a response, not the order ID
505: * set for the request. If an order ID has been set, it will be returned
506: * in a response, but if it was not set, a new generated order ID will be returned.
507: *
508: * @return string
509: */
510: public function getOrderID() {
511: return $this->_output->quickOrderResponse->orderID;
512: }
513:
514: /**
515: * Returns SANVerification entity containing verification data from a response.
516: *
517: * If there is no verification in the response a NULL is returned.
518: *
519: * @return PartnerAPITypeSanVerification
520: */
521: public function getSANVerification() {
522: return $this->_output->quickOrderResponse->SANVerification;
523: }
524:
525: }
526: