PHP Class Paranoia\Payment\Adapter\AdapterAbstract

Mostra file Open project: paranoiaproject/paranoia

Protected Properties

Property Type Description
$configuration Paranoia\Configuration\AbstractConfiguration
$currencyCodes array
$dispatcher Symfony\Component\EventDispatcher\EventDispatcher
$transactionMap array

Public Methods

Method Description
__construct ( AbstractConfiguration $configuration )
cancel ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
pointQuery ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
pointUsage ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
postAuthorization ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
preAuthorization ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
refund ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
sale ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
setConfiguration ( AbstractConfiguration $configuration )

Protected Methods

Method Description
buildCancelRequest ( Request $request ) : mixed build request data for cancel transaction.
buildPostAuthorizationRequest ( Request $request ) : mixed build request data for postauthorization transaction.
buildPreAuthorizationRequest ( Request $request ) : mixed build request data for preauthorization transaction.
buildRefundRequest ( Request $request ) : mixed build request data for refund transaction.
buildRequest ( Request $request, string $requestBuilder ) : mixed build complete raw data for the specified request.
buildSaleRequest ( Request $request ) : mixed build request data for sale transaction.
formatAmount ( string | float $amount, boolean $reverse = false ) : string returns formatted amount with doth or without doth.
formatCurrency ( string $currency ) : integer formats the specified string currency code by iso currency codes.
formatExpireDate ( integer $month, integer $year ) : string formats expire date as month/year
formatInstallment ( integer $installment ) : string returns formatted installment amount
formatOrderId ( $orderId ) : mixed returns formatted order number.
getDispatcher ( ) : EventDispatcher
getProviderTransactionType ( string $transactionType ) : string returns transaction code by expected provider.
maskRequest ( string $rawRequest ) : string mask some critical information in transaction request.
parseResponse ( string $rawResponse, string $transactionType ) : Paranoia\Payment\Response\PaymentResponse parses response from returned provider.
sendRequest ( string $url, mixed $data, array $options = null ) : mixed Makes http request to remote host.

Method Details

__construct() public method

public __construct ( AbstractConfiguration $configuration )
$configuration Paranoia\Configuration\AbstractConfiguration

buildCancelRequest() abstract protected method

build request data for cancel transaction.
abstract protected buildCancelRequest ( Request $request ) : mixed
$request Paranoia\Payment\Request
return mixed

buildPostAuthorizationRequest() abstract protected method

build request data for postauthorization transaction.
abstract protected buildPostAuthorizationRequest ( Request $request ) : mixed
$request Paranoia\Payment\Request
return mixed

buildPreAuthorizationRequest() abstract protected method

build request data for preauthorization transaction.
abstract protected buildPreAuthorizationRequest ( Request $request ) : mixed
$request Paranoia\Payment\Request
return mixed

buildRefundRequest() abstract protected method

build request data for refund transaction.
abstract protected buildRefundRequest ( Request $request ) : mixed
$request Paranoia\Payment\Request
return mixed

buildRequest() abstract protected method

build complete raw data for the specified request.
abstract protected buildRequest ( Request $request, string $requestBuilder ) : mixed
$request Paranoia\Payment\Request
$requestBuilder string
return mixed

buildSaleRequest() abstract protected method

build request data for sale transaction.
abstract protected buildSaleRequest ( Request $request ) : mixed
$request Paranoia\Payment\Request
return mixed

cancel() public method

public cancel ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
$request Paranoia\Payment\Request
return Paranoia\Payment\Response\PaymentResponse

formatAmount() protected method

formatted number returns amount default without doth.
protected formatAmount ( string | float $amount, boolean $reverse = false ) : string
$amount string | float
$reverse boolean
return string

formatCurrency() protected method

formats the specified string currency code by iso currency codes.
protected formatCurrency ( string $currency ) : integer
$currency string
return integer

formatExpireDate() protected method

formats expire date as month/year
protected formatExpireDate ( integer $month, integer $year ) : string
$month integer
$year integer
return string

formatInstallment() protected method

returns formatted installment amount
protected formatInstallment ( integer $installment ) : string
$installment integer
return string

formatOrderId() protected method

returns formatted order number.
protected formatOrderId ( $orderId ) : mixed
$orderId
return mixed

getDispatcher() protected method

protected getDispatcher ( ) : EventDispatcher
return Symfony\Component\EventDispatcher\EventDispatcher

getProviderTransactionType() protected method

returns transaction code by expected provider.
protected getProviderTransactionType ( string $transactionType ) : string
$transactionType string
return string

maskRequest() protected method

mask some critical information in transaction request.
protected maskRequest ( string $rawRequest ) : string
$rawRequest string
return string

parseResponse() abstract protected method

parses response from returned provider.
abstract protected parseResponse ( string $rawResponse, string $transactionType ) : Paranoia\Payment\Response\PaymentResponse
$rawResponse string
$transactionType string
return Paranoia\Payment\Response\PaymentResponse

pointQuery() public method

public pointQuery ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
$request Paranoia\Payment\Request
return Paranoia\Payment\Response\PaymentResponse

pointUsage() public method

public pointUsage ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
$request Paranoia\Payment\Request
return Paranoia\Payment\Response\PaymentResponse

postAuthorization() public method

public postAuthorization ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
$request Paranoia\Payment\Request
return Paranoia\Payment\Response\PaymentResponse

preAuthorization() public method

public preAuthorization ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
$request Paranoia\Payment\Request
return Paranoia\Payment\Response\PaymentResponse

refund() public method

public refund ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
$request Paranoia\Payment\Request
return Paranoia\Payment\Response\PaymentResponse

sale() public method

public sale ( Request $request ) : Paranoia\Payment\Response\PaymentResponse
$request Paranoia\Payment\Request
return Paranoia\Payment\Response\PaymentResponse

sendRequest() protected method

Makes http request to remote host.
protected sendRequest ( string $url, mixed $data, array $options = null ) : mixed
$url string
$data mixed
$options array
return mixed

setConfiguration() public method

public setConfiguration ( AbstractConfiguration $configuration )
$configuration Paranoia\Configuration\AbstractConfiguration

Property Details

$configuration protected_oe property

protected AbstractConfiguration,Paranoia\Configuration $configuration
return Paranoia\Configuration\AbstractConfiguration

$currencyCodes protected_oe property

protected array $currencyCodes
return array

$dispatcher protected_oe property

protected EventDispatcher,Symfony\Component\EventDispatcher $dispatcher
return Symfony\Component\EventDispatcher\EventDispatcher

$transactionMap protected_oe property

protected array $transactionMap
return array