2026-03-30 14:54:57 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace FedaPay\OAuth;
|
|
|
|
|
|
|
|
|
|
use FedaPay\Resource;
|
|
|
|
|
use FedaPay\FedaPay;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* CurlClient from https://github.com/stripe/stripe-php
|
|
|
|
|
*/
|
|
|
|
|
class Client extends Resource
|
|
|
|
|
{
|
|
|
|
|
public static function grantClientCredentials()
|
|
|
|
|
{
|
|
|
|
|
list($response, $opts) = static::_staticRequest(
|
2026-04-18 20:32:18 +07:00
|
|
|
'post',
|
|
|
|
|
'/oauth/token',
|
2026-03-30 14:54:57 +07:00
|
|
|
[
|
|
|
|
|
'grant_type' => 'client_credentials',
|
|
|
|
|
'client_id' => FedaPay::getOauthClientId(),
|
|
|
|
|
'client_secret' => FedaPay::getOauthClientSecret()
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return \FedaPay\Util\Util::arrayToFedaPayObject($response, $opts);
|
|
|
|
|
}
|
|
|
|
|
}
|