diff --git a/src/Traits/Address.php b/src/Traits/Address.php index 3a71db8..e11005f 100644 --- a/src/Traits/Address.php +++ b/src/Traits/Address.php @@ -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'); @@ -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'); diff --git a/src/Traits/Auth.php b/src/Traits/Auth.php index 80798f0..29a20da 100644 --- a/src/Traits/Auth.php +++ b/src/Traits/Auth.php @@ -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'); diff --git a/src/Traits/Bank.php b/src/Traits/Bank.php index 22f3cd8..0b0f123 100644 --- a/src/Traits/Bank.php +++ b/src/Traits/Bank.php @@ -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'); @@ -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'); diff --git a/src/Traits/BankAccount.php b/src/Traits/BankAccount.php index 2caa4b4..8aa7bc2 100644 --- a/src/Traits/BankAccount.php +++ b/src/Traits/BankAccount.php @@ -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'); @@ -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'); diff --git a/src/Traits/BankBranch.php b/src/Traits/BankBranch.php index 432f27a..56cbb93 100644 --- a/src/Traits/BankBranch.php +++ b/src/Traits/BankBranch.php @@ -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'); @@ -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'); diff --git a/src/Traits/CDV.php b/src/Traits/CDV.php index 4240b9e..82115eb 100644 --- a/src/Traits/CDV.php +++ b/src/Traits/CDV.php @@ -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'); diff --git a/src/Traits/Contact.php b/src/Traits/Contact.php index fdfff9b..152fc15 100644 --- a/src/Traits/Contact.php +++ b/src/Traits/Contact.php @@ -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'); @@ -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'); diff --git a/src/Traits/Organisation.php b/src/Traits/Organisation.php index aa4910b..8e6c84d 100644 --- a/src/Traits/Organisation.php +++ b/src/Traits/Organisation.php @@ -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'); @@ -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'); diff --git a/src/Traits/Product.php b/src/Traits/Product.php index f19c3f0..d9b0a7f 100644 --- a/src/Traits/Product.php +++ b/src/Traits/Product.php @@ -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'); @@ -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'); diff --git a/tests/Traits/AddressTest.php b/tests/Traits/AddressTest.php index bf8a45c..62091a7 100644 --- a/tests/Traits/AddressTest.php +++ b/tests/Traits/AddressTest.php @@ -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(); @@ -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(); diff --git a/tests/Traits/Auth.php b/tests/Traits/Auth.php index 43cee46..b18c706 100644 --- a/tests/Traits/Auth.php +++ b/tests/Traits/Auth.php @@ -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(); diff --git a/tests/Traits/BankAccountTest.php b/tests/Traits/BankAccountTest.php index 3ffc9b0..9202039 100644 --- a/tests/Traits/BankAccountTest.php +++ b/tests/Traits/BankAccountTest.php @@ -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(); @@ -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(); diff --git a/tests/Traits/BankBranchTest.php b/tests/Traits/BankBranchTest.php index b8b6223..2cbcdcc 100644 --- a/tests/Traits/BankBranchTest.php +++ b/tests/Traits/BankBranchTest.php @@ -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(); @@ -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(); diff --git a/tests/Traits/BankTest.php b/tests/Traits/BankTest.php index 36c1696..84610d1 100644 --- a/tests/Traits/BankTest.php +++ b/tests/Traits/BankTest.php @@ -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(); @@ -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(); diff --git a/tests/Traits/ContactTest.php b/tests/Traits/ContactTest.php index aa222d9..17985d5 100644 --- a/tests/Traits/ContactTest.php +++ b/tests/Traits/ContactTest.php @@ -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(); @@ -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(); diff --git a/tests/Traits/CvTest.php b/tests/Traits/CvTest.php index 0ff3d72..d75ddd6 100644 --- a/tests/Traits/CvTest.php +++ b/tests/Traits/CvTest.php @@ -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(); diff --git a/tests/Traits/OrganisationTest.php b/tests/Traits/OrganisationTest.php index b99529d..a5c959c 100644 --- a/tests/Traits/OrganisationTest.php +++ b/tests/Traits/OrganisationTest.php @@ -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(); @@ -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(); diff --git a/tests/Traits/ProductTest.php b/tests/Traits/ProductTest.php index 778628a..d87f9c1 100644 --- a/tests/Traits/ProductTest.php +++ b/tests/Traits/ProductTest.php @@ -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(); @@ -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();