/home/techb158/ileadtechnology.com/vendor/mollie/laravel-mollie/src/Wrappers
Edit: /home/techb158/ileadtechnology.com/vendor/mollie/laravel-mollie/src/Wrappers/MollieApiWrapper.php (7282B)
* @copyright Mollie B.V.
* @link https://www.mollie.com
*/
namespace Mollie\Laravel\Wrappers;
use Illuminate\Contracts\Config\Repository;
use Mollie\Api\Exceptions\ApiException;
use Mollie\Api\MollieApiClient;
/**
* Class MollieApiWrapper.
*/
class MollieApiWrapper
{
/**
* @var Repository
*/
protected $config;
/**
* @var MollieApiClient
*/
protected $client;
/**
* MollieApiWrapper constructor.
*
* @param Repository $config
* @param MollieApiClient $client
*
* @throws \Mollie\Api\Exceptions\ApiException
* @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 $api_key The Mollie API key, starting with 'test_' or 'live_'
* @throws ApiException
*/
public function setApiKey($api_key)
{
$this->client->setApiKey($api_key);
}
/**
* @param string $access_token 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();
}
/**
* @param $version_string
* @return \Mollie\Laravel\Wrappers\MollieApiWrapper
*/
public function addVersionString($version_string)
{
$this->client->addVersionString($version_string);
return $this;
}
/**
* @return \Mollie\Api\Endpoints\PaymentEndpoint
*/
public function payments()
{
return $this->client->payments;
}
/**
* @return \Mollie\Api\Endpoints\PaymentRefundEndpoint
*/
public function paymentRefunds()
{
return $this->client->paymentRefunds;
}
/**
* @return \Mollie\Api\Endpoints\PaymentLinkEndpoint
*/
public function paymentLinks()
{
return $this->client->paymentLinks;
}
/**
* @return \Mollie\Api\Endpoints\MethodEndpoint
*/
public function methods()
{
return $this->client->methods;
}
/**
* @return \Mollie\Api\Endpoints\ProfileMethodEndpoint
*/
public function profileMethods()
{
return $this->client->profileMethods;
}
/**
* @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\OrganizationEndpoint
*/
public function organizations()
{
return $this->client->organizations;
}
/**
* @return \Mollie\Api\Endpoints\PermissionEndpoint
*/
public function permissions()
{
return $this->client->permissions;
}
/**
* @return \Mollie\Api\Endpoints\InvoiceEndpoint
*/
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;
}
/**
* @return \Mollie\Api\Endpoints\ChargebackEndpoint
*/
public function chargebacks()
{
return $this->client->chargebacks;
}
/**
* @return \Mollie\Api\Endpoints\OrderEndpoint
*/
public function orders()
{
return $this->client->orders;
}
/**
* @return \Mollie\Api\Endpoints\OnboardingEndpoint
*/
public function onboarding()
{
return $this->client->onboarding;
}
/**
* @return \Mollie\Api\Endpoints\WalletEndpoint
*/
public function wallets()
{
return $this->client->wallets;
}
/**
* @return \Mollie\Api\Endpoints\ClientEndpoint
*/
public function clients()
{
return $this->client->clients;
}
/**
* @return \Mollie\Api\Endpoints\OrganizationPartnerEndpoint
*/
public function organizationPartners()
{
return $this->client->organizationPartners;
}
/**
* Handle dynamic property calls.
*
* @param string $property
* @return mixed
*/
public function __get($property)
{
if (method_exists($this, $property)) {
return call_user_func([$this, $property]);
}
$message = '%s has no property or method "%s".';
throw new \Error(
sprintf($message, static::class, $property)
);
}
}