<?php
namespace Srmklive\PayPal;
use Exception;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
class PayPalFacadeAccessor
{
/**
* PayPal API provider object.
*
* @var
*/
public static $provider;
/**
* Get specific PayPal API provider object to use.
*
* @throws Exception
*
* @return \Srmklive\PayPal\Services\PayPal
*/
public static function getProvider()
{
return self::$provider;
}
/**
* Set PayPal API Client to use.
*
* @throws \Exception
*
* @return \Srmklive\PayPal\Services\PayPal
*/
public static function setProvider()
{
// Set default provider. Defaults to ExpressCheckout
self::$provider = new PayPalClient();
return self::getProvider();
}
}
In case of an error, the API will return an error response containing a specific error code 400, 403 Failed and a user-friendly message. Refer to our API documentation for a comprehensive list of error codes and their descriptions.