lockfile again
This commit is contained in:
2478
vendor/payeezy/payeezy-php/Doxyfile
vendored
Normal file
2478
vendor/payeezy/payeezy-php/Doxyfile
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
vendor/payeezy/payeezy-php/LICENSE
vendored
Executable file
21
vendor/payeezy/payeezy-php/LICENSE
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 - FIRST DATA CORPORATION (https://developer.payeezy.com/)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
159
vendor/payeezy/payeezy-php/coder_ruleset.xml
vendored
Normal file
159
vendor/payeezy/payeezy-php/coder_ruleset.xml
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="PayeezyAPI">
|
||||
<description>The Payeezy API client library coding standard.</description>
|
||||
|
||||
<!-- PHP code MUST use the long <?php ?> tags or the short-echo <?= ?> tags; it MUST NOT use the other tag variations. -->
|
||||
<rule ref="Generic.PHP.DisallowShortOpenTag.EchoFound">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<!-- PHP code MUST use only UTF-8 without BOM. -->
|
||||
<rule ref="Generic.Files.ByteOrderMark"/>
|
||||
|
||||
<!-- Check for duplicated class names -->
|
||||
<rule ref="Generic.Classes.DuplicateClassName" />
|
||||
|
||||
<!-- Class constants MUST be declared in all upper case with underscore separators. -->
|
||||
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
|
||||
|
||||
<!-- Method names MUST be declared in camelCase(). -->
|
||||
<rule ref="Generic.NamingConventions.CamelCapsFunctionName">
|
||||
<properties>
|
||||
<property name="strict" value="false"/>
|
||||
</properties>
|
||||
<!-- Generated libs have some properties that break this! -->
|
||||
<exclude-pattern>Service/*.php</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
<!-- All PHP files MUST use the Unix LF (linefeed) line ending. -->
|
||||
<rule ref="Generic.Files.LineEndings">
|
||||
<properties>
|
||||
<property name="eolChar" value="\n"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- All PHP files MUST end with a single blank line. -->
|
||||
<rule ref="PSR2.Files.EndFileNewline" />
|
||||
|
||||
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
|
||||
<rule ref="Zend.Files.ClosingTag"/>
|
||||
|
||||
<!-- The soft limit on line length MUST be 100 characters; automated style checkers MUST warn but MUST NOT error at the soft limit. -->
|
||||
<rule ref="Generic.Files.LineLength">
|
||||
<properties>
|
||||
<property name="lineLimit" value="100"/>
|
||||
<property name="absoluteLineLimit" value="120"/>
|
||||
</properties>
|
||||
<!-- Generated libs have some rather long class names that break this! -->
|
||||
<exclude-pattern>Service/*.php</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
|
||||
<properties>
|
||||
<property name="ignoreBlankLines" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<!-- There MUST NOT be more than one statement per line. -->
|
||||
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
|
||||
|
||||
<!-- Code MUST use an indent of 2 spaces, and MUST NOT use tabs for indenting. -->
|
||||
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||
<properties>
|
||||
<property name="indent" value="2" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
|
||||
|
||||
<!-- PHP keywords MUST be in lower case. -->
|
||||
<rule ref="Generic.PHP.LowerCaseKeyword"/>
|
||||
|
||||
<!-- The PHP constants true, false, and null MUST be in lower case. -->
|
||||
<rule ref="Generic.PHP.LowerCaseConstant"/>
|
||||
|
||||
<!-- The extends and implements keywords MUST be declared on the same line as the class name.
|
||||
The opening brace for the class go MUST go on its own line; the closing brace for the class MUST go on the next line after the body.
|
||||
Lists of implements MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one interface per line. -->
|
||||
<rule ref="PSR2.Classes.ClassDeclaration" />
|
||||
|
||||
|
||||
<!-- Visibility MUST be declared on all properties.
|
||||
The var keyword MUST NOT be used to declare a property.
|
||||
There MUST NOT be more than one property declared per statement.
|
||||
Property names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility. -->
|
||||
<rule ref="PSR2.Classes.PropertyDeclaration" />
|
||||
<rule ref="PSR2.Classes.PropertyDeclaration.Underscore" />
|
||||
|
||||
<!-- Visibility MUST be declared on all methods. -->
|
||||
<rule ref="Squiz.Scope.MethodScope"/>
|
||||
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
|
||||
|
||||
|
||||
<!-- Method names MUST NOT be declared with a space after the method name. The opening brace MUST go on its own line, and the closing brace MUST go on the next line following the body. There MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis. -->
|
||||
<rule ref="Squiz.Functions.FunctionDeclaration"/>
|
||||
<rule ref="Squiz.Functions.LowercaseFunctionKeywords"/>
|
||||
|
||||
<!-- In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma. -->
|
||||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
||||
<properties>
|
||||
<property name="equalsSpacing" value="1"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Method arguments with default values MUST go at the end of the argument list. -->
|
||||
<rule ref="PEAR.Functions.ValidDefaultValue"/>
|
||||
|
||||
<!-- Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line. When the argument list is split across multiple lines, the closing parenthesis and opening brace MUST be placed together on their own line with one space between them. -->
|
||||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration"/>
|
||||
|
||||
<!-- When present, the abstract and final declarations MUST precede the visibility declaration.
|
||||
When present, the static declaration MUST come after the visibility declaration. -->
|
||||
<!-- Method names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility. -->
|
||||
<rule ref="PSR2.Methods.MethodDeclaration" />
|
||||
|
||||
<!-- When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis, there MUST NOT be a space after the opening parenthesis, and there MUST NOT be a space before the closing parenthesis. In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma.
|
||||
Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line. -->
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature">
|
||||
<properties>
|
||||
<property name="allowMultipleArguments" value="false"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- The general style rules for control structures are as follows:
|
||||
There MUST be one space after the control structure keyword
|
||||
There MUST NOT be a space after the opening parenthesis
|
||||
There MUST NOT be a space before the closing parenthesis
|
||||
There MUST be one space between the closing parenthesis and the opening brace
|
||||
The structure body MUST be indented once
|
||||
The closing brace MUST be on the next line after the body -->
|
||||
<rule ref="Squiz.ControlStructures.ControlSignature">
|
||||
<properties>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/>
|
||||
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
|
||||
<rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
|
||||
<rule ref="Squiz.ControlStructures.LowercaseDeclaration"/>
|
||||
|
||||
<!-- The body of each structure MUST be enclosed by braces. This standardizes how the structures look, and reduces the likelihood of introducing errors as new lines get added to the body. -->
|
||||
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
|
||||
|
||||
<!-- The case statement MUST be indented once from switch, and the break keyword (or other terminating keyword) MUST be indented at the same level as the case body. There MUST be a comment such as // no break when fall-through is intentional in a non-empty case body. -->
|
||||
<rule ref="PSR2.ControlStructures.SwitchDeclaration" >
|
||||
<properties>
|
||||
<property name="indent" value="2" />
|
||||
</properties>
|
||||
</rule>
|
||||
</ruleset>
|
||||
36
vendor/payeezy/payeezy-php/composer.json
vendored
Executable file
36
vendor/payeezy/payeezy-php/composer.json
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "payeezy/payeezy-php",
|
||||
"type": "library",
|
||||
"description": "Payeezy PHP Library",
|
||||
"keywords": [
|
||||
"payeezy",
|
||||
"payment processing",
|
||||
"api"
|
||||
],
|
||||
"homepage": "https://developer.payeezy.com/",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "payeezy and contributors",
|
||||
"homepage": "https://github.com/payeezy/payeezy-php/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.2",
|
||||
"ext-curl": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"squizlabs/php_codesniffer": "~2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Payeezy_": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
99
vendor/payeezy/payeezy-php/src/Payeezy/Client.php
vendored
Normal file
99
vendor/payeezy/payeezy-php/src/Payeezy/Client.php
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_Client
|
||||
{
|
||||
/**
|
||||
* @var string The Payeezy API key to be used for requests.
|
||||
*/
|
||||
public static $apiKey;
|
||||
|
||||
/**
|
||||
* @var string The Payeezy API Secret to be used for requests.
|
||||
*/
|
||||
public static $apiSecret;
|
||||
|
||||
/**
|
||||
* @var string The Payeezy Merchant Token to be used for requests.
|
||||
*/
|
||||
public static $merchantToken;
|
||||
|
||||
/**
|
||||
* @var string The Payeezy URL to be used for requests.
|
||||
*/
|
||||
public static $url;
|
||||
|
||||
const VERSION = '1.0.0';
|
||||
|
||||
/**
|
||||
* @return string The API key used for requests.
|
||||
*/
|
||||
public static function getApiKey()
|
||||
{
|
||||
return self::$apiKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the API key to be used for requests.
|
||||
*
|
||||
* @param string $apiKey
|
||||
*/
|
||||
public static function setApiKey($apiKey)
|
||||
{
|
||||
self::$apiKey = $apiKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The API key used for requests.
|
||||
*/
|
||||
public static function getApiSecret()
|
||||
{
|
||||
return self::$apiSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the API key to be used for requests.
|
||||
*
|
||||
* @param string $apiKey
|
||||
*/
|
||||
public static function setApiSecret($apiSecret)
|
||||
{
|
||||
self::$apiSecret = $apiSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string The API key used for requests.
|
||||
*/
|
||||
public static function getMerchantToken()
|
||||
{
|
||||
return self::$merchantToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the API key to be used for requests.
|
||||
*
|
||||
* @param string $apiKey
|
||||
*/
|
||||
public static function setMerchantToken($merchantToken)
|
||||
{
|
||||
self::$merchantToken = $merchantToken;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string The API key used for requests.
|
||||
*/
|
||||
public static function getUrl()
|
||||
{
|
||||
return self::$url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the API key to be used for requests.
|
||||
*
|
||||
* @param string $apiKey
|
||||
*/
|
||||
public static function setUrl($url)
|
||||
{
|
||||
self::$url = $url;
|
||||
}
|
||||
}
|
||||
10
vendor/payeezy/payeezy-php/src/Payeezy/CreditCard.php
vendored
Normal file
10
vendor/payeezy/payeezy-php/src/Payeezy/CreditCard.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_CreditCard extends Payeezy_TransactionType
|
||||
{
|
||||
|
||||
public function __construct($client)
|
||||
{
|
||||
parent::__construct('credit_card', $client);
|
||||
}
|
||||
}
|
||||
32
vendor/payeezy/payeezy-php/src/Payeezy/Error.php
vendored
Normal file
32
vendor/payeezy/payeezy-php/src/Payeezy/Error.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_Error extends Exception
|
||||
{
|
||||
public function __construct($correlation_id, $errorResponse)
|
||||
{
|
||||
|
||||
$this->httpStatus = $correlation_id;
|
||||
$httpBodyArray = array();
|
||||
foreach ($errorResponse->messages as $message) {
|
||||
$httpBodyArray[] = $message->description;
|
||||
}
|
||||
$this->httpBody = implode(", ", $httpBodyArray);
|
||||
$this->jsonBody = json_encode($errorResponse, JSON_FORCE_OBJECT);
|
||||
parent::__construct($message = $this->httpBody);
|
||||
}
|
||||
|
||||
public function getHttpStatus()
|
||||
{
|
||||
return $this->httpStatus;
|
||||
}
|
||||
|
||||
public function getHttpBody()
|
||||
{
|
||||
return $this->httpBody;
|
||||
}
|
||||
|
||||
public function getJsonBody()
|
||||
{
|
||||
return $this->jsonBody;
|
||||
}
|
||||
}
|
||||
10
vendor/payeezy/payeezy-php/src/Payeezy/Paypal.php
vendored
Normal file
10
vendor/payeezy/payeezy-php/src/Payeezy/Paypal.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_Paypal extends Payeezy_TransactionType
|
||||
{
|
||||
|
||||
public function __construct($client)
|
||||
{
|
||||
parent::__construct('paypal', $client);
|
||||
}
|
||||
}
|
||||
10
vendor/payeezy/payeezy-php/src/Payeezy/TeleCheck.php
vendored
Normal file
10
vendor/payeezy/payeezy-php/src/Payeezy/TeleCheck.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_TeleCheck extends Payeezy_TransactionType
|
||||
{
|
||||
|
||||
public function __construct($client)
|
||||
{
|
||||
parent::__construct('tele_check', $client);
|
||||
}
|
||||
}
|
||||
10
vendor/payeezy/payeezy-php/src/Payeezy/Token.php
vendored
Normal file
10
vendor/payeezy/payeezy-php/src/Payeezy/Token.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_Token extends Payeezy_TransactionType
|
||||
{
|
||||
|
||||
public function __construct($client)
|
||||
{
|
||||
parent::__construct('token', $client);
|
||||
}
|
||||
}
|
||||
161
vendor/payeezy/payeezy-php/src/Payeezy/Transaction.php
vendored
Executable file
161
vendor/payeezy/payeezy-php/src/Payeezy/Transaction.php
vendored
Executable file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_Transaction
|
||||
{
|
||||
private $url;
|
||||
|
||||
private $baseURL;
|
||||
|
||||
private $apiKey;
|
||||
|
||||
private $apiSecret;
|
||||
|
||||
private $merchantToken;
|
||||
|
||||
public function __construct($client)
|
||||
{
|
||||
$this->baseURL = $client->getUrl();
|
||||
$this->apiKey = $client->getApiKey();
|
||||
$this->apiSecret = $client->getApiSecret();
|
||||
$this->merchantToken = $client->getMerchantToken();
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* HMAC Authentication
|
||||
*/
|
||||
|
||||
public function hmacAuthorizationToken($payload)
|
||||
{
|
||||
|
||||
$nonce = strval(hexdec(bin2hex(openssl_random_pseudo_bytes(4, $cstrong))));
|
||||
|
||||
$timestamp = strval(time()*1000); //time stamp in milli seconds
|
||||
|
||||
$data = $this->apiKey . $nonce . $timestamp . $this->merchantToken . $payload;
|
||||
|
||||
$hashAlgorithm = "sha256";
|
||||
|
||||
$hmac = hash_hmac($hashAlgorithm, $data, $this->apiSecret, false); // HMAC Hash in hex
|
||||
|
||||
$authorization = base64_encode($hmac);
|
||||
|
||||
return array(
|
||||
'authorization' => $authorization,
|
||||
'nonce' => $nonce,
|
||||
'timestamp' => $timestamp,
|
||||
'apikey' => $this->apiKey,
|
||||
'token' => $this->merchantToken,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* jsonpp - Pretty print JSON data
|
||||
*
|
||||
* In versions of PHP < 5.4.x, the json_encode() function does not yet provide a
|
||||
* pretty-print option. In lieu of forgoing the feature, an additional call can
|
||||
* be made to this function, passing in JSON text, and (optionally) a string to
|
||||
* be used for indentation.
|
||||
*
|
||||
* @param string $json The JSON data, pre-encoded
|
||||
* @param string $istr The indentation string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function jsonpp($json, $istr = ' ')
|
||||
{
|
||||
$result = '';
|
||||
for ($p=$q=$i=0; isset($json[$p]); $p++) {
|
||||
$json[$p] == '"' && ($p>0?$json[$p-1]:'') != '\\' && $q=!$q;
|
||||
if (strchr('}]', $json[$p]) && !$q && $i--) {
|
||||
strchr('{[', $json[$p-1]) || $result .= "\n".str_repeat($istr, $i);
|
||||
}
|
||||
$result .= $json[$p];
|
||||
if (strchr(',{[', $json[$p]) && !$q) {
|
||||
$i += strchr('{[', $json[$p])===false?0:1;
|
||||
strchr('}]', $json[$p+1]) || $result .= "\n".str_repeat($istr, $i);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* Post Transaction
|
||||
*/
|
||||
|
||||
public function postTransaction($payload, $headers)
|
||||
{
|
||||
|
||||
$request = curl_init();
|
||||
curl_setopt($request, CURLOPT_URL, $this->url);
|
||||
curl_setopt($request, CURLOPT_POST, true);
|
||||
curl_setopt($request, CURLOPT_POSTFIELDS, $payload);
|
||||
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($request, CURLOPT_HEADER, false);
|
||||
//curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt(
|
||||
$request,
|
||||
CURLOPT_HTTPHEADER,
|
||||
array(
|
||||
'Content-Type: application/json',
|
||||
'apikey:'.strval($this->apiKey),
|
||||
'token:'.strval($this->merchantToken),
|
||||
'Authorization:'.$headers['authorization'],
|
||||
'nonce:'.$headers['nonce'],
|
||||
'timestamp:'.$headers['timestamp'],
|
||||
)
|
||||
);
|
||||
|
||||
$response = curl_exec($request);
|
||||
|
||||
if (false === $response) {
|
||||
echo curl_error($request);
|
||||
}
|
||||
|
||||
//$httpcode = curl_getinfo($request, CURLINFO_HTTP_CODE);
|
||||
curl_close($request);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this for primary transactions like Authorize, Purchase
|
||||
* @param transactionRequest
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
public function doPrimaryTransaction($args = array())
|
||||
{
|
||||
$this->url = $this->baseURL;
|
||||
$payload = json_encode($args, JSON_FORCE_OBJECT);
|
||||
$headerArray = $this->hmacAuthorizationToken($payload);
|
||||
|
||||
$response_in_JSON = $this->postTransaction($payload, $headerArray);
|
||||
$response = json_decode($response_in_JSON);
|
||||
if (isset($response->Error)) {
|
||||
throw new Payeezy_Error($response->correlation_id, $response->Error);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this for Secondary transactions like void, refund, capture etc
|
||||
*/
|
||||
|
||||
public function doSecondaryTransaction($transaction_id, $args = array())
|
||||
{
|
||||
$this->url = $this->baseURL . '/' . $transaction_id;
|
||||
$payload = json_encode($args, JSON_FORCE_OBJECT);
|
||||
$headerArray = $this->hmacAuthorizationToken($payload);
|
||||
$response_in_JSON = $this->postTransaction($payload, $headerArray);
|
||||
$response = json_decode($response_in_JSON);
|
||||
if (isset($response->Error)) {
|
||||
throw new Payeezy_Error($response->correlation_id, $response->Error);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}//end of class
|
||||
143
vendor/payeezy/payeezy-php/src/Payeezy/TransactionType.php
vendored
Normal file
143
vendor/payeezy/payeezy-php/src/Payeezy/TransactionType.php
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_TransactionType extends Payeezy_Transaction
|
||||
{
|
||||
|
||||
private $method;
|
||||
|
||||
public function __construct($method, $client)
|
||||
{
|
||||
$this->method = $method;
|
||||
parent::__construct($client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* Authorize Transaction
|
||||
*/
|
||||
|
||||
public function authorize($args = array())
|
||||
{
|
||||
$args['transaction_type'] = 'authorize';
|
||||
$args['method'] = $this->method;
|
||||
return parent::doPrimaryTransaction($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* Purchase Transaction
|
||||
*/
|
||||
|
||||
public function purchase($args = array())
|
||||
{
|
||||
$args['transaction_type'] = 'purchase';
|
||||
$args['method'] = $this->method;
|
||||
return parent::doPrimaryTransaction($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* Capture Transaction
|
||||
*/
|
||||
|
||||
public function capture($transaction_id, $args = array())
|
||||
{
|
||||
$args['transaction_type'] = 'capture';
|
||||
$args['method'] = $this->method;
|
||||
return parent::doSecondaryTransaction($transaction_id, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* Void Transaction
|
||||
*/
|
||||
|
||||
public function void($transaction_id, $args = array())
|
||||
{
|
||||
$args['transaction_type'] = "void";
|
||||
$args['method'] = $this->method;
|
||||
return parent::doSecondaryTransaction($transaction_id, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* Refund Transaction
|
||||
*/
|
||||
|
||||
public function refund($transaction_id, $args = array())
|
||||
{
|
||||
$args['transaction_type'] = "refund";
|
||||
$args['method'] = $this->method;
|
||||
return parent::doSecondaryTransaction($transaction_id, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* cashout Transaction
|
||||
*/
|
||||
|
||||
public function cashout($args = array())
|
||||
{
|
||||
$args['transaction_type'] = "cashout";
|
||||
$args['method'] = $this->method;
|
||||
return parent::doPrimaryTransaction($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* reload Transaction
|
||||
*/
|
||||
|
||||
public function reload($args = array())
|
||||
{
|
||||
$args['transaction_type'] = "reload";
|
||||
$args['method'] = $this->method;
|
||||
return parent::doPrimaryTransaction($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* balance_inquiry Transaction
|
||||
*/
|
||||
|
||||
public function balanceInquiry($args = array())
|
||||
{
|
||||
$args['transaction_type'] = "balance_inquiry";
|
||||
$args['method'] = $this->method;
|
||||
return parent::doPrimaryTransaction($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* deactivation Transaction
|
||||
*/
|
||||
|
||||
public function deactivation($args = array())
|
||||
{
|
||||
$args['transaction_type'] = "deactivation";
|
||||
$args['method'] = $this->method;
|
||||
return parent::doPrimaryTransaction($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Payeezy
|
||||
*
|
||||
* activation Transaction
|
||||
*/
|
||||
|
||||
public function activation($args = array())
|
||||
{
|
||||
$args['transaction_type'] = "activation";
|
||||
$args['method'] = $this->method;
|
||||
return parent::doPrimaryTransaction($args);
|
||||
}
|
||||
}
|
||||
13
vendor/payeezy/payeezy-php/src/Payeezy/Util.php
vendored
Normal file
13
vendor/payeezy/payeezy-php/src/Payeezy/Util.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_Util
|
||||
{
|
||||
|
||||
public function processInput($data)
|
||||
{
|
||||
$data = trim($data);
|
||||
$data = stripslashes($data);
|
||||
$data = htmlspecialchars($data);
|
||||
return strval($data);
|
||||
}
|
||||
}
|
||||
10
vendor/payeezy/payeezy-php/src/Payeezy/ValueLink.php
vendored
Normal file
10
vendor/payeezy/payeezy-php/src/Payeezy/ValueLink.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_ValueLink extends Payeezy_TransactionType
|
||||
{
|
||||
|
||||
public function __construct($client)
|
||||
{
|
||||
parent::__construct('valuelink', $client);
|
||||
}
|
||||
}
|
||||
10
vendor/payeezy/payeezy-php/src/Payeezy/threeDS.php
vendored
Normal file
10
vendor/payeezy/payeezy-php/src/Payeezy/threeDS.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class Payeezy_threeDS extends Payeezy_TransactionType
|
||||
{
|
||||
|
||||
public function __construct($client)
|
||||
{
|
||||
parent::__construct('3ds', $client);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user