Skip to content

Commit 266d3eb

Browse files
MSmedalMSmedal
authored andcommitted
20201105 deployment
1 parent 56e09b4 commit 266d3eb

File tree

60 files changed

+2343
-1677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2343
-1677
lines changed

src/Builders/AuthorizationBuilder.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -476,25 +476,25 @@ public function __construct($type, IPaymentMethod $paymentMethod = null)
476476
*
477477
* @return Transaction
478478
*/
479-
public function execute()
479+
public function execute(string $configName = 'default')
480480
{
481-
parent::execute();
482-
return ServicesContainer::instance()
483-
->getClient()
484-
->processAuthorization($this);
481+
parent::execute($configName);
482+
483+
$client = ServicesContainer::instance()->getClient($configName);
484+
return $client->processAuthorization($this);
485485
}
486486

487487
/**
488488
* {@inheritdoc}
489489
*
490490
* @return String
491491
*/
492-
public function serialize()
492+
public function serialize(string $configName = 'default')
493493
{
494494
$this->transactionModifier = TransactionModifier::HOSTEDREQUEST;
495495
parent::execute();
496496

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

499499
if ($client->supportsHostedPayments()) {
500500
return $client->serializeRequest($this);

src/Builders/ManagementBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ public function __isset($name)
184184
*
185185
* @return Transaction
186186
*/
187-
public function execute()
187+
public function execute(string $configName = 'default')
188188
{
189-
parent::execute();
189+
parent::execute($configName);
190190
return ServicesContainer::instance()
191-
->getClient()
191+
->getClient($configName)
192192
->manageTransaction($this);
193193
}
194194

src/Builders/RecurringBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ public function addSearchCriteria($key, $value)
6767
*
6868
* @return mixed
6969
*/
70-
public function execute()
70+
public function execute(string $configName = 'default')
7171
{
72-
parent::execute();
72+
parent::execute($configName);
7373

74-
$client = ServicesContainer::instance()->getRecurringClient();
74+
$client = ServicesContainer::instance()->getRecurringClient($configName);
7575
return $client->processRecurring($this);
7676
}
7777

src/Builders/ReportBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public function __construct($reportType)
3434
*
3535
* @return mixed
3636
*/
37-
public function execute()
37+
public function execute(string $configName = 'default')
3838
{
39-
parent::execute();
39+
parent::execute($configName);
4040

41-
$client = ServicesContainer::instance()->getClient();
41+
$client = ServicesContainer::instance()->getClient($configName);
4242
return $client->processReport($this);
4343
}
4444
}

src/Builders/Secure3dBuilder.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ public function getTransactionType()
548548
public function getVersion()
549549
{
550550
if (!empty($this->threeDSecure)) {
551-
return $this->threeDSecure->version;
551+
return $this->threeDSecure->getVersion();
552552
}
553553
return null;
554554
}
@@ -646,8 +646,11 @@ public function withAccountChangeIndicator($accountChangeIndicator)
646646
return $this;
647647
}
648648

649-
/** @return Secure3dBuilder */
650-
public function withAddressMatchIndicator(bool $value)
649+
/**
650+
* @param bool $value
651+
* @return Secure3dBuilder
652+
*/
653+
public function withAddressMatchIndicator($value)
651654
{
652655
$this->addressMatchIndicator = $value;
653656
return $this;
@@ -968,8 +971,11 @@ public function withPreOrderIndicator($preOrderIndicator)
968971
return $this;
969972
}
970973

971-
/** @return Secure3dBuilder */
972-
public function withPreviousSuspiciousActivity(bool $previousSuspiciousActivity)
974+
/**
975+
* @param bool $previousSuspiciousActivity
976+
* @return Secure3dBuilder
977+
*/
978+
public function withPreviousSuspiciousActivity($previousSuspiciousActivity)
973979
{
974980
$this->previousSuspiciousActivity = $previousSuspiciousActivity;
975981
return $this;

src/ConfiguredServices.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
namespace GlobalPayments\Api;
4+
5+
use GlobalPayments\Api\Gateways\IPaymentGateway;
6+
use GlobalPayments\Api\Gateways\IRecurringService;
7+
use GlobalPayments\Api\Gateways\ISecure3dProvider;
8+
use GlobalPayments\Api\Entities\Enums\Secure3dVersion;
9+
10+
class ConfiguredServices
11+
{
12+
private $secure3dProviders;
13+
14+
/** @var IPaymentGateway */
15+
public $gatewayConnector;
16+
17+
/** @var IRecurringService */
18+
public $recurringConnector;
19+
20+
/** @var IReportingService */
21+
public $reportingService;
22+
23+
/** @var IDeviceInterface */
24+
public $deviceInterface;
25+
26+
/** @var DeviceController */
27+
public $deviceController;
28+
29+
/** @var OnlineBoardingConnector */
30+
public $boardingConnector;
31+
32+
/** @var TableServiceConnector */
33+
public $tableServiceConnector;
34+
35+
/** @var PayrollConnector */
36+
public $payrollConnector;
37+
38+
public function __construct()
39+
{
40+
$this->secure3dProviders = array();
41+
}
42+
43+
protected function getSecure3dProvider(Secure3dVersion $version)
44+
{
45+
if (in_array($version, $this->secure3dProviders)) {
46+
return $this->secure3dProviders[$version];
47+
} elseif ($version == Secure3dVersion::ANY) {
48+
$provider = $this->secure3dProviders[Secure3dVersion::TWO];
49+
if ($provider == null) {
50+
$provider = $this->secure3dProviders[Secure3dVersion::ONE];
51+
}
52+
return $provider;
53+
} else {
54+
return null;
55+
}
56+
}
57+
58+
protected function setSecure3dProvider(Secure3dVersion $version, ISecure3dProvider $provider)
59+
{
60+
$this->secure3dProviders[$version] = $provider;
61+
}
62+
}

src/Entities/Enums/ReportType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
class ReportType extends Enum
88
{
99
const FIND_TRANSACTIONS = 1;
10-
const ACTIVITY = 1 << 1;
11-
const TRANSACTION_DETAIL = 1 << 7;
10+
const ACTIVITY = 2; // 1 << 1;
11+
const TRANSACTION_DETAIL = 128; // 1 << 7;
1212
}

src/Entities/Enums/TransactionType.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,38 @@
66

77
class TransactionType extends Enum
88
{
9-
const DECLINE = 1 << 0;
10-
const VERIFY = 1 << 1;
11-
const CAPTURE = 1 << 2;
12-
const AUTH = 1 << 3;
13-
const REFUND = 1 << 4;
14-
const REVERSAL = 1 << 5;
15-
const SALE = 1 << 6;
16-
const EDIT = 1 << 7;
17-
const VOID = 1 << 8;
18-
const ADD_VALUE = 1 << 9;
19-
const BALANCE = 1 << 10;
20-
const ACTIVATE = 1 << 11;
21-
const ALIAS = 1 << 12;
22-
const REPLACE = 1 << 13;
23-
const REWARD = 1 << 14;
24-
const DEACTIVATE = 1 << 15;
25-
const BATCH_CLOSE = 1 << 16;
26-
const CREATE = 1 << 17;
27-
const DELETE = 1 << 18;
28-
const FETCH = 1 << 19;
29-
const SEARCH = 1 << 20;
30-
const HOLD = 1 << 21;
31-
const RELEASE = 1 << 22;
32-
const DCC_RATE_LOOKUP = 1 << 23;
33-
const VERIFY_ENROLLED = 1 << 24;
34-
const VERIFY_SIGNATURE = 1 << 25;
35-
const TOKEN_DELETE = 1 << 26;
36-
const VERIFY_AUTHENTICATION = 1 << 27;
37-
const INITIATE_AUTHENTICATION = 1 << 28;
38-
const DATA_COLLECT = 1 << 29;
39-
const PRE_AUTH_COMPLETION = 1 << 30;
40-
const TOKEN_UPDATE = 1 << 31;
41-
const BENEFIT_WITHDRAWAL = 1 <<32;
42-
const TOKENIZE = 1 << 33;
9+
const DECLINE = 1; // 1 << 0
10+
const VERIFY = 2; // 1 << 1
11+
const CAPTURE = 4; // 1 << 2
12+
const AUTH = 8; // 1 << 3
13+
const REFUND = 16; // 1 << 4
14+
const REVERSAL = 32; // 1 << 5
15+
const SALE = 64; // 1 << 6
16+
const EDIT = 128; // 1 << 7
17+
const VOID = 256; // 1 << 8
18+
const ADD_VALUE = 512; // 1 << 9
19+
const BALANCE = 1024; // 1 << 10
20+
const ACTIVATE = 2048; // 1 << 11
21+
const ALIAS = 4096; // 1 << 12
22+
const REPLACE = 8192; // 1 << 13
23+
const REWARD = 16384; // 1 << 14
24+
const DEACTIVATE = 32768; // 1 << 15
25+
const BATCH_CLOSE = 65536; // 1 << 16
26+
const CREATE = 131072; // 1 << 17
27+
const DELETE = 262144; // 1 << 18
28+
const FETCH = 524288; // 1 << 19
29+
const SEARCH = 1048576; // 1 << 20
30+
const HOLD = 2097152; // 1 << 21
31+
const RELEASE = 4194304; // 1 << 22
32+
const DCC_RATE_LOOKUP = 8388608; //1 << 23
33+
const VERIFY_ENROLLED = 16777216; //1 << 24
34+
const VERIFY_SIGNATURE = 33554432; // 1 << 25
35+
const TOKEN_DELETE = 67108864; // 1 << 26
36+
const VERIFY_AUTHENTICATION = 134217728; // 1 << 27
37+
const INITIATE_AUTHENTICATION = 268435456; // 1 << 28
38+
const DATA_COLLECT = 536870912; // 1 << 29
39+
const PRE_AUTH_COMPLETION = 1073741824; // 1 << 30
40+
const TOKEN_UPDATE = 2147483648; // 1 << 31
41+
const BENEFIT_WITHDRAWAL = 4294967296; // 1 <<32
42+
const TOKENIZE = 8589934592; // 1 << 33;
4343
}

src/Entities/RecurringEntity.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function delete($force = false)
5151
/**
5252
* {@inheritDoc}
5353
*/
54-
public static function find($id)
54+
public static function find($id, $configName = 'default')
5555
{
56-
$client = ServicesContainer::instance()->getRecurringClient();
56+
$client = ServicesContainer::instance()->getRecurringClient($configName);
5757
if (!$client->supportsRetrieval) {
5858
throw new UnsupportedTransactionException();
5959
}
@@ -74,9 +74,9 @@ public static function find($id)
7474
/**
7575
* {@inheritDoc}
7676
*/
77-
public static function findAll()
77+
public static function findAll($configName = 'default')
7878
{
79-
$client = ServicesContainer::instance()->getRecurringClient();
79+
$client = ServicesContainer::instance()->getRecurringClient($configName);
8080
if (!$client->supportsRetrieval) {
8181
throw new UnsupportedTransactionException();
8282
}
@@ -87,7 +87,7 @@ public static function findAll()
8787
/**
8888
* {@inheritDoc}
8989
*/
90-
public function saveChanges()
90+
public function saveChanges($configName = 'default')
9191
{
9292
try {
9393
return RecurringService::edit($this);

src/Entities/Reporting/SearchCriteriaBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function __construct(TransactionReportBuilder $reportBuilder = null)
212212
$this->reportBuilder = $reportBuilder;
213213
}
214214

215-
public function and($criteria, $value)
215+
public function andWith($criteria, $value)
216216
{
217217
if (property_exists($this, $criteria)) {
218218
$this->{$criteria} = $value;

0 commit comments

Comments
 (0)