Skip to content

Commit a92402a

Browse files
Merge pull request #32 from PropaySystems/Feature/Add-Companies-Interaction
Feature/Add-Companies-Interaction
2 parents 721a027 + f8831ee commit a92402a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/PaymentPlatformAPI.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ protected function init(): PaymentPlatformAPI
185185
$this->setHeaders([
186186
'Authorization' => 'Bearer '.$this->getToken(),
187187
'Accept' => 'application/json',
188+
'Content-Type' => 'application/json',
188189
]);
189190
}
190191

@@ -201,6 +202,7 @@ protected function init(): PaymentPlatformAPI
201202
$this->setHeaders([
202203
'Authorization' => 'Bearer '.$this->getToken(),
203204
'Accept' => 'application/json',
205+
'Content-Type' => 'application/json',
204206
]);
205207
} else {
206208
// Handle the error scenario

src/Traits/Contact.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function bulkUpdateContact(string $id, array $data = [], string $version
120120
$this->init();
121121
$this->setVersion($version);
122122
$this->setData([
123-
'form_params' => $data,
123+
'json' => $data,
124124
]);
125125
$this->setEndpoint('contacts/bulkUpdate/'.$id);
126126
$this->setRequestType('PUT');
@@ -176,7 +176,7 @@ public function bulkCreateContacts(array $data = [], string $version = 'v1'): mi
176176
$this->init();
177177
$this->setVersion($version);
178178
$this->setData([
179-
'form_params' => $data,
179+
'json' => $data,
180180
]);
181181
$this->setEndpoint('contacts/bulkCreate');
182182
$this->setRequestType('POST');

tests/Traits/ContactTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494

9595
$mock->expects($this->once())->method('init')->willReturnSelf();
9696
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
97-
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
97+
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
9898
$mock->expects($this->once())->method('setEndpoint')->with('contacts/bulkUpdate/'.$id)->willReturnSelf();
9999
$mock->expects($this->once())->method('setRequestType')->with('PUT')->willReturnSelf();
100100

@@ -136,7 +136,7 @@
136136

137137
$mock->expects($this->once())->method('init')->willReturnSelf();
138138
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
139-
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
139+
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
140140
$mock->expects($this->once())->method('setEndpoint')->with('contacts/bulkCreate')->willReturnSelf();
141141
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();
142142

0 commit comments

Comments
 (0)