1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class SepaDirectDebitPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput
14: {
15: /**
16: * @var FraudResults
17: */
18: public $fraudResults = null;
19:
20: /**
21: * @var PaymentProduct771SpecificOutput
22: */
23: public $paymentProduct771SpecificOutput = null;
24:
25: /**
26: * @var string
27: */
28: public $token = null;
29:
30: /**
31: * @return object
32: */
33: public function toObject()
34: {
35: $object = parent::toObject();
36: if (!is_null($this->fraudResults)) {
37: $object->fraudResults = $this->fraudResults->toObject();
38: }
39: if (!is_null($this->paymentProduct771SpecificOutput)) {
40: $object->paymentProduct771SpecificOutput = $this->paymentProduct771SpecificOutput->toObject();
41: }
42: if (!is_null($this->token)) {
43: $object->token = $this->token;
44: }
45: return $object;
46: }
47:
48: /**
49: * @param object $object
50: * @return $this
51: * @throws UnexpectedValueException
52: */
53: public function fromObject($object)
54: {
55: parent::fromObject($object);
56: if (property_exists($object, 'fraudResults')) {
57: if (!is_object($object->fraudResults)) {
58: throw new UnexpectedValueException('value \'' . print_r($object->fraudResults, true) . '\' is not an object');
59: }
60: $value = new FraudResults();
61: $this->fraudResults = $value->fromObject($object->fraudResults);
62: }
63: if (property_exists($object, 'paymentProduct771SpecificOutput')) {
64: if (!is_object($object->paymentProduct771SpecificOutput)) {
65: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct771SpecificOutput, true) . '\' is not an object');
66: }
67: $value = new PaymentProduct771SpecificOutput();
68: $this->paymentProduct771SpecificOutput = $value->fromObject($object->paymentProduct771SpecificOutput);
69: }
70: if (property_exists($object, 'token')) {
71: $this->token = $object->token;
72: }
73: return $this;
74: }
75: }
76: