Skip to content

Commit

Permalink
20201105 deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
MSmedal authored and MSmedal committed Nov 5, 2020
1 parent 56e09b4 commit 266d3eb
Show file tree
Hide file tree
Showing 60 changed files with 2,343 additions and 1,677 deletions.
14 changes: 7 additions & 7 deletions src/Builders/AuthorizationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,25 +476,25 @@ public function __construct($type, IPaymentMethod $paymentMethod = null)
*
* @return Transaction
*/
public function execute()
public function execute(string $configName = 'default')
{
parent::execute();
return ServicesContainer::instance()
->getClient()
->processAuthorization($this);
parent::execute($configName);

$client = ServicesContainer::instance()->getClient($configName);
return $client->processAuthorization($this);
}

/**
* {@inheritdoc}
*
* @return String
*/
public function serialize()
public function serialize(string $configName = 'default')
{
$this->transactionModifier = TransactionModifier::HOSTEDREQUEST;
parent::execute();

$client = ServicesContainer::instance()->getClient();
$client = ServicesContainer::instance()->getClient($configName);

if ($client->supportsHostedPayments()) {
return $client->serializeRequest($this);
Expand Down
6 changes: 3 additions & 3 deletions src/Builders/ManagementBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ public function __isset($name)
*
* @return Transaction
*/
public function execute()
public function execute(string $configName = 'default')
{
parent::execute();
parent::execute($configName);
return ServicesContainer::instance()
->getClient()
->getClient($configName)
->manageTransaction($this);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Builders/RecurringBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public function addSearchCriteria($key, $value)
*
* @return mixed
*/
public function execute()
public function execute(string $configName = 'default')
{
parent::execute();
parent::execute($configName);

$client = ServicesContainer::instance()->getRecurringClient();
$client = ServicesContainer::instance()->getRecurringClient($configName);
return $client->processRecurring($this);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Builders/ReportBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public function __construct($reportType)
*
* @return mixed
*/
public function execute()
public function execute(string $configName = 'default')
{
parent::execute();
parent::execute($configName);

$client = ServicesContainer::instance()->getClient();
$client = ServicesContainer::instance()->getClient($configName);
return $client->processReport($this);
}
}
16 changes: 11 additions & 5 deletions src/Builders/Secure3dBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public function getTransactionType()
public function getVersion()
{
if (!empty($this->threeDSecure)) {
return $this->threeDSecure->version;
return $this->threeDSecure->getVersion();
}
return null;
}
Expand Down Expand Up @@ -646,8 +646,11 @@ public function withAccountChangeIndicator($accountChangeIndicator)
return $this;
}

/** @return Secure3dBuilder */
public function withAddressMatchIndicator(bool $value)
/**
* @param bool $value
* @return Secure3dBuilder
*/
public function withAddressMatchIndicator($value)
{
$this->addressMatchIndicator = $value;
return $this;
Expand Down Expand Up @@ -968,8 +971,11 @@ public function withPreOrderIndicator($preOrderIndicator)
return $this;
}

/** @return Secure3dBuilder */
public function withPreviousSuspiciousActivity(bool $previousSuspiciousActivity)
/**
* @param bool $previousSuspiciousActivity
* @return Secure3dBuilder
*/
public function withPreviousSuspiciousActivity($previousSuspiciousActivity)
{
$this->previousSuspiciousActivity = $previousSuspiciousActivity;
return $this;
Expand Down
62 changes: 62 additions & 0 deletions src/ConfiguredServices.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

namespace GlobalPayments\Api;

use GlobalPayments\Api\Gateways\IPaymentGateway;
use GlobalPayments\Api\Gateways\IRecurringService;
use GlobalPayments\Api\Gateways\ISecure3dProvider;
use GlobalPayments\Api\Entities\Enums\Secure3dVersion;

class ConfiguredServices
{
private $secure3dProviders;

/** @var IPaymentGateway */
public $gatewayConnector;

/** @var IRecurringService */
public $recurringConnector;

/** @var IReportingService */
public $reportingService;

/** @var IDeviceInterface */
public $deviceInterface;

/** @var DeviceController */
public $deviceController;

/** @var OnlineBoardingConnector */
public $boardingConnector;

/** @var TableServiceConnector */
public $tableServiceConnector;

/** @var PayrollConnector */
public $payrollConnector;

public function __construct()
{
$this->secure3dProviders = array();
}

protected function getSecure3dProvider(Secure3dVersion $version)
{
if (in_array($version, $this->secure3dProviders)) {
return $this->secure3dProviders[$version];
} elseif ($version == Secure3dVersion::ANY) {
$provider = $this->secure3dProviders[Secure3dVersion::TWO];
if ($provider == null) {
$provider = $this->secure3dProviders[Secure3dVersion::ONE];
}
return $provider;
} else {
return null;
}
}

protected function setSecure3dProvider(Secure3dVersion $version, ISecure3dProvider $provider)
{
$this->secure3dProviders[$version] = $provider;
}
}
4 changes: 2 additions & 2 deletions src/Entities/Enums/ReportType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
class ReportType extends Enum
{
const FIND_TRANSACTIONS = 1;
const ACTIVITY = 1 << 1;
const TRANSACTION_DETAIL = 1 << 7;
const ACTIVITY = 2; // 1 << 1;
const TRANSACTION_DETAIL = 128; // 1 << 7;
}
68 changes: 34 additions & 34 deletions src/Entities/Enums/TransactionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@

class TransactionType extends Enum
{
const DECLINE = 1 << 0;
const VERIFY = 1 << 1;
const CAPTURE = 1 << 2;
const AUTH = 1 << 3;
const REFUND = 1 << 4;
const REVERSAL = 1 << 5;
const SALE = 1 << 6;
const EDIT = 1 << 7;
const VOID = 1 << 8;
const ADD_VALUE = 1 << 9;
const BALANCE = 1 << 10;
const ACTIVATE = 1 << 11;
const ALIAS = 1 << 12;
const REPLACE = 1 << 13;
const REWARD = 1 << 14;
const DEACTIVATE = 1 << 15;
const BATCH_CLOSE = 1 << 16;
const CREATE = 1 << 17;
const DELETE = 1 << 18;
const FETCH = 1 << 19;
const SEARCH = 1 << 20;
const HOLD = 1 << 21;
const RELEASE = 1 << 22;
const DCC_RATE_LOOKUP = 1 << 23;
const VERIFY_ENROLLED = 1 << 24;
const VERIFY_SIGNATURE = 1 << 25;
const TOKEN_DELETE = 1 << 26;
const VERIFY_AUTHENTICATION = 1 << 27;
const INITIATE_AUTHENTICATION = 1 << 28;
const DATA_COLLECT = 1 << 29;
const PRE_AUTH_COMPLETION = 1 << 30;
const TOKEN_UPDATE = 1 << 31;
const BENEFIT_WITHDRAWAL = 1 <<32;
const TOKENIZE = 1 << 33;
const DECLINE = 1; // 1 << 0
const VERIFY = 2; // 1 << 1
const CAPTURE = 4; // 1 << 2
const AUTH = 8; // 1 << 3
const REFUND = 16; // 1 << 4
const REVERSAL = 32; // 1 << 5
const SALE = 64; // 1 << 6
const EDIT = 128; // 1 << 7
const VOID = 256; // 1 << 8
const ADD_VALUE = 512; // 1 << 9
const BALANCE = 1024; // 1 << 10
const ACTIVATE = 2048; // 1 << 11
const ALIAS = 4096; // 1 << 12
const REPLACE = 8192; // 1 << 13
const REWARD = 16384; // 1 << 14
const DEACTIVATE = 32768; // 1 << 15
const BATCH_CLOSE = 65536; // 1 << 16
const CREATE = 131072; // 1 << 17
const DELETE = 262144; // 1 << 18
const FETCH = 524288; // 1 << 19
const SEARCH = 1048576; // 1 << 20
const HOLD = 2097152; // 1 << 21
const RELEASE = 4194304; // 1 << 22
const DCC_RATE_LOOKUP = 8388608; //1 << 23
const VERIFY_ENROLLED = 16777216; //1 << 24
const VERIFY_SIGNATURE = 33554432; // 1 << 25
const TOKEN_DELETE = 67108864; // 1 << 26
const VERIFY_AUTHENTICATION = 134217728; // 1 << 27
const INITIATE_AUTHENTICATION = 268435456; // 1 << 28
const DATA_COLLECT = 536870912; // 1 << 29
const PRE_AUTH_COMPLETION = 1073741824; // 1 << 30
const TOKEN_UPDATE = 2147483648; // 1 << 31
const BENEFIT_WITHDRAWAL = 4294967296; // 1 <<32
const TOKENIZE = 8589934592; // 1 << 33;
}
10 changes: 5 additions & 5 deletions src/Entities/RecurringEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public function delete($force = false)
/**
* {@inheritDoc}
*/
public static function find($id)
public static function find($id, $configName = 'default')
{
$client = ServicesContainer::instance()->getRecurringClient();
$client = ServicesContainer::instance()->getRecurringClient($configName);
if (!$client->supportsRetrieval) {
throw new UnsupportedTransactionException();
}
Expand All @@ -74,9 +74,9 @@ public static function find($id)
/**
* {@inheritDoc}
*/
public static function findAll()
public static function findAll($configName = 'default')
{
$client = ServicesContainer::instance()->getRecurringClient();
$client = ServicesContainer::instance()->getRecurringClient($configName);
if (!$client->supportsRetrieval) {
throw new UnsupportedTransactionException();
}
Expand All @@ -87,7 +87,7 @@ public static function findAll()
/**
* {@inheritDoc}
*/
public function saveChanges()
public function saveChanges($configName = 'default')
{
try {
return RecurringService::edit($this);
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Reporting/SearchCriteriaBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function __construct(TransactionReportBuilder $reportBuilder = null)
$this->reportBuilder = $reportBuilder;
}

public function and($criteria, $value)
public function andWith($criteria, $value)
{
if (property_exists($this, $criteria)) {
$this->{$criteria} = $value;
Expand Down
6 changes: 3 additions & 3 deletions src/Entities/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Schedule extends RecurringEntity
*
* @var integer|null
*/
public $numberOfPayments;
public $numberOfPaymentsRemaining;

/**
* The purchase order (PO) number associated with the schedule.
Expand Down Expand Up @@ -337,9 +337,9 @@ public function withName($value)
*
* @return Schedule
*/
public function withNumberOfPayments($value)
public function withnumberOfPaymentsRemaining($value)
{
$this->numberOfPayments = $value;
$this->numberOfPaymentsRemaining = $value;
return $this;
}

Expand Down
8 changes: 8 additions & 0 deletions src/Gateways/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,15 @@ protected function sendRequest(
curl_setopt($request, CURLOPT_HTTPHEADER, $headers);
curl_setopt($request, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
curl_setopt($request, CURLOPT_VERBOSE, false);

// Define the constant manually for earlier versions of PHP.
// Disable phpcs here since this constant does not exist until PHP 5.5.19.
// phpcs:disable
if (!defined('CURL_SSLVERSION_TLSv1_2')) {
define('CURL_SSLVERSION_TLSv1_2', 6);
}
curl_setopt($request, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
// phpcs:enable

if ($this->curlOptions != null && !empty($this->curlOptions)) {
curl_setopt_array($request, $this->curlOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
use GlobalPayments\Api\PaymentMethods\CreditTrackData;
use GlobalPayments\Api\Services\ReportingService;

class MerchantwareConnector extends XmlGateway implements IPaymentGateway
class GeniusConnector extends XmlGateway implements IPaymentGateway
{
/**
* Portico's XML namespace
Expand Down
Loading

0 comments on commit 266d3eb

Please sign in to comment.