@@ -38,6 +38,10 @@ class Transfers extends MoipResource
38
38
protected function initialize ()
39
39
{
40
40
$ this ->data = new stdClass ();
41
+ $ this ->data ->transferInstrument = new stdClass ();
42
+ $ this ->data ->transferInstrument ->bankAccount = new stdClass ();
43
+ $ this ->data ->transferInstrument ->bankAccount ->holder = new stdClass ();
44
+ $ this ->data ->transferInstrument ->bankAccount ->holder ->taxDocument = new stdClass ();
41
45
}
42
46
43
47
/**
@@ -76,16 +80,6 @@ protected function populate(stdClass $response)
76
80
return $ transfers ;
77
81
}
78
82
79
- /**
80
- * Initializes new transferInstrument instance if it doesn't exist.
81
- */
82
- private function intializeTransferInstrument ()
83
- {
84
- if (!isset ($ this ->data ->transferInstrument )) {
85
- $ this ->data ->transferInstrument = new stdClass ();
86
- }
87
- }
88
-
89
83
/**
90
84
* Set info of transfers.
91
85
*
@@ -107,9 +101,7 @@ public function setTransfers(
107
101
$ accountCheckNumber
108
102
) {
109
103
$ this ->data ->amount = $ amount ;
110
- $ this ->intializeTransferInstrument ();
111
104
$ this ->data ->transferInstrument ->method = self ::METHOD ;
112
- $ this ->data ->transferInstrument ->bankAccount = new stdClass ();
113
105
$ this ->data ->transferInstrument ->bankAccount ->type = self ::TYPE ;
114
106
$ this ->data ->transferInstrument ->bankAccount ->bankNumber = $ bankNumber ;
115
107
$ this ->data ->transferInstrument ->bankAccount ->agencyNumber = $ agencyNumber ;
@@ -140,10 +132,7 @@ public function getTransfers()
140
132
*/
141
133
public function setHolder ($ fullname , $ taxDocument )
142
134
{
143
- $ this ->intializeTransferInstrument ();
144
- $ this ->data ->transferInstrument ->bankAccount ->holder = new stdClass ();
145
135
$ this ->data ->transferInstrument ->bankAccount ->holder ->fullname = $ fullname ;
146
- $ this ->data ->transferInstrument ->bankAccount ->holder ->taxDocument = new stdClass ();
147
136
$ this ->data ->transferInstrument ->bankAccount ->holder ->taxDocument ->type = self ::TYPE_HOLD ;
148
137
$ this ->data ->transferInstrument ->bankAccount ->holder ->taxDocument ->number = $ taxDocument ;
149
138
0 commit comments