Skip to content

Commit

Permalink
OctopusDeploy release: 11.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Jan 23, 2024
1 parent c95384e commit 1b82f7d
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 13 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@

# Changelog

## Latest Version - v11.0.6 (01/16/24)
## Latest Version - v11.0.7 (01/22/24)
### Enhancements:
- [GP-ECOM] Update parseResponse for HostedService

#### Bug Fixes:
- [MEET-IN-THE-CLOUD][UPA] - Fix endOfDay

## v11.0.6 (01/16/24)
### Enhancements:
- [GP-API] Update QR code payment example for WeChat

Expand Down
20 changes: 14 additions & 6 deletions examples/gp-ecom/hpp/get-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@

// configure client, request and HPP settings
$config = new GpEcomConfig();
/* Credentials for OpenBanking HPP
$config->merchantId = "openbankingsandbox";
$config->accountId = "internet";
$config->sharedSecret = "sharedsecret";
*/
/* Credentials for OpenBanking HPP*/
//$config->merchantId = "openbankingsandbox";
//$config->accountId = "internet";
//$config->sharedSecret = "sharedsecret";

$config->merchantId = "heartlandgpsandbox";
$config->accountId = "hpp";
$config->sharedSecret = "secret";

$config->serviceUrl = "https://pay.sandbox.realexpayments.com/pay";
$config->enableBankPayment = true;
$config->hostedPaymentConfig = new HostedPaymentConfig();
Expand All @@ -51,7 +52,7 @@
$hostedPaymentData->customerCountry = 'DE';
$hostedPaymentData->customerFirstName = 'James';
$hostedPaymentData->customerLastName = 'Mason';
$baseUrl = 'https://ff6e-2a02-2f0e-5615-3300-b580-5acb-6bf-4b11.ngrok-free.app';
$baseUrl = 'https://516b-2a02-2f0e-5e11-1500-3944-7324-2f8a-fbfd.ngrok-free.app';
$hostedPaymentData->transactionStatusUrl = "$baseUrl/examples/gp-ecom/hpp/status-endpoint.php";
$hostedPaymentData->merchantResponseUrl = "$baseUrl/examples/gp-ecom/hpp/response-endpoint.php";
$hostedPaymentData->presetPaymentMethods = [HostedPaymentMethods::CARDS, HostedPaymentMethods::OB, AlternativePaymentType::SOFORTUBERWEISUNG];
Expand Down Expand Up @@ -81,6 +82,13 @@
$hostedPaymentData->bankPayment = $bankPayment;

try {
/* in case you want to test also a verify request you can use the example below
$hppJson = $service->verify()
->withCurrency('EUR')
->withHostedPaymentData($hostedPaymentData)
->withAddress($billingAddress, AddressType::BILLING)
->serialize();
*/
$hppJson = $service->charge(19.99)
->withCurrency("EUR")
->withHostedPaymentData($hostedPaymentData)
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>11.0.6</releaseNumber>
<releaseNumber>11.0.7</releaseNumber>
</xml>
8 changes: 4 additions & 4 deletions src/Services/HostedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public function parseResponse($response, $encoded = false)

$response = $iterator->getArrayCopy();
}

if (!isset($response['MERCHANT_RESPONSE_URL'])) {
$isApm = isset($response['paymentmethod']) || isset($response['PAYMENTMETHOD']);
if (isset($response['fundsstatus'])) {
$response = $this->mapTransactionStatusResponse($response);
}

Expand All @@ -164,7 +164,7 @@ public function parseResponse($response, $encoded = false)
$result,
$message,
$transactionId,
!isset($response['MERCHANT_RESPONSE_URL']) ? $paymentMethod :$authCode
isset($response['TRANSACTION_STATUS']) ? $paymentMethod : $authCode
]),
$this->shaHashType
);
Expand All @@ -176,7 +176,7 @@ public function parseResponse($response, $encoded = false)
$ref = new TransactionReference();
$ref->authCode = $authCode;
$ref->orderId = $orderId;
$ref->paymentMethodType = !empty($response['PAYMENTMETHOD']) ? PaymentMethodType::APM : PaymentMethodType::CREDIT;
$ref->paymentMethodType = $isApm ? PaymentMethodType::APM : PaymentMethodType::CREDIT;
$ref->transactionId = $transactionId;

$trans = new Transaction();
Expand Down
3 changes: 3 additions & 0 deletions src/Terminals/DeviceMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public function toString()

public function getRequestField($key)
{
if (!is_array($this->jsonRequest)) {
return;
}
$value = null;
array_walk_recursive($this->jsonRequest, function ($item, $k) use ($key, &$value) {
if ($k === $key) {
Expand Down
4 changes: 3 additions & 1 deletion src/Terminals/TerminalUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ public static function buildUPAMessage($messageType, $requestId, $otherData = nu
array_push($buffer, chr(ControlCodes::ETX));
array_push($buffer, chr(ControlCodes::LF));

return new DeviceMessage($buffer);
$deviceMessage = new DeviceMessage($buffer);
$deviceMessage->setJsonRequest($requestMessage);
return $deviceMessage;
}
}
9 changes: 9 additions & 0 deletions test/Integration/Gateways/Terminals/UPA/UpaMicTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,13 @@ public function testCreditRefund_WithoutAmount()
$this->assertTrue($exceptionCaught);
}
}

public function testEndOfDay()
{
$response = $this->device->endOfDay();

$this->assertNotNull($response);
$this->assertEquals('00', $response->deviceResponseCode);
$this->assertEquals('INITIATED', $response->deviceResponseText);
}
}

0 comments on commit 1b82f7d

Please sign in to comment.