* @copyright Mollie B.V. * @link https://www.mollie.com */ namespace Mollie\Laravel\Wrappers; use Illuminate\Contracts\Config\Repository; use Mollie\Api\MollieApiClient; /** * Class MollieApiWrapper. */ class MollieApiWrapper { /** * @var Repository */ protected $config; /** * @var MollieApiClient */ protected $client; /** * MollieApiWrapper constructor. * * @param Repository $config * @param MollieApiClient $client * * @return void */ public function __construct(Repository $config, MollieApiClient $client) { $this->config = $config; $this->client = $client; $this->setApiKey($this->config->get('mollie.key')); } /** * @param string $url */ public function setApiEndpoint($url) { $this->client->setApiEndpoint($url); } /** * @return string */ public function getApiEndpoint() { return $this->client->getApiEndpoint(); } /** * @param string $apiKey The Mollie API key, starting with 'test_' or 'live_' * @throws ApiException */ public function setApiKey($api_key) { $this->client->setApiKey($api_key); } /** * @param string $accessToken OAuth access token, starting with 'access_' * @throws ApiException */ public function setAccessToken($access_token) { $this->client->setAccessToken($access_token); } /** * @return bool */ public function usesOAuth() { return $this->client->usesOAuth(); } /** * @return Mollie\Api\Endpoints\PaymentEndpoint */ public function payments() { return $this->client->payments; } /** * @return Mollie\Api\Endpoints\MethodEndpoint */ public function methods() { return $this->client->methods; } /** * @return Mollie\Api\Endpoints\CustomerEndpoint */ public function customers() { return $this->client->customers; } /** * @return Mollie\Api\Endpoints\SettlementsEndpoint */ public function settlements() { return $this->client->settlements; } /** * @return Mollie\Api\Endpoints\SubscriptionEndpoint */ public function subscriptions() { return $this->client->subscriptions; } /** * @return Mollie\Api\Endpoints\CustomerPaymentsEndpoint */ public function customerPayments() { return $this->client->customerPayments; } /** * @return Mollie\Api\Endpoints\MandateEndpoint */ public function mandates() { return $this->client->mandates; } /** * @return Mollie\Api\Endpoints\CustomerPaymentsEndpoint */ public function invoices() { return $this->client->invoices; } /** * @return Mollie\Api\Endpoints\ProfileEndpoint */ public function profiles() { return $this->client->profiles; } /** * @return Mollie\Api\Endpoints\RefundEndpoint */ public function refunds() { return $this->client->refunds; } }