Skip to content

Commit

Permalink
OctopusDeploy release: 4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Jun 9, 2022
1 parent 7f34519 commit 7bad2fe
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@

# Changelog


## Latest version
#### Enhancements:
- HPP Exemption Optimization Service
- Update timestamp on the Logger

## v4.0.0 (06/07/2022)
#### Enhancements:
- GP-ECOM: Add payment scheduler
- GP-ECOM/GP-API: Structure refacto
- Upgrade to min PHP 7.1
- GP-API: Add example with Google Pay

## v3.1.1 (05/17/2022)
#### Enhancements:
Expand Down
2 changes: 1 addition & 1 deletion metadata.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<xml>
<releaseNumber>4.0.0</releaseNumber>
<releaseNumber>4.0.1</releaseNumber>
</xml>
3 changes: 3 additions & 0 deletions src/Entities/HostedPaymentData.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ class HostedPaymentData
/** @var BankPayment */
public $bankPayment;

/** @var boolean */
public $enableExemptionOptimization;

/**
* Instantiates a new `HostedPaymentData` object.
*
Expand Down
1 change: 1 addition & 0 deletions src/Gateways/GpEcomConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ public function serializeRequest(AuthorizationBuilder $builder)
$this->setSerializeData('HPP_CUSTOMER_PHONENUMBER_MOBILE', $hostedPaymentData->customerPhoneMobile);
$this->setSerializeData('HPP_PHONE', $hostedPaymentData->customerPhoneMobile);
$this->setSerializeData('HPP_CHALLENGE_REQUEST_INDICATOR', $hostedPaymentData->challengeRequest);
$this->setSerializeData('HPP_ENABLE_EXEMPTION_OPTIMIZATION', $hostedPaymentData->enableExemptionOptimization);
if (isset($hostedPaymentData->addressesMatch)) {
$this->setSerializeData('HPP_ADDRESS_MATCH_INDICATOR', $hostedPaymentData->addressesMatch ? 'TRUE' : 'FALSE');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Logging/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ private function getTimestamp()
{
$originalTime = microtime(true);
$micro = sprintf("%06d", ($originalTime - floor($originalTime)) * 1000000);
$date = new DateTime(date('Y-m-d H:i:s.' . $micro, $originalTime));
$date = new DateTime(date('Y-m-d H:i:s.' . $micro, (int) $originalTime));

return $date->format($this->options['dateFormat']);
}
Expand Down
34 changes: 33 additions & 1 deletion test/Integration/Gateways/GpEcomConnector/HppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
use GlobalPayments\Api\Entities\Enums\AddressType;
use GlobalPayments\Api\Entities\Enums\FraudFilterMode;
use GlobalPayments\Api\Entities\Enums\GatewayProvider;
//use GlobalPayments\Api\ServiceConfigs\Gateways\GpEcomConfig;
use GlobalPayments\Api\ServiceConfigs\Gateways\GpEcomConfig;
use GlobalPayments\Api\Tests\Integration\Gateways\GpEcomConnector\Hpp\GpEcomHppClient;
use GlobalPayments\Api\Entities\Enums\RemittanceReferenceType;
use GlobalPayments\Api\Entities\Enums\ChallengeRequestIndicator;
use PHPUnit\Framework\TestCase;

class HppTest extends TestCase
Expand Down Expand Up @@ -987,4 +987,36 @@ public function testOpenBankingInitiate()
$parsedResponse = $service->parseResponse($response);
$this->assertEquals(BankPaymentStatus::PAYMENT_INITIATED, $parsedResponse->responseMessage);
}

public function test3DSExemption()
{
$config = new GpEcomConfig();
$config->merchantId = "heartlandgpsandbox";
$config->accountId = "3dsecure";
$config->sharedSecret = "secret";
$config->hostedPaymentConfig = new HostedPaymentConfig();
$config->hostedPaymentConfig->language = "GB";
$config->hostedPaymentConfig->responseUrl = "https://www.example.com/response";;
$config->hostedPaymentConfig->version = HppVersion::VERSION_2;

$service = new HostedService($config);

// data to be passed to the HPP along with transaction level settings
$hostedPaymentData = new HostedPaymentData();
$hostedPaymentData->enableExemptionOptimization = true;
$hostedPaymentData->challengeRequest = ChallengeRequestIndicator::NO_CHALLENGE_REQUESTED;

//serialize the request
$json = $service->charge(10.01)
->withCurrency("EUR")
->withAddress($this->billingAddress, AddressType::BILLING)
->withAddress($this->shippingAddress, AddressType::SHIPPING)
->withHostedPaymentData($hostedPaymentData)
->serialize();
$this->assertNotNull($json);

$jsonResponse = json_decode($json, true);
$this->assertTrue(isset($jsonResponse['HPP_ENABLE_EXEMPTION_OPTIMIZATION']));
$this->assertEquals(true, $jsonResponse['HPP_ENABLE_EXEMPTION_OPTIMIZATION']);
}
}

0 comments on commit 7bad2fe

Please sign in to comment.