Resource

Offer base functionality to use external Internet resources.

package

Default

Methods

Initialize the resource.

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

Arguments

$config

\Dotpay\Model\Configuration

Configuration of Dotpay payments

$curl

\Dotpay\Tool\Curl

Tool for using the cURL library

Close the resource.

close() 

Return a string which contain a header with Accept rule.

getAcceptHeader() : string

Response

string

Return a parsed response from the external server.

getContent(string $url) : array
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

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

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

Arguments

$url

string

Url of a destination request

$body

\Dotpay\Resource\sring

Body content of request which is encoded as JSON string

Response

array

Properties

Configuration of Dotpay payments

config : \Dotpay\Model\Configuration
var

Configuration of Dotpay payments

Type(s)

\Dotpay\Model\Configuration

Tool for using the cURL library

curl : \Dotpay\Tool\Curl
var

Tool for using the cURL library

Type(s)

\Dotpay\Tool\Curl

Information about last request

info : array
var

Information about last request

Type(s)

array