Skip to content

Commit

Permalink
OctopusDeploy release: 2.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Jun 15, 2021
1 parent f116e18 commit ca2167b
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 43 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<a href="https://github.com/globalpayments" target="_blank">
<img src="https://globalpayments.github.io/images/globapaymentsLogo.png" alt="Global Payments logo" title="Global Payments" align="right" width="225" />
<img src="https://developer.globalpay.com/static/media/logo.dab7811d.svg" alt="Global Payments logo" title="Global Payments" align="right" width="225" />
</a>

# Changelog

## Latest version

#### Enhancements:
- Add RequestLogger to GP-ECOM
- Fix message_extension issue for 3DS2 on GP-ECOM
- Update logo image on Readme and Changelog files
- Add depositDate and depositReference mappings for settlement disputes report on GP-API
- Change property name from "storage_model" to "storage_mode" on GP-API

## v2.3.3 (05/27/2021)

#### Enhancements:

- enhance GP-ECOM error handling
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a href="https://github.com/globalpayments" target="_blank">
<img src="https://globalpayments.github.io/images/globapaymentsLogo.png" alt="Global Payments logo" title="Global Payments" align="right" width="225" />
<img src="https://developer.globalpay.com/static/media/logo.dab7811d.svg" alt="Global Payments logo" title="Global Payments" align="right" width="225" />
</a>

# Global Payments & Heartland PHP SDK
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/GpApi/DTO/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PaymentMethod
public $authentication;
public $encryption;
public $name;
public $storage_model;
public $storage_mode;

/** @var Card $card */
public $card;
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/GpApi/GpApiAuthorizationRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private function createPaymentMethodParam($builder)
if (is_null($paymentMethod->id)) {
$paymentMethod->card = CardUtils::generateCard($builder);
}
$paymentMethod->storage_model = $builder->requestMultiUseToken == true ? 'ON_SUCCESS' : null;
$paymentMethod->storage_mode = $builder->requestMultiUseToken == true ? 'ON_SUCCESS' : null;

return $paymentMethod;
}
Expand Down
26 changes: 26 additions & 0 deletions src/Entities/MessageExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace GlobalPayments\Api\Entities;

class MessageExtension
{
/**
* @var boolean
*/
public $criticalityIndicator;

/**
* @var string
*/
public $messageExtensionData;

/**
* @var string
*/
public $messageExtensionId;

/**
* @var string
*/
public $messageExtensionName;
}
24 changes: 3 additions & 21 deletions src/Entities/ThreeDSecure.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public function setAmount($value)
public $challengeReturnUrl;

/**
* @var string
* @var MessageExtension[]
*/
public $criticalityIndicator;
public $messageExtension;

/**
* @var string
Expand Down Expand Up @@ -226,21 +226,6 @@ public function setMerchantData($merchantData)
*/
public $messageCategory;

/**
* @var string
*/
public $messageExtensionData;

/**
* @var string
*/
public $messageExtensionId;

/**
* @var string
*/
public $messageExtensionName;

/**
* @var string
*/
Expand Down Expand Up @@ -392,7 +377,7 @@ public function merge(ThreeDSecure $secureEcom)
$this->cavv = $this->mergeValue($this->cavv, $secureEcom->cavv);
$this->challengeMandated = $this->mergeValue($this->challengeMandated, $secureEcom->challengeMandated);
$this->challengeValue = $this->mergeValue($this->challengeValue, $secureEcom->challengeValue);
$this->criticalityIndicator = $this->mergeValue($this->criticalityIndicator, $secureEcom->criticalityIndicator);
$this->messageExtension = $this->mergeValue($this->messageExtension, $secureEcom->messageExtension);
$this->currency = $this->mergeValue($this->currency, $secureEcom->currency);
$this->decoupledResponseIndicator = $this->mergeValue($this->decoupledResponseIndicator, $secureEcom->decoupledResponseIndicator);
$this->directoryServerTransactionId = $this->mergeValue($this->directoryServerTransactionId, $secureEcom->directoryServerTransactionId);
Expand All @@ -402,9 +387,6 @@ public function merge(ThreeDSecure $secureEcom)
$this->enrolled = $this->mergeValue($this->enrolled, $secureEcom->enrolled);
$this->issuerAcsUrl = $this->mergeValue($this->issuerAcsUrl, $secureEcom->issuerAcsUrl);
$this->messageCategory = $this->mergeValue($this->messageCategory, $secureEcom->messageCategory);
$this->messageExtensionData = $this->mergeValue($this->messageExtensionData, $secureEcom->messageExtensionData);
$this->messageExtensionId = $this->mergeValue($this->messageExtensionId, $secureEcom->messageExtensionId);
$this->messageExtensionName = $this->mergeValue($this->messageExtensionName, $secureEcom->messageExtensionName);
$this->messageVersion = $this->mergeValue($this->messageVersion, $secureEcom->messageVersion);
$this->orderId = $this->mergeValue($this->orderId, $secureEcom->orderId);
$this->payerAuthenticationRequest = $this->mergeValue($this->payerAuthenticationRequest, $secureEcom->payerAuthenticationRequest);
Expand Down
2 changes: 1 addition & 1 deletion src/Gateways/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected function sendRequest(
}

if (isset($this->requestLogger)) {
$this->requestLogger->requestSent($verb, $endpoint, $headers, $queryStringParams, $data);
$this->requestLogger->requestSent($verb, $this->serviceUrl . $endpoint . $queryString, $headers, null, $data);
}

curl_setopt($request, CURLOPT_CONNECTTIMEOUT, $this->timeout);
Expand Down
23 changes: 12 additions & 11 deletions src/Gateways/Gp3DSProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
use GlobalPayments\Api\Builders\Secure3dBuilder;
use GlobalPayments\Api\Entities\Enums\ExemptionReason;
use GlobalPayments\Api\Entities\Enums\ExemptStatus;
use GlobalPayments\Api\Entities\MessageExtension;
use GlobalPayments\Api\Entities\ThreeDSecure;
use GlobalPayments\Api\Entities\Transaction;
use GlobalPayments\Api\Entities\Enums\Secure3dVersion;
use GlobalPayments\Api\Entities\Enums\TransactionType;
use GlobalPayments\Api\Entities\Exceptions\ApiException;
use GlobalPayments\Api\Entities\Exceptions\GatewayException;
use GlobalPayments\Api\PaymentMethods\CreditCardData;
use GlobalPayments\Api\PaymentMethods\Interfaces\IPaymentMethod;
use GlobalPayments\Api\PaymentMethods\Interfaces\ISecure3d;
use GlobalPayments\Api\PaymentMethods\RecurringPaymentMethod;
use GlobalPayments\Api\Utils\GenerationUtils;

Expand Down Expand Up @@ -409,15 +408,17 @@ private function mapResponse($rawResponse)

// message_extension
if (array_key_exists('message_extension', $doc)) {
$secureEcom->criticalityIndicator =
isset($doc['message_extension']['criticality_indicator']) ?
$doc['message_extension']['criticality_indicator'] : null;
$secureEcom->messageExtensionData = isset($doc['message_extension']['data']) ?
$doc['message_extension']['data'] : null;
$secureEcom->messageExtensionId =
isset($doc['message_extension']['id']) ? $doc['message_extension']['id'] : null;
$secureEcom->messageExtensionName =
isset($doc['message_extension']['name']) ? $doc['message_extension']['name'] : null;
foreach ($doc['message_extension'] as $messageExtension) {
$msgItem = new MessageExtension();
$msgItem->criticalityIndicator =
isset($messageExtension['criticality_indicator']) ?
$messageExtension['criticality_indicator'] : null;
$msgItem->messageExtensionData = isset($messageExtension['data']) ?
json_encode($messageExtension['data']) : null;
$msgItem->messageExtensionId = isset($messageExtension['id']) ? $messageExtension['id'] : null;
$msgItem->messageExtensionName = isset($messageExtension['name']) ? $messageExtension['name'] : null;
$secureEcom->messageExtension[] = $msgItem;
}
}

// versions
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/GpApiMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ public static function mapDisputeSummary($response)
$summary->lastAdjustmentAmount = StringUtils::toAmount($response->last_adjustment_amount);
$summary->lastAdjustmentCurrency = $response->last_adjustment_currency;
$summary->lastAdjustmentFunding = $response->last_adjustment_funding;
$summary->depositDate = !empty($response->deposit_time_created) ? $response->deposit_time_created : null;
$summary->depositReference = !empty($response->deposit_id) ? $response->deposit_id : null;

return $summary;
}
Expand Down
3 changes: 3 additions & 0 deletions src/ServiceConfigs/Gateways/GpEcomConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function configureContainer(ConfiguredServices $services)
$gateway->serviceUrl = $this->serviceUrl;
$gateway->refundPassword = $this->refundPassword;
$gateway->hostedPaymentConfig = $this->hostedPaymentConfig;
$gateway->requestLogger = $this->requestLogger;
$gateway->webProxy = $this->webProxy;

$services->gatewayConnector = $gateway;
Expand All @@ -76,6 +77,8 @@ public function configureContainer(ConfiguredServices $services)
$secure3d2->setMethodNotificationUrl($this->methodNotificationUrl);
$secure3d2->setChallengeNotificationUrl($this->challengeNotificationUrl);
$secure3d2->timeout = $gateway->timeout;
$secure3d2->requestLogger = $this->requestLogger;
$secure3d2->webProxy = $this->webProxy;

$services->setSecure3dProvider(Secure3dVersion::TWO, $secure3d2);
}
Expand Down
13 changes: 8 additions & 5 deletions src/Utils/Logging/SampleRequestLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,28 @@ public function __construct(LoggerInterface $logger)

public function requestSent($verb, $endpoint, $headers, $queryStringParams, $data)
{
// TODO: Implement requestSent() method.
$this->logger->info("Request/Response START");
$this->logger->info("Request START");
$this->logger->info("Request verb: " . $verb);
$this->logger->info("Request endpoint: " . $endpoint);
$this->logger->info("Request headers: ", $headers);
$this->logger->info("Request query string: ", !empty($queryStringParams) ? $queryStringParams : array());
$this->logger->info("Request body: ", !empty($data) ? json_decode($data, true) : array());
$this->logger->info("Request body: " . $data);
$this->logger->info("REQUEST END");
}


public function responseReceived(GatewayResponse $response)
{
// TODO: Implement responseReceived() method.
$this->logger->info("Response START");
$this->logger->info("Status code: " . $response->statusCode);
$this->logger->info("Response body: ", json_decode(gzdecode($response->rawResponse), true));
$rs = clone $response;
if (strpos($rs->header, ': gzip') !== false) {
$rs->rawResponse = gzdecode($rs->rawResponse);
}
$this->logger->info("Response body: " . $rs->rawResponse);
$this->logger->info("Response END");
$this->logger->info("Request/Response END");
$this->logger->info("=============================================");
}

public function responseError(\Exception $e)
Expand All @@ -48,6 +50,7 @@ public function responseError(\Exception $e)
$this->logger->info("Exception type: " . get_class($e));
$this->logger->info("Exception message: " . $e->getMessage());
$this->logger->info("Exception END");
$this->logger->info("=============================================");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
use GlobalPayments\Api\ServiceConfigs\Gateways\GpApiConfig;
use GlobalPayments\Api\ServicesContainer;
use GlobalPayments\Api\Utils\GenerationUtils;
use GlobalPayments\Api\Utils\Logging\Logger;
use GlobalPayments\Api\Utils\Logging\SampleRequestLogger;
use PHPUnit\Framework\TestCase;

class CreditCardNotPresentTest extends TestCase
Expand Down Expand Up @@ -1033,7 +1035,8 @@ public function setUpConfig()
$config->channel = Channels::CardNotPresent;
$config->country = 'GB';
// $config->permissions = ['TRN_POST_Authorize'];
// $config->webProxy = new CustomWebProxy('127.0.0.1:8866');
// $config->webProxy = new CustomWebProxy('127.0.0.1:8866');
// $config->requestLogger = new SampleRequestLogger(new Logger("logs"));

return $config;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace GlobalPayments\Api\Tests\Integration\Gateways\RealexConnector;

use GlobalPayments\Api\Entities\CustomWebProxy;
use GlobalPayments\Api\Entities\Enums\DecoupledFlowRequest;
use GlobalPayments\Api\Entities\Enums\MerchantInitiatedRequestType;
use GlobalPayments\Api\Entities\Enums\WhiteListStatus;
Expand All @@ -13,6 +14,8 @@
use GlobalPayments\Api\Services\Secure3dService;
use GlobalPayments\Api\Tests\Data\TestCards;
use GlobalPayments\Api\Tests\Integration\Gateways\ThreeDSecureAcsClient;
use GlobalPayments\Api\Utils\Logging\Logger;
use GlobalPayments\Api\Utils\Logging\SampleRequestLogger;
use PHPUnit\Framework\TestCase;
use GlobalPayments\Api\Entities\Address;
use GlobalPayments\Api\Entities\BrowserData;
Expand Down Expand Up @@ -105,6 +108,8 @@ protected function getConfig()
$config->challengeNotificationUrl = 'https://www.example.com/challengeNotificationUrl';
$config->secure3dVersion = Secure3dVersion::ANY;
$config->merchantContactUrl = 'https://www.example.com';
// $config->requestLogger = new SampleRequestLogger(new Logger("logs"));
// $config->webProxy = new CustomWebProxy('127.0.0.1:8866');

return $config;
}
Expand Down

0 comments on commit ca2167b

Please sign in to comment.