This repository was archived by the owner on Oct 15, 2024. It is now read-only.
Commit 33f9126 Kleyton Basilio Pilon
committed
1 parent c860b75 commit 33f9126 Copy full SHA for 33f9126
File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ protected function populate(stdClass $response)
50
50
return $ transfers ;
51
51
}
52
52
53
+ /**
54
+ * Initializes new transferInstrument instance if it doesn't exist
55
+ */
56
+ private function intializeTransferInstrument ()
57
+ {
58
+ if (!isset ($ this ->data ->transferInstrument )) {
59
+ $ this ->data ->transferInstrument = new stdClass ();
60
+ }
61
+ }
62
+
53
63
/**
54
64
* Set info of transfers.
55
65
*
@@ -71,7 +81,7 @@ public function setTransfers(
71
81
$ accountCheckNumber
72
82
) {
73
83
$ this ->data ->amount = $ amount ;
74
- $ this ->data -> transferInstrument = new stdClass ();
84
+ $ this ->intializeTransferInstrument ();
75
85
$ this ->data ->transferInstrument ->method = self ::METHOD ;
76
86
$ this ->data ->transferInstrument ->bankAccount = new stdClass ();
77
87
$ this ->data ->transferInstrument ->bankAccount ->type = self ::TYPE ;
@@ -92,6 +102,7 @@ public function setTransfers(
92
102
*/
93
103
public function setHolder ($ fullname , $ taxDocument )
94
104
{
105
+ $ this ->intializeTransferInstrument ();
95
106
$ this ->data ->transferInstrument ->bankAccount ->holder = new stdClass ();
96
107
$ this ->data ->transferInstrument ->bankAccount ->holder ->fullname = $ fullname ;
97
108
$ this ->data ->transferInstrument ->bankAccount ->holder ->taxDocument = new stdClass ();
You can’t perform that action at this time.
0 commit comments