-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from globalpayments/20210105-deployment
20210105 deployment
- Loading branch information
Showing
32 changed files
with
12,585 additions
and
12,626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="./test/setup.php" | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="true" | ||
> | ||
<php> | ||
<ini name="zend.enable_gc" value="0"/> | ||
<ini name="memory_limit" value="-1"/> | ||
<!-- error_reporting(E_ALL); --> | ||
<ini name="error_reporting" value="32767"/> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="all"> | ||
<directory>./test/</directory> | ||
</testsuite> | ||
<testsuite name="unit"> | ||
<directory>./test/Unit/</directory> | ||
</testsuite> | ||
<testsuite name="integration"> | ||
<directory>./test/Integration/</directory> | ||
</testsuite> | ||
<testsuite name="certification"> | ||
<directory>./test/Integration/Gateways/PorticoConnector/Certifications/</directory> | ||
<directory>./test/Integration/Gateways/RealexConnector/Certifications/</directory> | ||
</testsuite> | ||
<testsuite name="portico"> | ||
<directory>./test/Integration/Gateways/PorticoConnector/</directory> | ||
</testsuite> | ||
<testsuite name="realex"> | ||
<directory>./test/Integration/Gateways/RealexConnector/</directory> | ||
</testsuite> | ||
|
||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
<exclude> | ||
<directory>./test/</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> | ||
<!-- vim: set ft=xml --> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="./test/setup.php" | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
> | ||
<php> | ||
<ini name="zend.enable_gc" value="0"/> | ||
<ini name="memory_limit" value="-1"/> | ||
<!-- error_reporting(E_ALL); --> | ||
<ini name="error_reporting" value="32767"/> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="all"> | ||
<directory>./test/</directory> | ||
</testsuite> | ||
<testsuite name="unit"> | ||
<directory>./test/Unit/</directory> | ||
</testsuite> | ||
<testsuite name="integration"> | ||
<directory>./test/Integration/</directory> | ||
</testsuite> | ||
<testsuite name="certification"> | ||
<directory>./test/Integration/Gateways/PorticoConnector/Certifications/</directory> | ||
<directory>./test/Integration/Gateways/RealexConnector/Certifications/</directory> | ||
</testsuite> | ||
<testsuite name="portico"> | ||
<directory>./test/Integration/Gateways/PorticoConnector/</directory> | ||
</testsuite> | ||
<testsuite name="realex"> | ||
<directory>./test/Integration/Gateways/RealexConnector/</directory> | ||
</testsuite> | ||
|
||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
<exclude> | ||
<directory>./test/</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> | ||
<!-- vim: set ft=xml --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,111 @@ | ||
<?php | ||
|
||
namespace GlobalPayments\Api\Entities; | ||
|
||
use GlobalPayments\Api\ServicesContainer; | ||
use GlobalPayments\Api\Entities\Exceptions\ApiException; | ||
use GlobalPayments\Api\Entities\Exceptions\UnsupportedTransactionException; | ||
use GlobalPayments\Api\PaymentMethods\RecurringPaymentMethod; | ||
use GlobalPayments\Api\Services\RecurringService; | ||
|
||
/** | ||
* Base implementation for recurring resource types. | ||
* </summary> | ||
*/ | ||
abstract class RecurringEntity implements IRecurringEntity | ||
{ | ||
/** | ||
* All resource should be supplied a merchant-/application-defined ID. | ||
* | ||
* @var string | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* All resources should be supplied a gateway-defined ID. | ||
* | ||
* @var string | ||
*/ | ||
public $key; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function create() | ||
{ | ||
return RecurringService::create($this); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function delete($force = false) | ||
{ | ||
try { | ||
return RecurringService::delete($this, $force); | ||
} catch (ApiException $exc) { | ||
throw new ApiException('Failed to delete record, see inner exception for more details', $exc); | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public static function find($id, $configName = 'default') | ||
{ | ||
$client = ServicesContainer::instance()->getRecurringClient($configName); | ||
if (!$client->supportsRetrieval) { | ||
throw new UnsupportedTransactionException(); | ||
} | ||
|
||
$identifier = static::getIdentifierName(); | ||
$response = RecurringService::search(static::class) | ||
->addSearchCriteria($identifier, $id) | ||
->execute(); | ||
$entity = isset($response[0]) ? $response[0] : null; | ||
|
||
if ($entity !== null) { | ||
return RecurringService::get($entity); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public static function findAll($configName = 'default') | ||
{ | ||
$client = ServicesContainer::instance()->getRecurringClient($configName); | ||
if (!$client->supportsRetrieval) { | ||
throw new UnsupportedTransactionException(); | ||
} | ||
|
||
return RecurringService::search(static::class)->execute(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function saveChanges($configName = 'default') | ||
{ | ||
try { | ||
return RecurringService::edit($this); | ||
} catch (ApiException $exc) { | ||
throw new ApiException('Update failed, see inner exception for more details', $exc); | ||
} | ||
} | ||
|
||
protected static function getIdentifierName() | ||
{ | ||
if (static::class === Customer::class) { | ||
return 'customerIdentifier'; | ||
} elseif (static::class === RecurringPaymentMethod::class) { | ||
return 'paymentMethodIdentifier'; | ||
} elseif (static::class === Schedule::class) { | ||
return 'scheduleIdentifier'; | ||
} | ||
return ''; | ||
} | ||
} | ||
<?php | ||
|
||
namespace GlobalPayments\Api\Entities; | ||
|
||
use GlobalPayments\Api\ServicesContainer; | ||
use GlobalPayments\Api\Entities\Exceptions\ApiException; | ||
use GlobalPayments\Api\Entities\Exceptions\UnsupportedTransactionException; | ||
use GlobalPayments\Api\PaymentMethods\RecurringPaymentMethod; | ||
use GlobalPayments\Api\Services\RecurringService; | ||
|
||
/** | ||
* Base implementation for recurring resource types. | ||
* </summary> | ||
*/ | ||
abstract class RecurringEntity implements IRecurringEntity | ||
{ | ||
/** | ||
* All resource should be supplied a merchant-/application-defined ID. | ||
* | ||
* @var string | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* All resources should be supplied a gateway-defined ID. | ||
* | ||
* @var string | ||
*/ | ||
public $key; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function create() | ||
{ | ||
return RecurringService::create($this); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function delete($force = false) | ||
{ | ||
try { | ||
return RecurringService::delete($this, $force); | ||
} catch (ApiException $exc) { | ||
throw new ApiException('Failed to delete record, see inner exception for more details', $exc); | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public static function find($id, $configName = 'default') | ||
{ | ||
$client = ServicesContainer::instance()->getRecurringClient($configName); | ||
if (!$client->supportsRetrieval) { | ||
throw new UnsupportedTransactionException(); | ||
} | ||
|
||
$identifier = static::getIdentifierName(); | ||
$response = RecurringService::search(static::class) | ||
->addSearchCriteria($identifier, $id) | ||
->execute(); | ||
|
||
foreach ($response as $entity) { | ||
if ($entity->id === $id) { | ||
return RecurringService::get($entity); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public static function findAll($configName = 'default') | ||
{ | ||
$client = ServicesContainer::instance()->getRecurringClient($configName); | ||
if (!$client->supportsRetrieval) { | ||
throw new UnsupportedTransactionException(); | ||
} | ||
|
||
return RecurringService::search(static::class)->execute(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function saveChanges($configName = 'default') | ||
{ | ||
try { | ||
return RecurringService::edit($this); | ||
} catch (ApiException $exc) { | ||
throw new ApiException('Update failed, see inner exception for more details', $exc); | ||
} | ||
} | ||
|
||
protected static function getIdentifierName() | ||
{ | ||
if (static::class === Customer::class) { | ||
return 'customerIdentifier'; | ||
} elseif (static::class === RecurringPaymentMethod::class) { | ||
return 'paymentMethodIdentifier'; | ||
} elseif (static::class === Schedule::class) { | ||
return 'scheduleIdentifier'; | ||
} | ||
return ''; | ||
} | ||
} |
Oops, something went wrong.