Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Traits/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function updateContactAddress(string $id, array $data = [], string $versi
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('contact-addresses/'.$id);
$this->setRequestType('PUT');
Expand All @@ -109,7 +109,7 @@ public function createContactAddress(array $data = [], string $version = 'v1'):
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('contact-addresses');
$this->setRequestType('POST');
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trait Auth
public function login(array $data = [], string $version = 'v1'): mixed
{
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint($version.'/auth/login');
$this->setRequestType('POST');
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/Bank.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function updateBank(string $id, array $data = [], string $version = 'v1')
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('banks/'.$id);
$this->setRequestType('PUT');
Expand All @@ -111,7 +111,7 @@ public function createBank(array $data = [], string $version = 'v1'): mixed
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('banks');
$this->setRequestType('POST');
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/BankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function updateContactBankAccount(string $contactNumber, string $contactB
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('contact-bank-account/'.$contactNumber.'/'.$contactBankAccountId);
$this->setRequestType('PUT');
Expand Down Expand Up @@ -121,7 +121,7 @@ public function createContactBankAccount(string $contactNumber, array $data = []
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('contact-bank-account/'.$contactNumber);
$this->setRequestType('POST');
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/BankBranch.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function updateBranch(string $id, array $data = [], string $version = 'v1
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('bank-branches/'.$id);
$this->setRequestType('PUT');
Expand All @@ -110,7 +110,7 @@ public function createBranch(array $data = [], string $version = 'v1'): mixed
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('bank-branches');
$this->setRequestType('POST');
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/CDV.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function verifyCDV(array $data = [], string $version = 'v1'): mixed
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('cdv/verify');
$this->setRequestType('POST');
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function updateContact(string $id, array $data = [], string $version = 'v
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('contacts/'.$id);
$this->setRequestType('PUT');
Expand Down Expand Up @@ -148,7 +148,7 @@ public function createContact(array $data = [], string $version = 'v1'): mixed
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('contacts');
$this->setRequestType('POST');
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/Organisation.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function updateOrganisation(string $id, array $data = [], string $version
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('organisations/'.$id);
$this->setRequestType('PUT');
Expand All @@ -110,7 +110,7 @@ public function createOrganisation(array $data = [], string $version = 'v1'): mi
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('organisations');
$this->setRequestType('POST');
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function updateContactProduct(string $contactId, string $productId, array
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('contact-product/'.$contactId.'/'.$productId);
$this->setRequestType('PUT');
Expand Down Expand Up @@ -113,7 +113,7 @@ public function createContactProduct(string $id, array $data = [], string $versi
$this->init();
$this->setVersion($version);
$this->setData([
'form_params' => $data,
'json' => $data,
]);
$this->setEndpoint('contact-product/'.$id);
$this->setRequestType('POST');
Expand Down
4 changes: 2 additions & 2 deletions tests/Traits/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('contact-addresses/'.$id)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('PUT')->willReturnSelf();

Expand All @@ -93,7 +93,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('contact-addresses')->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down
2 changes: 1 addition & 1 deletion tests/Traits/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$data = ['email' => 'user@example.com', 'password' => 'secret'];
$version = 'v2.0';

$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with($version.'/auth/login')->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down
4 changes: 2 additions & 2 deletions tests/Traits/BankAccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('contact-bank-account/'.$contactNumber.'/'.$contactBankAccountId)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('PUT')->willReturnSelf();

Expand All @@ -96,7 +96,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('contact-bank-account/'.$contactNumber)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down
4 changes: 2 additions & 2 deletions tests/Traits/BankBranchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('bank-branches/'.$id)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('PUT')->willReturnSelf();

Expand All @@ -93,7 +93,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('bank-branches')->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down
4 changes: 2 additions & 2 deletions tests/Traits/BankTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('banks/'.$id)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('PUT')->willReturnSelf();

Expand All @@ -93,7 +93,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('banks')->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down
4 changes: 2 additions & 2 deletions tests/Traits/ContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('contacts/'.$id)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('PUT')->willReturnSelf();

Expand Down Expand Up @@ -115,7 +115,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('contacts')->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down
2 changes: 1 addition & 1 deletion tests/Traits/CvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('cdv/verify')->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down
4 changes: 2 additions & 2 deletions tests/Traits/OrganisationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('organisations/'.$id)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('PUT')->willReturnSelf();

Expand All @@ -67,7 +67,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('organisations')->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down
4 changes: 2 additions & 2 deletions tests/Traits/ProductTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('contact-product/'.$contactId.'/'.$productId)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('PUT')->willReturnSelf();

Expand All @@ -95,7 +95,7 @@

$mock->expects($this->once())->method('init')->willReturnSelf();
$mock->expects($this->once())->method('setVersion')->with($version)->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['form_params' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setData')->with(['json' => $data])->willReturnSelf();
$mock->expects($this->once())->method('setEndpoint')->with('contact-product/'.$id)->willReturnSelf();
$mock->expects($this->once())->method('setRequestType')->with('POST')->willReturnSelf();

Expand Down