Skip to content

Commit

Permalink
OctopusDeploy release: 11.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Jan 16, 2024
1 parent fdc738f commit c95384e
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 34 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.5 (01/09/24)
## Latest Version - v11.0.6 (01/16/24)
### Enhancements:
- [GP-API] Update QR code payment example for WeChat

#### Bug Fixes:
[GP-ECOM] Fix parseResponse on HostedService when TIMESTAMP is not returned from API

## v11.0.5 (01/09/24)
#### Bug Fixes:
- [Portico] Fixed null CustomerData exception
- [A35_PAX] Fixed long transaction processing times
Expand Down
6 changes: 3 additions & 3 deletions examples/gp-api/alipay/GenerateToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

class GenerateToken
{
const APP_ID = 'QzFNaCAVCSH4tELLYz5iReERAJ3mqHu7';
const APP_KEY = '0QCyAwox3nRufZhX';
const ACCOUNT_ID = 'TRA_c7fdc03bc9354fd3b674dddb22583553';
const APP_ID = 'bvKLJsu6vYC9zxX2BpOgNK95kbboP3Uw';
const APP_KEY = '7aH9QlA3yVFwpESQ';
const ACCOUNT_ID = 'TRA_1366cd0db8c14fffb130ab49be84d944';

private static $instance = null;
private string $accessToken;
Expand Down
24 changes: 14 additions & 10 deletions examples/gp-api/alipay/initiatePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
require_once('GenerateToken.php');

use GlobalPayments\Api\Entities\Enums\AlternativePaymentType;
use GlobalPayments\Api\Entities\Enums\Environment;
use GlobalPayments\Api\Entities\Enums\Channel;
use GlobalPayments\Api\Entities\Enums\MerchantCategory;
use GlobalPayments\Api\Entities\Exceptions\ApiException;
Expand All @@ -15,24 +14,29 @@
use GlobalPayments\Api\Utils\Logging\Logger;
use GlobalPayments\Api\Entities\GpApi\AccessTokenInfo;

$decodedData = json_decode(file_get_contents('php://input'));
$provider = $decodedData->provider;
$provider = $_GET['provider'] ?? '';

if ($provider === 'WeChat') {
$provider = AlternativePaymentType::WECHAT_PAY;
} else {
$provider = strtolower($provider);
}

// configure client & request settings
$config = new GpApiConfig();
$config->appId = GenerateToken::APP_ID;
$config->appKey = GenerateToken::APP_KEY;
$config->environment = Environment::TEST;
$config->channel = Channel::CardNotPresent;
$config->country = 'HK';
$config->accessTokenInfo = new AccessTokenInfo();
$config->accessTokenInfo->transactionProcessingAccountID = GenerateToken::ACCOUNT_ID;
$config->requestLogger = new SampleRequestLogger(new Logger("logs"));
ServicesContainer::configureService($config);

$paymentMethod = new AlternativePaymentMethod(AlternativePaymentType::ALIPAY);
$paymentMethod = new AlternativePaymentMethod($provider);
$paymentMethod->returnUrl = $_SERVER['HTTP_ORIGIN'] . '/examples/gp-api/alipay/returnUrl';
$paymentMethod->statusUpdateUrl = $_SERVER['HTTP_ORIGIN'] . '/examples/gp-api/alipay/returnUrl';
$paymentMethod->country = 'US';
$paymentMethod->country = 'HK';
$paymentMethod->accountHolderName = 'Jane Doe';

try {
Expand All @@ -48,10 +52,10 @@
// simple example of how to prepare the JSON string for JavaScript Library
$responseJson = array(
"seconds_to_expire" => $response->alternativePaymentResponse->secondsToExpire ?? '120',
"next_action" => $response->alternativePaymentResponse->nextAction,
"redirect_url" => $response->alternativePaymentResponse->redirectUrl,
"qr_code" => $response->alternativePaymentResponse->qrCodeImage,
"provider" => $response->alternativePaymentResponse->providerName
"next_action" => $response->alternativePaymentResponse->nextAction ?? '',
"redirect_url" => $response->alternativePaymentResponse->redirectUrl ?? '',
"qr_code" => $response->alternativePaymentResponse->qrCodeImage ?? '',
"provider" => $response->alternativePaymentResponse->providerName ?? ''
);

echo json_encode($responseJson);
4 changes: 3 additions & 1 deletion examples/gp-api/alipay/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GlobalPayments.configure({
const cardForm = GlobalPayments.creditCard.form(
'#credit-card',
{
amount: "20",
style: "gp-default",
apms: [
GlobalPayments.enums.Apm.QRCodePayments,
Expand All @@ -39,6 +40,7 @@ cardForm.on(GlobalPayments.enums.QRCodePaymentsMerchantInteractionEvents.Payment
});
window.dispatchEvent(merchantCustomEventProvideDetails);
}
xmlhttp.open("GET", "initiatePayment.php?q=" + provider);

xmlhttp.open("GET", "initiatePayment.php?provider=" + provider);
xmlhttp.send();
});
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.5</releaseNumber>
<releaseNumber>11.0.6</releaseNumber>
</xml>
2 changes: 1 addition & 1 deletion src/Mapping/GpApiMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ public static function mapResponseAPM($response)
if (is_string($paymentMethodApm->provider)) {
$apm->providerName = $paymentMethodApm->provider;
} elseif (is_object($paymentMethodApm->provider)) {
$apm->providerName = strtolower($paymentMethodApm->provider->name) ?? null;
$apm->providerName = $paymentMethodApm->provider->name ?? null;
$apm->providerReference = $paymentMethodApm->provider->merchant_identifier ?? null;
$apm->timeCreatedReference = $paymentMethodApm->provider->time_created_reference ?? null;
}
Expand Down
34 changes: 17 additions & 17 deletions src/Services/HostedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,23 @@ public function void($transaction = null)
private function mapTransactionStatusResponse($response) : array
{
return [
'ACCOUNT_HOLDER_NAME' => $response['accountholdername'],
'ACCOUNT_NUMBER' => $response['accountnumber'],
'TIMESTAMP' => $response['timestamp'],
'MERCHANT_ID' => $response['merchantid'],
'BANK_CODE' => $response['bankcode'],
'BANK_NAME' => $response['bankname'],
'HPP_CUSTOMER_BIC' => $response['bic'],
'COUNTRY' => $response['country'],
'HPP_CUSTOMER_EMAIL' => $response['customeremail'],
'TRANSACTION_STATUS' => $response['fundsstatus'],
'IBAN' => $response['iban'],
'MESSAGE' => $response['message'],
'ORDER_ID' => $response['orderid'],
'PASREF' => $response['pasref'],
'PAYMENTMETHOD' => $response['paymentmethod'],
'PAYMENT_PURPOSE' => $response['paymentpurpose'],
'RESULT' => $response['result'],
'ACCOUNT_HOLDER_NAME' => $response['accountholdername'] ?? '',
'ACCOUNT_NUMBER' => $response['accountnumber'] ?? '',
'TIMESTAMP' => $response['timestamp'] ?? '',
'MERCHANT_ID' => $response['merchantid'] ?? '',
'BANK_CODE' => $response['bankcode'] ?? '',
'BANK_NAME' => $response['bankname'] ?? '',
'HPP_CUSTOMER_BIC' => $response['bic'] ?? '',
'COUNTRY' => $response['country'] ?? '',
'HPP_CUSTOMER_EMAIL' => $response['customeremail'] ?? '',
'TRANSACTION_STATUS' => $response['fundsstatus'] ?? '',
'IBAN' => $response['iban'] ?? '',
'MESSAGE' => $response['message'] ?? '',
'ORDER_ID' => $response['orderid'] ?? '',
'PASREF' => $response['pasref'] ?? '',
'PAYMENTMETHOD' => $response['paymentmethod'] ?? '',
'PAYMENT_PURPOSE' => $response['paymentpurpose'] ?? '',
'RESULT' => $response['result'] ?? '',
$this->shaHashType . "HASH" => $response[strtolower($this->shaHashType).'hash']
];
}
Expand Down

0 comments on commit c95384e

Please sign in to comment.