-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
30 changed files
with
342 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Mollie\Api\Endpoints; | ||
|
||
use Mollie\Api\Resources\BaseCollection; | ||
|
||
abstract class CollectionEndpointAbstract extends EndpointAbstract | ||
{ | ||
/** | ||
* Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object. | ||
* | ||
* @param int $count | ||
* @param object[] $_links | ||
* | ||
* @return BaseCollection | ||
*/ | ||
abstract protected function getResourceCollectionObject($count, $_links); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
namespace Mollie\Api\Endpoints; | ||
|
||
use Mollie\Api\Exceptions\ApiException; | ||
use Mollie\Api\Resources\BaseResource; | ||
use Mollie\Api\Resources\Onboarding; | ||
use Mollie\Api\Resources\ResourceFactory; | ||
|
||
class OnboardingEndpoint extends EndpointAbstract | ||
{ | ||
protected $resourcePath = "onboarding/me"; | ||
|
||
/** | ||
* Get the object that is used by this API endpoint. Every API endpoint uses one type of object. | ||
* | ||
* @return BaseResource | ||
*/ | ||
protected function getResourceObject() | ||
{ | ||
return new Onboarding($this->client); | ||
} | ||
|
||
/** | ||
* Retrieve the organization's onboarding status from Mollie. | ||
* | ||
* Will throw a ApiException if the resource cannot be found. | ||
* | ||
* @return Onboarding | ||
* @throws ApiException | ||
*/ | ||
public function get() | ||
{ | ||
return $this->rest_read('', []); | ||
} | ||
|
||
/** | ||
* Submit data that will be prefilled in the merchant’s onboarding. | ||
* Please note that the data you submit will only be processed when the onboarding status is needs-data. | ||
* | ||
* Information that the merchant has entered in their dashboard will not be overwritten. | ||
* | ||
* Will throw a ApiException if the resource cannot be found. | ||
* | ||
* @return void | ||
* @throws ApiException | ||
*/ | ||
public function submit(array $parameters = []) | ||
{ | ||
|
||
return $this->rest_create($parameters, []); | ||
} | ||
|
||
protected function rest_read($id, array $filters) | ||
{ | ||
$result = $this->client->performHttpCall( | ||
self::REST_READ, | ||
$this->getResourcePath() . $this->buildQueryString($filters) | ||
); | ||
|
||
return ResourceFactory::createFromApiResult($result, $this->getResourceObject()); | ||
} | ||
|
||
protected function rest_create(array $body, array $filters) | ||
{ | ||
$this->client->performHttpCall( | ||
self::REST_CREATE, | ||
$this->getResourcePath() . $this->buildQueryString($filters), | ||
$this->parseRequestBody($body) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.