1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Merchant\Payments; |
7: | |
8: | use Worldline\Connect\Sdk\ApiResource; |
9: | use Worldline\Connect\Sdk\CallContext; |
10: | use Worldline\Connect\Sdk\Communication\ErrorResponseException; |
11: | use Worldline\Connect\Sdk\Communication\InvalidResponseException; |
12: | use Worldline\Connect\Sdk\Communication\ResponseClassMap; |
13: | use Worldline\Connect\Sdk\V1\ApiException; |
14: | use Worldline\Connect\Sdk\V1\AuthorizationException; |
15: | use Worldline\Connect\Sdk\V1\DeclinedPaymentException; |
16: | use Worldline\Connect\Sdk\V1\DeclinedRefundException; |
17: | use Worldline\Connect\Sdk\V1\Domain\ApprovePaymentRequest; |
18: | use Worldline\Connect\Sdk\V1\Domain\CancelApprovalPaymentResponse; |
19: | use Worldline\Connect\Sdk\V1\Domain\CancelPaymentResponse; |
20: | use Worldline\Connect\Sdk\V1\Domain\CapturePaymentRequest; |
21: | use Worldline\Connect\Sdk\V1\Domain\CaptureResponse; |
22: | use Worldline\Connect\Sdk\V1\Domain\CapturesResponse; |
23: | use Worldline\Connect\Sdk\V1\Domain\CompletePaymentRequest; |
24: | use Worldline\Connect\Sdk\V1\Domain\CompletePaymentResponse; |
25: | use Worldline\Connect\Sdk\V1\Domain\CreateDisputeRequest; |
26: | use Worldline\Connect\Sdk\V1\Domain\CreatePaymentRequest; |
27: | use Worldline\Connect\Sdk\V1\Domain\CreatePaymentResponse; |
28: | use Worldline\Connect\Sdk\V1\Domain\CreateTokenResponse; |
29: | use Worldline\Connect\Sdk\V1\Domain\DeviceFingerprintDetails; |
30: | use Worldline\Connect\Sdk\V1\Domain\DisputeResponse; |
31: | use Worldline\Connect\Sdk\V1\Domain\DisputesResponse; |
32: | use Worldline\Connect\Sdk\V1\Domain\FindPaymentsResponse; |
33: | use Worldline\Connect\Sdk\V1\Domain\PaymentApprovalResponse; |
34: | use Worldline\Connect\Sdk\V1\Domain\PaymentResponse; |
35: | use Worldline\Connect\Sdk\V1\Domain\RefundRequest; |
36: | use Worldline\Connect\Sdk\V1\Domain\RefundResponse; |
37: | use Worldline\Connect\Sdk\V1\Domain\RefundsResponse; |
38: | use Worldline\Connect\Sdk\V1\Domain\ThirdPartyStatusResponse; |
39: | use Worldline\Connect\Sdk\V1\Domain\TokenizePaymentRequest; |
40: | use Worldline\Connect\Sdk\V1\ExceptionFactory; |
41: | use Worldline\Connect\Sdk\V1\IdempotenceException; |
42: | use Worldline\Connect\Sdk\V1\PlatformException; |
43: | use Worldline\Connect\Sdk\V1\ReferenceException; |
44: | use Worldline\Connect\Sdk\V1\ValidationException; |
45: | |
46: | |
47: | |
48: | |
49: | class PaymentsClient extends ApiResource |
50: | { |
51: | |
52: | private $responseExceptionFactory = null; |
53: | |
54: | |
55: | |
56: | |
57: | |
58: | |
59: | |
60: | |
61: | |
62: | |
63: | |
64: | |
65: | |
66: | |
67: | |
68: | |
69: | |
70: | |
71: | public function create(CreatePaymentRequest $body, CallContext $callContext = null) |
72: | { |
73: | $responseClassMap = new ResponseClassMap(); |
74: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\CreatePaymentResponse'; |
75: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\PaymentErrorResponse'; |
76: | try { |
77: | return $this->getCommunicator()->post( |
78: | $responseClassMap, |
79: | $this->instantiateUri('/v1/{merchantId}/payments'), |
80: | $this->getClientMetaInfo(), |
81: | $body, |
82: | null, |
83: | $callContext |
84: | ); |
85: | } catch (ErrorResponseException $e) { |
86: | throw $this->getResponseExceptionFactory()->createException( |
87: | $e->getHttpStatusCode(), |
88: | $e->getErrorResponse(), |
89: | $callContext |
90: | ); |
91: | } |
92: | } |
93: | |
94: | |
95: | |
96: | |
97: | |
98: | |
99: | |
100: | |
101: | |
102: | |
103: | |
104: | |
105: | |
106: | |
107: | |
108: | |
109: | |
110: | public function find(FindPaymentsParams $query, CallContext $callContext = null) |
111: | { |
112: | $responseClassMap = new ResponseClassMap(); |
113: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\FindPaymentsResponse'; |
114: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
115: | try { |
116: | return $this->getCommunicator()->get( |
117: | $responseClassMap, |
118: | $this->instantiateUri('/v1/{merchantId}/payments'), |
119: | $this->getClientMetaInfo(), |
120: | $query, |
121: | $callContext |
122: | ); |
123: | } catch (ErrorResponseException $e) { |
124: | throw $this->getResponseExceptionFactory()->createException( |
125: | $e->getHttpStatusCode(), |
126: | $e->getErrorResponse(), |
127: | $callContext |
128: | ); |
129: | } |
130: | } |
131: | |
132: | |
133: | |
134: | |
135: | |
136: | |
137: | |
138: | |
139: | |
140: | |
141: | |
142: | |
143: | |
144: | |
145: | |
146: | |
147: | |
148: | public function get($paymentId, CallContext $callContext = null) |
149: | { |
150: | $this->context['paymentId'] = $paymentId; |
151: | $responseClassMap = new ResponseClassMap(); |
152: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\PaymentResponse'; |
153: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
154: | try { |
155: | return $this->getCommunicator()->get( |
156: | $responseClassMap, |
157: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}'), |
158: | $this->getClientMetaInfo(), |
159: | null, |
160: | $callContext |
161: | ); |
162: | } catch (ErrorResponseException $e) { |
163: | throw $this->getResponseExceptionFactory()->createException( |
164: | $e->getHttpStatusCode(), |
165: | $e->getErrorResponse(), |
166: | $callContext |
167: | ); |
168: | } |
169: | } |
170: | |
171: | |
172: | |
173: | |
174: | |
175: | |
176: | |
177: | |
178: | |
179: | |
180: | |
181: | |
182: | |
183: | |
184: | |
185: | |
186: | |
187: | |
188: | public function complete($paymentId, CompletePaymentRequest $body, CallContext $callContext = null) |
189: | { |
190: | $this->context['paymentId'] = $paymentId; |
191: | $responseClassMap = new ResponseClassMap(); |
192: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\CompletePaymentResponse'; |
193: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
194: | try { |
195: | return $this->getCommunicator()->post( |
196: | $responseClassMap, |
197: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/complete'), |
198: | $this->getClientMetaInfo(), |
199: | $body, |
200: | null, |
201: | $callContext |
202: | ); |
203: | } catch (ErrorResponseException $e) { |
204: | throw $this->getResponseExceptionFactory()->createException( |
205: | $e->getHttpStatusCode(), |
206: | $e->getErrorResponse(), |
207: | $callContext |
208: | ); |
209: | } |
210: | } |
211: | |
212: | |
213: | |
214: | |
215: | |
216: | |
217: | |
218: | |
219: | |
220: | |
221: | |
222: | |
223: | |
224: | |
225: | |
226: | |
227: | |
228: | public function thirdPartyStatus($paymentId, CallContext $callContext = null) |
229: | { |
230: | $this->context['paymentId'] = $paymentId; |
231: | $responseClassMap = new ResponseClassMap(); |
232: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ThirdPartyStatusResponse'; |
233: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
234: | try { |
235: | return $this->getCommunicator()->get( |
236: | $responseClassMap, |
237: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/thirdpartystatus'), |
238: | $this->getClientMetaInfo(), |
239: | null, |
240: | $callContext |
241: | ); |
242: | } catch (ErrorResponseException $e) { |
243: | throw $this->getResponseExceptionFactory()->createException( |
244: | $e->getHttpStatusCode(), |
245: | $e->getErrorResponse(), |
246: | $callContext |
247: | ); |
248: | } |
249: | } |
250: | |
251: | |
252: | |
253: | |
254: | |
255: | |
256: | |
257: | |
258: | |
259: | |
260: | |
261: | |
262: | |
263: | |
264: | |
265: | |
266: | |
267: | |
268: | public function tokenize($paymentId, TokenizePaymentRequest $body, CallContext $callContext = null) |
269: | { |
270: | $this->context['paymentId'] = $paymentId; |
271: | $responseClassMap = new ResponseClassMap(); |
272: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\CreateTokenResponse'; |
273: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
274: | try { |
275: | return $this->getCommunicator()->post( |
276: | $responseClassMap, |
277: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/tokenize'), |
278: | $this->getClientMetaInfo(), |
279: | $body, |
280: | null, |
281: | $callContext |
282: | ); |
283: | } catch (ErrorResponseException $e) { |
284: | throw $this->getResponseExceptionFactory()->createException( |
285: | $e->getHttpStatusCode(), |
286: | $e->getErrorResponse(), |
287: | $callContext |
288: | ); |
289: | } |
290: | } |
291: | |
292: | |
293: | |
294: | |
295: | |
296: | |
297: | |
298: | |
299: | |
300: | |
301: | |
302: | |
303: | |
304: | |
305: | |
306: | |
307: | |
308: | public function processchallenged($paymentId, CallContext $callContext = null) |
309: | { |
310: | $this->context['paymentId'] = $paymentId; |
311: | $responseClassMap = new ResponseClassMap(); |
312: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\PaymentResponse'; |
313: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
314: | try { |
315: | return $this->getCommunicator()->post( |
316: | $responseClassMap, |
317: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/processchallenged'), |
318: | $this->getClientMetaInfo(), |
319: | null, |
320: | null, |
321: | $callContext |
322: | ); |
323: | } catch (ErrorResponseException $e) { |
324: | throw $this->getResponseExceptionFactory()->createException( |
325: | $e->getHttpStatusCode(), |
326: | $e->getErrorResponse(), |
327: | $callContext |
328: | ); |
329: | } |
330: | } |
331: | |
332: | |
333: | |
334: | |
335: | |
336: | |
337: | |
338: | |
339: | |
340: | |
341: | |
342: | |
343: | |
344: | |
345: | |
346: | |
347: | |
348: | |
349: | public function approve($paymentId, ApprovePaymentRequest $body, CallContext $callContext = null) |
350: | { |
351: | $this->context['paymentId'] = $paymentId; |
352: | $responseClassMap = new ResponseClassMap(); |
353: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\PaymentApprovalResponse'; |
354: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
355: | try { |
356: | return $this->getCommunicator()->post( |
357: | $responseClassMap, |
358: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/approve'), |
359: | $this->getClientMetaInfo(), |
360: | $body, |
361: | null, |
362: | $callContext |
363: | ); |
364: | } catch (ErrorResponseException $e) { |
365: | throw $this->getResponseExceptionFactory()->createException( |
366: | $e->getHttpStatusCode(), |
367: | $e->getErrorResponse(), |
368: | $callContext |
369: | ); |
370: | } |
371: | } |
372: | |
373: | |
374: | |
375: | |
376: | |
377: | |
378: | |
379: | |
380: | |
381: | |
382: | |
383: | |
384: | |
385: | |
386: | |
387: | |
388: | |
389: | |
390: | public function capture($paymentId, CapturePaymentRequest $body, CallContext $callContext = null) |
391: | { |
392: | $this->context['paymentId'] = $paymentId; |
393: | $responseClassMap = new ResponseClassMap(); |
394: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\CaptureResponse'; |
395: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
396: | try { |
397: | return $this->getCommunicator()->post( |
398: | $responseClassMap, |
399: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/capture'), |
400: | $this->getClientMetaInfo(), |
401: | $body, |
402: | null, |
403: | $callContext |
404: | ); |
405: | } catch (ErrorResponseException $e) { |
406: | throw $this->getResponseExceptionFactory()->createException( |
407: | $e->getHttpStatusCode(), |
408: | $e->getErrorResponse(), |
409: | $callContext |
410: | ); |
411: | } |
412: | } |
413: | |
414: | |
415: | |
416: | |
417: | |
418: | |
419: | |
420: | |
421: | |
422: | |
423: | |
424: | |
425: | |
426: | |
427: | |
428: | |
429: | |
430: | public function cancelapproval($paymentId, CallContext $callContext = null) |
431: | { |
432: | $this->context['paymentId'] = $paymentId; |
433: | $responseClassMap = new ResponseClassMap(); |
434: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\CancelApprovalPaymentResponse'; |
435: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
436: | try { |
437: | return $this->getCommunicator()->post( |
438: | $responseClassMap, |
439: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/cancelapproval'), |
440: | $this->getClientMetaInfo(), |
441: | null, |
442: | null, |
443: | $callContext |
444: | ); |
445: | } catch (ErrorResponseException $e) { |
446: | throw $this->getResponseExceptionFactory()->createException( |
447: | $e->getHttpStatusCode(), |
448: | $e->getErrorResponse(), |
449: | $callContext |
450: | ); |
451: | } |
452: | } |
453: | |
454: | |
455: | |
456: | |
457: | |
458: | |
459: | |
460: | |
461: | |
462: | |
463: | |
464: | |
465: | |
466: | |
467: | |
468: | |
469: | |
470: | public function captures($paymentId, CallContext $callContext = null) |
471: | { |
472: | $this->context['paymentId'] = $paymentId; |
473: | $responseClassMap = new ResponseClassMap(); |
474: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\CapturesResponse'; |
475: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
476: | try { |
477: | return $this->getCommunicator()->get( |
478: | $responseClassMap, |
479: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/captures'), |
480: | $this->getClientMetaInfo(), |
481: | null, |
482: | $callContext |
483: | ); |
484: | } catch (ErrorResponseException $e) { |
485: | throw $this->getResponseExceptionFactory()->createException( |
486: | $e->getHttpStatusCode(), |
487: | $e->getErrorResponse(), |
488: | $callContext |
489: | ); |
490: | } |
491: | } |
492: | |
493: | |
494: | |
495: | |
496: | |
497: | |
498: | |
499: | |
500: | |
501: | |
502: | |
503: | |
504: | |
505: | |
506: | |
507: | |
508: | |
509: | |
510: | |
511: | public function refund($paymentId, RefundRequest $body, CallContext $callContext = null) |
512: | { |
513: | $this->context['paymentId'] = $paymentId; |
514: | $responseClassMap = new ResponseClassMap(); |
515: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\RefundResponse'; |
516: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\RefundErrorResponse'; |
517: | try { |
518: | return $this->getCommunicator()->post( |
519: | $responseClassMap, |
520: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/refund'), |
521: | $this->getClientMetaInfo(), |
522: | $body, |
523: | null, |
524: | $callContext |
525: | ); |
526: | } catch (ErrorResponseException $e) { |
527: | throw $this->getResponseExceptionFactory()->createException( |
528: | $e->getHttpStatusCode(), |
529: | $e->getErrorResponse(), |
530: | $callContext |
531: | ); |
532: | } |
533: | } |
534: | |
535: | |
536: | |
537: | |
538: | |
539: | |
540: | |
541: | |
542: | |
543: | |
544: | |
545: | |
546: | |
547: | |
548: | |
549: | |
550: | |
551: | public function refunds($paymentId, CallContext $callContext = null) |
552: | { |
553: | $this->context['paymentId'] = $paymentId; |
554: | $responseClassMap = new ResponseClassMap(); |
555: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\RefundsResponse'; |
556: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
557: | try { |
558: | return $this->getCommunicator()->get( |
559: | $responseClassMap, |
560: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/refunds'), |
561: | $this->getClientMetaInfo(), |
562: | null, |
563: | $callContext |
564: | ); |
565: | } catch (ErrorResponseException $e) { |
566: | throw $this->getResponseExceptionFactory()->createException( |
567: | $e->getHttpStatusCode(), |
568: | $e->getErrorResponse(), |
569: | $callContext |
570: | ); |
571: | } |
572: | } |
573: | |
574: | |
575: | |
576: | |
577: | |
578: | |
579: | |
580: | |
581: | |
582: | |
583: | |
584: | |
585: | |
586: | |
587: | |
588: | |
589: | |
590: | public function cancel($paymentId, CallContext $callContext = null) |
591: | { |
592: | $this->context['paymentId'] = $paymentId; |
593: | $responseClassMap = new ResponseClassMap(); |
594: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\CancelPaymentResponse'; |
595: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
596: | try { |
597: | return $this->getCommunicator()->post( |
598: | $responseClassMap, |
599: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/cancel'), |
600: | $this->getClientMetaInfo(), |
601: | null, |
602: | null, |
603: | $callContext |
604: | ); |
605: | } catch (ErrorResponseException $e) { |
606: | throw $this->getResponseExceptionFactory()->createException( |
607: | $e->getHttpStatusCode(), |
608: | $e->getErrorResponse(), |
609: | $callContext |
610: | ); |
611: | } |
612: | } |
613: | |
614: | |
615: | |
616: | |
617: | |
618: | |
619: | |
620: | |
621: | |
622: | |
623: | |
624: | |
625: | |
626: | |
627: | |
628: | |
629: | |
630: | |
631: | public function dispute($paymentId, CreateDisputeRequest $body, CallContext $callContext = null) |
632: | { |
633: | $this->context['paymentId'] = $paymentId; |
634: | $responseClassMap = new ResponseClassMap(); |
635: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\DisputeResponse'; |
636: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
637: | try { |
638: | return $this->getCommunicator()->post( |
639: | $responseClassMap, |
640: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/dispute'), |
641: | $this->getClientMetaInfo(), |
642: | $body, |
643: | null, |
644: | $callContext |
645: | ); |
646: | } catch (ErrorResponseException $e) { |
647: | throw $this->getResponseExceptionFactory()->createException( |
648: | $e->getHttpStatusCode(), |
649: | $e->getErrorResponse(), |
650: | $callContext |
651: | ); |
652: | } |
653: | } |
654: | |
655: | |
656: | |
657: | |
658: | |
659: | |
660: | |
661: | |
662: | |
663: | |
664: | |
665: | |
666: | |
667: | |
668: | |
669: | |
670: | |
671: | public function disputes($paymentId, CallContext $callContext = null) |
672: | { |
673: | $this->context['paymentId'] = $paymentId; |
674: | $responseClassMap = new ResponseClassMap(); |
675: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\DisputesResponse'; |
676: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
677: | try { |
678: | return $this->getCommunicator()->get( |
679: | $responseClassMap, |
680: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/disputes'), |
681: | $this->getClientMetaInfo(), |
682: | null, |
683: | $callContext |
684: | ); |
685: | } catch (ErrorResponseException $e) { |
686: | throw $this->getResponseExceptionFactory()->createException( |
687: | $e->getHttpStatusCode(), |
688: | $e->getErrorResponse(), |
689: | $callContext |
690: | ); |
691: | } |
692: | } |
693: | |
694: | |
695: | |
696: | |
697: | |
698: | |
699: | |
700: | |
701: | |
702: | |
703: | |
704: | |
705: | |
706: | |
707: | |
708: | |
709: | |
710: | public function devicefingerprint($paymentId, CallContext $callContext = null) |
711: | { |
712: | $this->context['paymentId'] = $paymentId; |
713: | $responseClassMap = new ResponseClassMap(); |
714: | $responseClassMap->defaultSuccessResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\DeviceFingerprintDetails'; |
715: | $responseClassMap->defaultErrorResponseClassName = '\Worldline\Connect\Sdk\V1\Domain\ErrorResponse'; |
716: | try { |
717: | return $this->getCommunicator()->get( |
718: | $responseClassMap, |
719: | $this->instantiateUri('/v1/{merchantId}/payments/{paymentId}/devicefingerprint'), |
720: | $this->getClientMetaInfo(), |
721: | null, |
722: | $callContext |
723: | ); |
724: | } catch (ErrorResponseException $e) { |
725: | throw $this->getResponseExceptionFactory()->createException( |
726: | $e->getHttpStatusCode(), |
727: | $e->getErrorResponse(), |
728: | $callContext |
729: | ); |
730: | } |
731: | } |
732: | |
733: | |
734: | private function getResponseExceptionFactory() |
735: | { |
736: | if (is_null($this->responseExceptionFactory)) { |
737: | $this->responseExceptionFactory = new ExceptionFactory(); |
738: | } |
739: | return $this->responseExceptionFactory; |
740: | } |
741: | } |
742: | |