Skip to content

Commit 94bffec

Browse files
20210401 deployment
1 parent 7cd1d5c commit 94bffec

File tree

66 files changed

+2776
-2678
lines changed

Some content is hidden

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

66 files changed

+2776
-2678
lines changed

src/Builders/AuthorizationBuilder.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use GlobalPayments\Api\Entities\Enums\EmvFallbackCondition;
99
use GlobalPayments\Api\Entities\Enums\EmvLastChipRead;
1010
use GlobalPayments\Api\Entities\Enums\PaymentMethodType;
11+
use GlobalPayments\Api\Entities\Enums\PaymentMethodUsageMode;
1112
use GlobalPayments\Api\Entities\HostedPaymentData;
1213
use GlobalPayments\Api\Entities\Enums\AddressType;
1314
use GlobalPayments\Api\Entities\Enums\AliasAction;
@@ -502,6 +503,11 @@ class AuthorizationBuilder extends TransactionBuilder
502503
*/
503504
public $surchargeAmount;
504505

506+
/**
507+
* @var PaymentMethodUsageMode $paymentMethodUsageMode
508+
*/
509+
public $paymentMethodUsageMode;
510+
505511
/**
506512
* {@inheritdoc}
507513
*
@@ -931,15 +937,15 @@ public function withInvoiceNumber($invoiceNumber)
931937
}
932938

933939
/**
934-
* Set the request to request Level II
940+
* Set the request to request Level II or III
935941
*
936-
* @param bool $level2Request Request to request Level II
942+
* @param bool $level2Request Request to request Level II or III
937943
*
938944
* @return AuthorizationBuilder
939945
*/
940-
public function withCommercialRequest($level2Request)
946+
public function withCommercialRequest($level2or3Request)
941947
{
942-
$this->level2Request = $level2Request;
948+
$this->level2Request = $level2or3Request;
943949
return $this;
944950
}
945951

@@ -1401,4 +1407,18 @@ public function withSurchargeAmount($value)
14011407

14021408
return $this;
14031409
}
1410+
1411+
/**
1412+
* Set the request to use usage_mode
1413+
*
1414+
* @param string $value
1415+
*
1416+
* @return AuthorizationBuilder
1417+
*/
1418+
public function withPaymentMethodUsageMode($value)
1419+
{
1420+
$this->paymentMethodUsageMode = $value;
1421+
1422+
return $this;
1423+
}
14041424
}

src/Builders/ManagementBuilder.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace GlobalPayments\Api\Builders;
44

5+
use GlobalPayments\Api\Entities\Enums\CommercialIndicator;
56
use GlobalPayments\Api\Entities\Enums\TaxType;
67
use GlobalPayments\Api\Entities\Enums\TransactionModifier;
78
use GlobalPayments\Api\Entities\Enums\TransactionType;
@@ -33,11 +34,25 @@ class ManagementBuilder extends TransactionBuilder
3334
*/
3435
public $authAmount;
3536

37+
/**
38+
* Card Brand
39+
*
40+
* @internal
41+
* @var string
42+
*/
43+
public $cardType;
44+
3645
/**
3746
* @internal
3847
* @var string
3948
*/
4049
public $clientTransactionId;
50+
51+
/**
52+
*
53+
* @var CommercialData
54+
*/
55+
public $commercialData;
4156

4257
/**
4358
* Request currency
@@ -273,6 +288,24 @@ public function withAuthAmount($authAmount)
273288
return $this;
274289
}
275290

291+
/**
292+
* Used in conjunction with edit() on CPCEdit requests
293+
*
294+
* @param CommercialData
295+
*
296+
* @return ManagementBuilder
297+
*/
298+
public function withCommercialData($commercialData)
299+
{
300+
$this->commercialData = $commercialData;
301+
302+
if ($commercialData->commercialIndicator === CommercialIndicator::LEVEL_III) {
303+
$this->transactionModifier = TransactionModifier::LEVEL_III;
304+
}
305+
306+
return $this;
307+
}
308+
276309
/**
277310
* Sets the currency.
278311
*

src/Builders/Secure3dBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use GlobalPayments\Api\Entities\Enums\DecoupledFlowRequest;
66
use GlobalPayments\Api\Entities\Enums\WhiteListStatus;
7+
use GlobalPayments\Api\Gateways\GpApiConnector;
78
use GlobalPayments\Api\ServicesContainer;
89
use GlobalPayments\Api\Entities\Exceptions\ApiException;
910
use GlobalPayments\Api\Entities\Exceptions\GatewayException;
@@ -1346,6 +1347,9 @@ public function execute($configName = 'default', $version = Secure3dVersion::ANY
13461347
if ($exc->responseCode == '110' && $provider->getVersion() === Secure3dVersion::ONE) {
13471348
return $rvalue;
13481349
}
1350+
if ($provider instanceof GpApiConnector) {
1351+
throw $exc;
1352+
}
13491353
} elseif ((bool)$canDowngrade && $this->transactionType === TransactionType::VERIFY_ENROLLED) { // check if we can downgrade
13501354
return $this->execute($configName, Secure3dVersion::ONE);
13511355
} else { // throw exception

src/Builders/TransactionReportBuilder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,21 @@ public function orderBy($sortProperty, $sortDirection = SortDirection::DESC)
234234
{
235235
switch ($this->reportType) {
236236
case ReportType::FIND_TRANSACTIONS:
237+
case ReportType::FIND_TRANSACTIONS_PAGED:
237238
case ReportType::FIND_SETTLEMENT_TRANSACTIONS:
239+
case ReportType::FIND_SETTLEMENT_TRANSACTIONS_PAGED:
238240
$this->transactionOrderBy = $sortProperty;
239241
$this->transactionOrder = $sortDirection;
240242
break;
241243
case ReportType::FIND_DEPOSITS:
244+
case ReportType::FIND_DEPOSITS_PAGED:
242245
$this->depositOrderBy = $sortProperty;
243246
$this->depositOrder = $sortDirection;
244247
break;
245248
case ReportType::FIND_DISPUTES:
249+
case ReportType::FIND_DISPUTES_PAGED:
246250
case ReportType::FIND_SETTLEMENT_DISPUTES:
251+
case ReportType::FIND_SETTLEMENT_DISPUTES_PAGED:
247252
$this->disputeOrderBy = $sortProperty;
248253
$this->disputeOrder = $sortDirection;
249254
break;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace GlobalPayments\Api\Entities\Enums;
4+
5+
use GlobalPayments\Api\Entities\Enum;
6+
7+
class PaymentMethodUsageMode extends Enum
8+
{
9+
const SINGLE = 'SINGLE';
10+
const MULTIPLE = 'MULTIPLE';
11+
}

src/Entities/Enums/ReportType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ class ReportType extends Enum
1616
const DISPUTE_DETAIL = 4096; // 1 << 12
1717
const SETTLEMENT_DISPUTE_DETAIL = 8192; // 1 << 13
1818
const FIND_SETTLEMENT_TRANSACTIONS = 16384; // 1 << 14
19+
const FIND_TRANSACTIONS_PAGED = 32768; // 1 << 15
20+
const FIND_SETTLEMENT_TRANSACTIONS_PAGED = 65536; // 1 << 16
21+
const FIND_DEPOSITS_PAGED = 131072; // 1 << 17
22+
const FIND_DISPUTES_PAGED = 262144; // 1 << 18
23+
const FIND_SETTLEMENT_DISPUTES_PAGED = 524288; // 1 << 19
1924
}

src/Entities/Enums/TransactionModifier.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ class TransactionModifier extends Enum
2020
const ENCRYPTED_MOBILE = 11;
2121
const SECURE3D = 12;
2222
const ALTERNATIVE_PAYMENT_METHOD = 12;
23+
const LEVEL_III = 13;
2324
}

src/Entities/GpApi/AccessToken.php

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace GlobalPayments\Api\Entities\GpApi;
4+
5+
class AccessTokenInfo
6+
{
7+
/**
8+
* @var string
9+
*/
10+
public $accessToken;
11+
/**
12+
* @var string
13+
*/
14+
public $dataAccountName;
15+
/**
16+
* @var string
17+
*/
18+
public $disputeManagementAccountName;
19+
/**
20+
* @var string
21+
*/
22+
public $tokenizationAccountName;
23+
/**
24+
* @var string
25+
*/
26+
public $transactionProcessingAccountName;
27+
}

src/Entities/GpApi/AccessTokenRequest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
22

3-
43
namespace GlobalPayments\Api\Entities\GpApi;
54

6-
75
class AccessTokenRequest
86
{
97
public $app_id;
@@ -12,6 +10,7 @@ class AccessTokenRequest
1210
public $grant_type;
1311
public $seconds_to_expire;
1412
public $interval_to_expire;
13+
public $permissions;
1514

1615
/**
1716
* AccessTokenRequest constructor.
@@ -22,13 +21,14 @@ class AccessTokenRequest
2221
* @param $seconds_to_expire
2322
* @param $interval_to_expire
2423
*/
25-
public function __construct($app_id, $nonce, $secret, $grant_type, $seconds_to_expire, $interval_to_expire)
24+
public function __construct($app_id, $nonce, $secret, $grant_type, $seconds_to_expire, $interval_to_expire, $permissions)
2625
{
2726
$this->app_id = $app_id;
2827
$this->nonce = $nonce;
2928
$this->secret = $secret;
3029
$this->grant_type = $grant_type;
3130
$this->seconds_to_expire = $seconds_to_expire;
3231
$this->interval_to_expire = $interval_to_expire;
32+
$this->permissions = $permissions;
3333
}
3434
}

0 commit comments

Comments
 (0)