Skip to content

Commit 7cd1d5c

Browse files
20210323 deployment
1 parent 57994ad commit 7cd1d5c

26 files changed

+888
-45
lines changed

src/Builders/AuthorizationBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ public function __construct($type, IPaymentMethod $paymentMethod = null)
522522
*
523523
* @return Transaction
524524
*/
525-
public function execute(string $configName = 'default')
525+
public function execute($configName = 'default')
526526
{
527527
parent::execute($configName);
528528

@@ -535,7 +535,7 @@ public function execute(string $configName = 'default')
535535
*
536536
* @return String
537537
*/
538-
public function serialize(string $configName = 'default')
538+
public function serialize($configName = 'default')
539539
{
540540
$this->transactionModifier = TransactionModifier::HOSTEDREQUEST;
541541
parent::execute();

src/Builders/ManagementBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function __isset($name)
202202
*
203203
* @return Transaction
204204
*/
205-
public function execute(string $configName = 'default')
205+
public function execute($configName = 'default')
206206
{
207207
parent::execute($configName);
208208
return ServicesContainer::instance()

src/Builders/PayFacBuilder.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct($type)
6868
*
6969
* @return mixed
7070
*/
71-
public function execute(string $configName = 'default')
71+
public function execute($configName = 'default')
7272
{
7373
parent::execute($configName);
7474

@@ -170,7 +170,7 @@ protected function setupValidations()
170170
}
171171

172172
/*
173-
* Primary Bank Account Information Optional. Used to add a bank account to which funds can be settled
173+
* Primary Bank Account Information - Optional. Used to add a bank account to which funds can be settled
174174
*
175175
* var Object GlobalPayments\Api\Entities\PayFac\BankAccountData;
176176
*/
@@ -180,7 +180,7 @@ public function withBankAccountData(BankAccountData $bankAccountData)
180180
return $this;
181181
}
182182
/*
183-
* Merchant Beneficiary Owner Information Required for all merchants validating KYC based off of personal data
183+
* Merchant Beneficiary Owner Information - Required for all merchants validating KYC based off of personal data
184184
*
185185
* var Object GlobalPayments\Api\Entities\PayFac\BeneficialOwnerData;
186186
*/
@@ -190,7 +190,7 @@ public function withBeneficialOwnerData(BeneficialOwnerData $beneficialOwnerData
190190
return $this;
191191
}
192192
/*
193-
* Business Data Required for business validated accounts. May also be required for personal validated accounts
193+
* Business Data - Required for business validated accounts. May also be required for personal validated accounts
194194
* by ProPay Risk Team
195195
*
196196
* var Object GlobalPayments\Api\Entities\PayFac\BusinessData;
@@ -201,7 +201,7 @@ public function withBusinessData(BusinessData $businessData)
201201
return $this;
202202
}
203203
/*
204-
* Significant Owner Information May be required for some partners based on ProPay Risk decision
204+
* Significant Owner Information - May be required for some partners based on ProPay Risk decision
205205
*
206206
* var Object GlobalPayments\Api\Entities\PayFac\SignificantOwnerData;
207207
*/
@@ -211,7 +211,7 @@ public function withSignificantOwnerData(SignificantOwnerData $significantOwnerD
211211
return $this;
212212
}
213213
/*
214-
* Threat Risk Assessment Information May be required based on ProPay Risk Decision
214+
* Threat Risk Assessment Information - May be required based on ProPay Risk Decision
215215
*
216216
* var Object GlobalPayments\Api\Entities\PayFac\ThreatRiskData;
217217
*/
@@ -268,7 +268,7 @@ public function withAccountNumber($accountNumber)
268268
}
269269

270270
/*
271-
* Temporary password which will allow a onetime login to ProPays website. Must be at least eight characters.
271+
* Temporary password which will allow a onetime login to ProPay's website. Must be at least eight characters.
272272
* Must not contain part or the entire first or last name. Must contain at least one capital letter,
273273
* one lower case letter, and either one symbol or one number
274274
*

src/Builders/RecurringBuilder.php

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

src/Builders/ReportBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct($reportType)
3636
*
3737
* @return mixed
3838
*/
39-
public function execute(string $configName = 'default')
39+
public function execute($configName = 'default')
4040
{
4141
parent::execute($configName);
4242

src/Entities/Address.php

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace GlobalPayments\Api\Entities;
44

5+
use GlobalPayments\Api\Entities\Exceptions\ArgumentException;
6+
use GlobalPayments\Api\Utils\CountryUtils;
7+
58
/**
69
* Represents a billing or shipping address for the consumer.
710
*/
@@ -70,14 +73,56 @@ class Address
7073
*
7174
* @var string
7275
*/
73-
public $country;
76+
protected $country;
7477

7578
/**
7679
* Consumer's country code.
7780
*
7881
* @var string
7982
*/
80-
public $countryCode;
83+
protected $countryCode;
84+
85+
public function __get($property)
86+
{
87+
if (property_exists($this, $property)) {
88+
return $this->{$property};
89+
}
90+
}
91+
92+
public function __set($property, $value)
93+
{
94+
if (in_array(
95+
$property,
96+
[
97+
'countryCode',
98+
'country',
99+
]
100+
)) {
101+
$countryInfo = CountryUtils::getCountryInfo($value);
102+
}
103+
104+
switch ($property)
105+
{
106+
case 'countryCode':
107+
if ($this->country == null && isset($countryInfo)) {
108+
$this->country = !empty($countryInfo['name']) ? $countryInfo['name'] : null;
109+
}
110+
break;
111+
case 'country':
112+
if ($this->countryCode == null && isset($countryInfo)) {
113+
$this->countryCode = !empty($countryInfo['alpha2']) ? $countryInfo['alpha2'] : null;
114+
}
115+
break;
116+
default:
117+
break;
118+
}
119+
120+
if (property_exists($this, $property)) {
121+
return $this->{$property} = $value;
122+
}
123+
124+
throw new ArgumentException(sprintf('Property `%s` does not exist on Address', $property));
125+
}
81126

82127
/**
83128
* Gets the consumer's province.
@@ -93,4 +138,9 @@ public function getProvince()
93138
? $this->province
94139
: $this->state;
95140
}
141+
142+
public function isCountry($countryCode)
143+
{
144+
return CountryUtils::isCountry($this, $countryCode);
145+
}
96146
}

src/Entities/CustomWebProxy.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
4+
namespace GlobalPayments\Api\Entities;
5+
6+
7+
class CustomWebProxy implements IWebProxy
8+
{
9+
private $uri;
10+
private $username;
11+
private $password;
12+
13+
public function __construct($uri, $username = null, $password = null)
14+
{
15+
$this->uri = $uri;
16+
$this->username = $username;
17+
$this->password = $password;
18+
}
19+
20+
public function __get($property)
21+
{
22+
if (property_exists($this, $property)) {
23+
return $this->{$property};
24+
}
25+
}
26+
27+
public function getProxy($destination)
28+
{
29+
return $destination;
30+
}
31+
32+
public function isBypassed($host)
33+
{
34+
return false;
35+
}
36+
}

src/Entities/Enums/FraudFilterMode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ class FraudFilterMode extends Enum
99
const NONE = 'NONE';
1010
const OFF = 'OFF';
1111
const PASSIVE = 'PASSIVE';
12+
const ACTIVE = 'ACTIVE ';
1213
}

0 commit comments

Comments
 (0)