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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ An example of using the API client. (check [API documentation](https://docs.geta
### 1. instanciate client in test mode

```php
$alma = new \Alma\API\Infrastructure\CurlClient($apiKey, ['mode' => \Alma\API\Infrastructure\CurlClient::TEST_MODE]);
$alma = new \Alma\Client\Application\CurlClient($apiKey, ['mode' => \Alma\Client\Application\CurlClient::TEST_MODE]);
```

### 2. check eligibility
Expand Down Expand Up @@ -259,8 +259,8 @@ exit();
// ...
$payment = $alma->payments->fetch($paymentId);
switch($payment->state) {
case \Alma\API\Domain\Entity\Payment::STATE_IN_PROGRESS: break;
case \Alma\API\Domain\Entity\Payment::STATE_PAID: break;
case \Alma\Client\Domain\Entity\Payment::STATE_IN_PROGRESS: break;
case \Alma\Client\Domain\Entity\Payment::STATE_PAID: break;
}
// ...
```
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@
],
"autoload": {
"psr-4": {
"Alma\\API\\": "src/"
"Alma\\Client\\": "src/Client",
"Alma\\Plugin\\": "src/Plugin"
}
},
"autoload-dev": {
"psr-4": {
"Alma\\API\\Tests\\": "tests/"
"Alma\\Client\\Tests\\Integration\\": "tests/Client/Integration",
"Alma\\Plugin\\Tests\\Integration\\": "tests/Plugin/Integration",
"Alma\\Client\\Tests\\Unit\\": "tests/Client/Unit",
"Alma\\Plugin\\Tests\\Unit\\": "tests/Plugin/Unit"
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.ci.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<testsuites>
<testsuite name="Alma PHP Client Unit Test Suite">
<directory>tests/Unit</directory>
<directory>tests/Client/Unit</directory>
</testsuite>
</testsuites>

Expand Down
2 changes: 1 addition & 1 deletion phpunit.ci.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<testsuites>
<testsuite name="Alma PHP Client Unit Test Suite">
<directory>tests/Unit</directory>
<directory>tests/Client/Unit</directory>
</testsuite>
</testsuites>
<filter>
Expand Down
4 changes: 2 additions & 2 deletions phpunit.dist.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

<testsuites>
<testsuite name="Alma PHP Client Unit Test Suite">
<directory>./tests/Unit</directory>
<directory>./tests/Client/Unit</directory>
</testsuite>
<testsuite name="Alma PHP Client Integration Test Suite">
<directory>./tests/Integration</directory>
<directory>./tests/Client/Integration</directory>
</testsuite>
</testsuites>

Expand Down
4 changes: 2 additions & 2 deletions phpunit.dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<testsuites>
<testsuite name="Alma PHP Client Unit Test Suite">
<directory>./tests/Unit</directory>
<directory>./tests/Client/Unit</directory>
</testsuite>
<testsuite name="Alma PHP Client Integration Test Suite">
<directory>./tests/Integration</directory>
<directory>./tests/Client/Integration</directory>
</testsuite>
</testsuites>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
* @license https://opensource.org/licenses/MIT The MIT License
*/

namespace Alma\API\Infrastructure;

use Iterator;
namespace Alma\Client\Application;

abstract class AbstractPaginatedResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
*
*/

namespace Alma\API\Infrastructure;
namespace Alma\Client\Application;

use Alma\API\Domain\ValueObject\Environment;
use Alma\Client\Domain\ValueObject\Environment;
use InvalidArgumentException;

class ClientConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
*
*/

namespace Alma\API\Infrastructure;
namespace Alma\Client\Application;

use Alma\API\Infrastructure\Exception\ClientException;
use Alma\API\Infrastructure\Exception\DependenciesException;
use Alma\Client\Application\Exception\ClientException;
use Alma\Client\Application\Exception\DependenciesException;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Log\LoggerAwareTrait;
Expand Down Expand Up @@ -67,9 +67,9 @@ public function getConfig(): ClientConfiguration
}

/**
* Checks if the client is available (i.e., properly configured).
* Checks if the Client is available (i.e., properly configured).
*
* @return bool True if the client is available, false otherwise.
* @return bool True if the Client is available, false otherwise.
*/
public function isAvailable(): bool
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;

use InvalidArgumentException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;

class CartDto implements DtoInterface {
private array $items = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;

use InvalidArgumentException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;

use InvalidArgumentException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;

interface DtoInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;


use InvalidArgumentException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;

use InvalidArgumentException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Alma\API\Application\DTO\MerchantBusinessEvent;
namespace Alma\Client\Application\DTO\MerchantBusinessEvent;

use Alma\API\Infrastructure\Exception\ParametersException;
use Alma\Client\Application\Exception\ParametersException;

class CartInitiatedBusinessEventDto
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Alma\API\Application\DTO\MerchantBusinessEvent;
namespace Alma\Client\Application\DTO\MerchantBusinessEvent;


use Alma\API\Infrastructure\Exception\ParametersException;
use Alma\Client\Application\Exception\ParametersException;

class OrderConfirmedBusinessEventDto
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Alma\API\Application\DTO\MerchantData;
namespace Alma\Client\Application\DTO\MerchantData;

use Alma\API\Application\DTO\DtoInterface;
use Alma\Client\Application\DTO\DtoInterface;

class CmsFeaturesDto implements DtoInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Alma\API\Application\DTO\MerchantData;
namespace Alma\Client\Application\DTO\MerchantData;

use Alma\API\Application\DTO\DtoInterface;
use Alma\Client\Application\DTO\DtoInterface;

class CmsInfoDto implements DtoInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO\MerchantData;
namespace Alma\Client\Application\DTO\MerchantData;

class MerchantDataDto
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;


use InvalidArgumentException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;


use InvalidArgumentException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Alma\API\Application\DTO;
namespace Alma\Client\Application\DTO;

use InvalidArgumentException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Alma\API\Application\DTO\ShareOfCheckout;
namespace Alma\Client\Application\DTO\ShareOfCheckout;

use Alma\API\Application\DTO\DtoInterface;
use Alma\API\Infrastructure\Exception\ParametersException;
use Alma\Client\Application\DTO\DtoInterface;
use Alma\Client\Application\Exception\ParametersException;
use DateTime;

class ShareOfCheckoutDto implements DtoInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Alma\API\Application\DTO\ShareOfCheckout;
namespace Alma\Client\Application\DTO\ShareOfCheckout;

use Alma\API\Application\DTO\DtoInterface;
use Alma\Client\Application\DTO\DtoInterface;

class ShareOfCheckoutOrderDto implements DTOInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Alma\API\Application\DTO\ShareOfCheckout;
namespace Alma\Client\Application\DTO\ShareOfCheckout;

use Alma\API\Application\DTO\DtoInterface;
use Alma\Client\Application\DTO\DtoInterface;

class ShareOfCheckoutPaymentMethodDto implements DTOInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Alma\API\Application\DTO\ShareOfCheckout;
namespace Alma\Client\Application\DTO\ShareOfCheckout;

use Alma\API\Application\DTO\DtoInterface;
use Alma\Client\Application\DTO\DtoInterface;

class ShareOfCheckoutTotalOrderDto implements DTOInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

namespace Alma\API\Infrastructure\Endpoint;
namespace Alma\Client\Application\Endpoint;

use Alma\API\Infrastructure\CurlClient;
use Alma\API\Infrastructure\Request;
use Alma\Client\Application\Request;
use Psr\Http\Client\ClientInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
*
*/

namespace Alma\API\Infrastructure\Endpoint;
namespace Alma\Client\Application\Endpoint;

use Alma\API\Infrastructure\Exception\Endpoint\ConfigurationEndpointException;
use Alma\Client\Application\Exception\Endpoint\ConfigurationEndpointException;
use Psr\Http\Client\ClientExceptionInterface;

class ConfigurationEndpoint extends AbstractEndpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
*
*/

namespace Alma\API\Infrastructure\Endpoint;
namespace Alma\Client\Application\Endpoint;

use Alma\API\Domain\Entity\DataExport;
use Alma\API\Infrastructure\Exception\Endpoint\DataExportEndpointException;
use Alma\API\Infrastructure\Exception\ParametersException;
use Alma\Client\Application\Exception\Endpoint\DataExportEndpointException;
use Alma\Client\Application\Exception\ParametersException;
use Alma\Client\Domain\Entity\DataExport;
use Psr\Http\Client\ClientExceptionInterface;

class DataExportEndpoint extends AbstractEndpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
*
*/

namespace Alma\API\Infrastructure\Endpoint;
namespace Alma\Client\Application\Endpoint;

use Alma\API\Application\DTO\EligibilityDto;
use Alma\API\Domain\Entity\Eligibility;
use Alma\API\Domain\Entity\EligibilityList;
use Alma\API\Infrastructure\Exception\Endpoint\EligibilityEndpointException;
use Alma\API\Infrastructure\Exception\ParametersException;
use Alma\Client\Application\DTO\EligibilityDto;
use Alma\Client\Application\Exception\Endpoint\EligibilityEndpointException;
use Alma\Client\Application\Exception\ParametersException;
use Alma\Client\Domain\Entity\Eligibility;
use Alma\Client\Domain\Entity\EligibilityList;
use Psr\Http\Client\ClientExceptionInterface;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
*
*/

namespace Alma\API\Infrastructure\Endpoint;
namespace Alma\Client\Application\Endpoint;

use Alma\API\Application\DTO\MerchantBusinessEvent\CartInitiatedBusinessEventDto;
use Alma\API\Application\DTO\MerchantBusinessEvent\OrderConfirmedBusinessEventDto;
use Alma\API\Domain\Entity\FeePlan;
use Alma\API\Domain\Entity\FeePlanList;
use Alma\API\Domain\Entity\Merchant;
use Alma\API\Infrastructure\Exception\Endpoint\MerchantEndpointException;
use Alma\API\Infrastructure\Exception\ParametersException;
use Alma\Client\Application\DTO\MerchantBusinessEvent\CartInitiatedBusinessEventDto;
use Alma\Client\Application\DTO\MerchantBusinessEvent\OrderConfirmedBusinessEventDto;
use Alma\Client\Application\Exception\Endpoint\MerchantEndpointException;
use Alma\Client\Application\Exception\ParametersException;
use Alma\Client\Domain\Entity\FeePlan;
use Alma\Client\Domain\Entity\FeePlanList;
use Alma\Client\Domain\Entity\Merchant;
use Psr\Http\Client\ClientExceptionInterface;

class MerchantEndpoint extends AbstractEndpoint
Expand Down
Loading
Loading