Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 #727

Open
wants to merge 149 commits into
base: master
Choose a base branch
from
Open

V3 #727

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
0c2c398
wip
Naoray Jan 3, 2024
6c9102e
wip
Naoray Jan 3, 2024
1da742e
add type declarations to all endpoints
Naoray Jan 5, 2024
5cb58e2
Fix styling
Naoray Jan 5, 2024
f66f9c0
fix tests
Naoray Jan 5, 2024
c5bdbd2
merge in changes
Naoray Jun 24, 2024
edcc1e8
Fix styling
Naoray Jun 24, 2024
c10e175
add PSR18 http adapter
Naoray Jun 24, 2024
9d69299
Fix styling
Naoray Jun 24, 2024
1da1fc4
wip
Naoray Jun 24, 2024
ac55229
wip
Naoray Jun 24, 2024
2920090
wip
Naoray Jun 24, 2024
d66feba
Fix styling
Naoray Jun 24, 2024
8b1ba43
wip
Naoray Jun 25, 2024
035d70e
Fix styling
Naoray Jun 25, 2024
18b13e8
merge in changes
Naoray Jun 27, 2024
c5e6e18
Fix styling
Naoray Jun 27, 2024
7d86f99
fix typehints
Naoray Jun 27, 2024
b21057f
wip
Naoray Jun 27, 2024
1d42fa9
Fix styling
Naoray Jun 27, 2024
76e46b5
wip
Naoray Jun 28, 2024
c4f62a0
typecast embedded resources
Naoray Jun 28, 2024
1bd03e3
Fix styling
Naoray Jun 28, 2024
2efbacf
wip
sandervanhooft Jun 21, 2024
bbefe74
Fix styling
sandervanhooft Jun 21, 2024
acbeadd
wip
sandervanhooft Jun 21, 2024
cf26b85
wip
sandervanhooft Jun 21, 2024
837aa04
wip
sandervanhooft Jun 21, 2024
a4a9277
Update version number
sandervanhooft Jun 24, 2024
6436be8
merge in changes
Naoray Jun 30, 2024
e122737
Fix styling
Naoray Jun 30, 2024
85e5909
update github actions
Naoray Jun 30, 2024
db7a507
add php7.4 compatible invade dependency/
Naoray Jun 30, 2024
c743574
remove spatie/invade dependency
Naoray Jun 30, 2024
3fa1abc
change return types to be php7.4 compatible
Naoray Jun 30, 2024
a801414
Fix styling
Naoray Jun 30, 2024
41e3dfa
wip
Naoray Jun 30, 2024
0b135db
update github action versions
Naoray Jun 30, 2024
7e45e92
wip
Naoray Jul 10, 2024
9258b45
add UPGRADING guide
Naoray Jul 16, 2024
ad8930f
wip
Naoray Jul 16, 2024
07ff441
merge in changes
Naoray Jul 17, 2024
6144f6a
remove static resource and collection methods
Naoray Jul 17, 2024
4f0346a
wip
Naoray Jul 17, 2024
2543eef
wip
Naoray Jul 17, 2024
987185a
add changelog action
Naoray Jul 18, 2024
c8300c7
wip
Naoray Jul 18, 2024
6f004b8
wip
Naoray Jul 18, 2024
c477530
wip
Naoray Aug 26, 2024
36b6e65
wip
Naoray Sep 6, 2024
164c1e0
wip
Naoray Sep 6, 2024
0115efa
wip
Naoray Sep 9, 2024
4cdbb75
make v3 php7.4 compatible
Naoray Sep 9, 2024
4fad5bc
wip
Naoray Sep 9, 2024
ec1b4ef
wip
Naoray Sep 9, 2024
44ddaa0
wip
Naoray Sep 9, 2024
be99500
wip
Naoray Sep 9, 2024
bd15bf4
wip
Naoray Sep 9, 2024
ca4a799
wip
Naoray Sep 9, 2024
b74f996
wip
Naoray Sep 9, 2024
8d0a3fd
wip
Naoray Sep 9, 2024
e56a37a
wip
Naoray Sep 9, 2024
8298dff
wip
Naoray Sep 9, 2024
a02a1d1
wip
Naoray Sep 9, 2024
ae721ee
wip
Naoray Sep 9, 2024
bb1d966
wip
Naoray Sep 9, 2024
20317a8
wip
Naoray Sep 9, 2024
5cbc383
wip
Naoray Nov 12, 2024
73404f0
wip
Naoray Nov 14, 2024
e249f3e
wip
Naoray Nov 26, 2024
f2f9fcf
wip
Naoray Nov 26, 2024
f842f91
wip
Naoray Nov 26, 2024
be6161e
wip
Naoray Nov 28, 2024
5e4c726
wip
Naoray Dec 3, 2024
a9b44dd
Fixes coding style
Naoray Dec 3, 2024
c5ef68d
wip
Naoray Dec 3, 2024
79e75b5
Fixes coding style
Naoray Dec 3, 2024
6a06935
fix phpstan
Naoray Dec 3, 2024
edd5d01
fix php7.4 compatibility
Naoray Dec 3, 2024
c0dd9dd
fix php7.4 compatibility
Naoray Dec 3, 2024
cfea22e
Fixes coding style
Naoray Dec 3, 2024
f3de946
fix php7.4 compatibility
Naoray Dec 3, 2024
f80f4f1
fix php7.4 compatibility
Naoray Dec 3, 2024
7c70d2c
fix php7.4 compatibility
Naoray Dec 3, 2024
3736cfe
fix php7.4 compatibility
Naoray Dec 3, 2024
d5a2150
Fixes coding style
Naoray Dec 3, 2024
4c472c9
fix all phpstan errors
Naoray Dec 4, 2024
fa45774
Fixes coding style
Naoray Dec 4, 2024
25aefc7
fix all phpstan errors, this time for sure :fire:
Naoray Dec 4, 2024
81deec0
Fixes coding style
Naoray Dec 4, 2024
b448e2f
wip
Naoray Dec 4, 2024
e15fb88
Fixes coding style
Naoray Dec 4, 2024
7757a39
wip
Naoray Dec 4, 2024
2a21c70
wip
Naoray Dec 4, 2024
e72d0e6
Fixes coding style
Naoray Dec 4, 2024
9a58ddf
fix tests
Naoray Dec 5, 2024
82cc035
Fixes coding style
Naoray Dec 5, 2024
34f8dd5
wip
Naoray Dec 5, 2024
02ca3a2
Fixes coding style
Naoray Dec 5, 2024
8aefdb1
wip
Naoray Dec 6, 2024
16785c5
Fixes coding style
Naoray Dec 6, 2024
b5f6665
wip
Naoray Dec 6, 2024
ab6772d
wip
Naoray Dec 6, 2024
526b270
Merge branch 'master' into v3
Naoray Dec 6, 2024
8007090
Add support for php8.4 to GH test workflow
sandervanhooft Dec 9, 2024
8f31fbd
add sales invoices endpoint
Naoray Dec 10, 2024
3f1c1fa
Fixes coding style
Naoray Dec 10, 2024
fcdbbb0
fix phpstan
Naoray Dec 10, 2024
be3dbe7
wip
Naoray Dec 10, 2024
894e3ac
wip
Naoray Dec 10, 2024
34f2335
Fix styling
Naoray Dec 10, 2024
6915f0d
fix phpstan
Naoray Dec 10, 2024
261cad3
fix phpstan
Naoray Dec 10, 2024
8cddaf6
wip
Naoray Dec 10, 2024
7578a2c
Fixes coding style
Naoray Dec 10, 2024
1f7a76f
wip
Naoray Dec 11, 2024
94d5a76
wip
Naoray Dec 10, 2024
384e7d5
wip
Naoray Dec 12, 2024
5fd78ed
Fixes coding style
Naoray Dec 12, 2024
46a0bdc
wip
Naoray Dec 12, 2024
8c56845
Fixes coding style
Naoray Dec 12, 2024
9f693e4
wip
Naoray Dec 12, 2024
fbf8e3e
Fixes coding style
Naoray Dec 12, 2024
a3a67a8
Merge pull request #755 from mollie/sandervanhooft-patch-1
sandervanhooft Dec 12, 2024
983595a
remove hydration setting and always hydrate
Naoray Dec 17, 2024
ff5ef29
Fixes coding style
Naoray Dec 17, 2024
30ed85c
wip
Naoray Dec 18, 2024
b5aac11
Fixes coding style
Naoray Dec 18, 2024
109e989
wip
Naoray Dec 18, 2024
55d3425
wip
Naoray Dec 18, 2024
94918f1
wip
Naoray Dec 18, 2024
9d3ed67
Fixes coding style
Naoray Dec 18, 2024
1fa13dd
wip
Naoray Dec 18, 2024
539fa62
wip
Naoray Dec 18, 2024
953ae1a
wip
Naoray Dec 18, 2024
df1b4b5
Fixes coding style
Naoray Dec 18, 2024
1bf7dde
wip
Naoray Dec 18, 2024
db324c6
wip
Naoray Dec 18, 2024
529f6e5
Fixes coding style
Naoray Dec 18, 2024
0ccde0d
wip
Naoray Dec 19, 2024
d66ed26
wip
Naoray Dec 19, 2024
9be0ce6
wip
Naoray Dec 20, 2024
cb7f34a
wip
Naoray Dec 20, 2024
292e7ba
wip
Naoray Dec 20, 2024
29cce99
wip
Naoray Dec 20, 2024
60209e6
wip
Naoray Dec 20, 2024
24d5561
wip
Naoray Dec 20, 2024
b5827ca
wip
Naoray Dec 20, 2024
6360e9d
Fixes coding style
Naoray Dec 20, 2024
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
Prev Previous commit
Next Next commit
wip
  • Loading branch information
Naoray committed Sep 9, 2024
commit b74f99624cd1e1b5c8dd308e91d25983fda9444d
2 changes: 1 addition & 1 deletion src/Contracts/HasPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

interface HasPayload
{
public function payload(): BodyRepository;
public function payload(): PayloadRepository;
}
10 changes: 0 additions & 10 deletions src/Contracts/JsonBodyRepository.php

This file was deleted.

10 changes: 10 additions & 0 deletions src/Contracts/JsonPayloadRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Mollie\Api\Contracts;

use Stringable;

interface JsonPayloadRepository extends PayloadRepository, Stringable
{
//
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\StreamInterface;

interface BodyRepository
interface PayloadRepository
{
/**
* @param mixed $value
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Middleware/ThrowExceptionIfRequestFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public function __invoke(Response $response)
$message .= ". Documentation: {$body->_links->documentation->href}";
}

if ($response->getPendingRequest()->body()) {
if ($response->getPendingRequest()->payload()) {
$streamFactory = $response
->getPendingRequest()
->getFactoryCollection()
->streamFactory;

$message .= ". Request body: {$response->getPendingRequest()->body()->toStream($streamFactory)->getContents()}";
$message .= ". Request body: {$response->getPendingRequest()->payload()->toStream($streamFactory)->getContents()}";
}

throw new ApiException(
Expand Down
4 changes: 3 additions & 1 deletion src/Http/Payload/PaymentRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public function data(): array
'type' => 'organization',
'organizationId' => $this->organizationId,
],
'delayUntil' => $this->delayUntil?->format('Y-m-d'),
'delayUntil' => $this->delayUntil
? $this->delayUntil->format('Y-m-d')
: null,
];
}
}
12 changes: 6 additions & 6 deletions src/Http/PendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Mollie\Api\Http;

use Mollie\Api\Contracts\BodyRepository;
use Mollie\Api\Contracts\Connector;
use Mollie\Api\Contracts\HasResponse;
use Mollie\Api\Contracts\PayloadRepository;
use Mollie\Api\Helpers\MiddlewarePriority;
use Mollie\Api\Helpers\Url;
use Mollie\Api\Http\Middleware\ApplyIdempotencyKey;
Expand Down Expand Up @@ -32,7 +32,7 @@ class PendingRequest

protected Request $request;

protected ?BodyRepository $body = null;
protected ?PayloadRepository $payload = null;

protected string $method;

Expand Down Expand Up @@ -71,16 +71,16 @@ public function __construct(Connector $connector, Request $request)

}

public function setPayload(BodyRepository $bodyRepository): self
public function setPayload(PayloadRepository $bodyRepository): self
{
$this->body = $bodyRepository;
$this->payload = $bodyRepository;

return $this;
}

public function body(): ?BodyRepository
public function payload(): ?PayloadRepository
{
return $this->body;
return $this->payload;
}

public function url(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Http/PendingRequest/AuthenticateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private function removeTestmode(PendingRequest $pendingRequest): void
}

if ($pendingRequest->getRequest() instanceof HasPayload) {
$pendingRequest->body()?->remove('testmode');
$pendingRequest->payload()->remove('testmode');
}
}
}
2 changes: 1 addition & 1 deletion src/Http/Requests/CreatePaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function defaultPayload(): array

protected function defaultQuery(): array
{
return $this->query?->toArray() ?? [];
return $this->query ? $this->query->toArray() : [];
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Http/Requests/PaginatedRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public function __construct(

protected function defaultQuery(): array
{
return $this->query?->toArray() ?? [];
return $this->query
? $this->query->toArray()
: [];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Mollie\Api\Repositories;

use Mollie\Api\Contracts\JsonBodyRepository as JsonBodyRepositoryContract;
use Mollie\Api\Contracts\JsonPayloadRepository as JsonBodyRepositoryContract;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\StreamInterface;

class JsonBodyRepository implements JsonBodyRepositoryContract
class JsonPayloadRepository implements JsonBodyRepositoryContract
{
private array $store = [];

Expand Down
8 changes: 4 additions & 4 deletions src/Traits/HasJsonPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Mollie\Api\Traits;

use Mollie\Api\Repositories\JsonBodyRepository;
use Mollie\Api\Repositories\JsonPayloadRepository;

trait HasJsonPayload
{
public ?JsonBodyRepository $body = null;
public ?JsonPayloadRepository $body = null;

public function payload(): JsonBodyRepository
public function payload(): JsonPayloadRepository
{
return $this->body ??= new JsonBodyRepository($this->defaultPayload());
return $this->body ??= new JsonPayloadRepository($this->defaultPayload());
}

protected function defaultPayload(): array
Expand Down
6 changes: 3 additions & 3 deletions src/Traits/ManagesPsrRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Mollie\Api\Traits;

use Mollie\Api\Contracts\BodyRepository;
use Mollie\Api\Contracts\PayloadRepository;
use Mollie\Api\Helpers\Factories;
use Mollie\Api\Helpers\Url;
use Mollie\Api\Http\PendingRequest;
Expand All @@ -29,8 +29,8 @@ public function createPsrRequest(): RequestInterface
$request = $request->withHeader($headerName, $headerValue);
}

if ($this->body() instanceof BodyRepository) {
$request = $request->withBody($this->body()->toStream($factories->streamFactory));
if ($this->payload() instanceof PayloadRepository) {
$request = $request->withBody($this->payload()->toStream($factories->streamFactory));
}

return $request;
Expand Down
Loading