Github

Extends \Dotpay\Resource\Resource

Allow to use Github Api for checking a version of this SDK and other projects.

package

Default

Methods

Initialize the resource.

__construct(\Dotpay\Model\Configuration $config, \Dotpay\Tool\Curl $curl) 
inherited

Arguments

$config

\Dotpay\Model\Configuration

Configuration of Dotpay payments

$curl

\Dotpay\Tool\Curl

Tool for using the cURL library

Close the resource.

close() 
inherited

Return a string which contain a header with Accept rule.

getAcceptHeader() : string
inherited

Response

string

Return a parsed response from the external server.

getContent(string $url) : array
inherited
Throws
\Dotpay\Exception\Resource\UnauthorizedException

Thrown when an authorization is failed

\Dotpay\Exception\Resource\ForbiddenException

Thrown when user doesn't have an access or when logging data is wrong

\Dotpay\Exception\Resource\NotFoundException

Thrown when a destination is not found

\Dotpay\Exception\Resource\UnavailableException

Thrown when the resource is not available

\Dotpay\Exception\Resource\TimeoutException

Thrown when timeout is exceed

\Dotpay\Exception\Resource\ServerException

Thrown when server of a destination does not work correctly

Arguments

$url

string

Url of a destination request

Response

array

Result which is decoded as array

Return an object with a tool for using the cURL library.

getCurl() : \Dotpay\Tool\Curl
inherited

Return details of version of the project which is developed on the given Github user account.

getLatestProjectVersion(string $username, string $project) : \Dotpay\Resource\Github\Version
Throws
\Dotpay\Exception\Resource\Github\VersionNotFoundException

Thrown when any latest version of the project is not found

\Dotpay\Exception\BadReturn\TypeNotCompatibleException

Thrown when a response from Github server is in incompatible type

Arguments

$username

string

Username of Github user

$project

string

Name of a project

Response

\Dotpay\Resource\Github\Version

Return the Version object with informations about the newest version of this SDK.

getSdkVersion() : \Dotpay\Resource\Github\Version

Check if the current version is the same or newer than the version on Github.

isSdkNewest() : boolean

Response

boolean

Send a post data to the destination point and return a response.

postData(string $url, \Dotpay\Resource\sring $body) : array
inherited

Arguments

$url

string

Url of a destination request

$body

\Dotpay\Resource\sring

Body content of request which is encoded as JSON string

Response

array

Constants

Basic url of the Github API.

githubUrl

Properties

Configuration of Dotpay payments

config : \Dotpay\Model\Configuration
inherited
var

Configuration of Dotpay payments

Type(s)

\Dotpay\Model\Configuration

Tool for using the cURL library

curl : \Dotpay\Tool\Curl
inherited
var

Tool for using the cURL library

Type(s)

\Dotpay\Tool\Curl

Information about last request

info : array
inherited
var

Information about last request

Type(s)

array