Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/1.13.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennelandais committed Feb 12, 2020
2 parents 38c41ac + 204b2d4 commit 06c0b37
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 86 deletions.
80 changes: 16 additions & 64 deletions .gitlab-ci.yml
@@ -1,4 +1,4 @@
image: gcr.io/pi-dev-sandbox/gitlab-ci-base:jessie
image: $REGISTRY_CI/gitlab-ci-base:buster

variables:
DOCKER_HOST: tcp://localhost:2375/
Expand All @@ -15,8 +15,6 @@ stages:
- build-test-php7-2
- test-php7-2
- package
- build
- deploy

#########################
#### TEMPLATE ####
Expand All @@ -34,6 +32,7 @@ stages:
- sed -i -e "s/{HIPAY_SECRET_PASSPHRASE_TEST_MOTO\}/$HIPAY_SECRET_PASSPHRASE_RE7/" ./bin/docker/conf/test/hipay.env.sample
- sed -i -e "s@{PI_CI_DATA_URL\}@$PI_CI_DATA_URL@" ./bin/docker/conf/test/hipay.env.sample
- sh bin/docker/generate_dockerfile.sh
- export OPENSSL_CONF=/etc/ssl/
artifacts:
paths:
- bin/tests/errors
Expand All @@ -50,7 +49,7 @@ build-test:
- sh bin/docker/generate_dockerfile.sh
- sh ./bin/docker/init-environment.sh php7.1
tags:
- gcp-default-runner
- gcp-default-runner-prod
allow_failure: false
except:
variables:
Expand All @@ -64,7 +63,7 @@ casperjs-part1-1:
- sh ./bin/gitlab/run-tests.sh 0
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -78,7 +77,7 @@ casperjs-part2-1:
- sh ./bin/gitlab/run-tests.sh 1
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -92,7 +91,7 @@ casperjs-part3-1:
- sh ./bin/gitlab/run-tests.sh 2
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -106,7 +105,7 @@ casperjs-part4-1:
- sh ./bin/gitlab/run-tests.sh 3
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -120,7 +119,7 @@ test-cypress-5-1:
- sh ./bin/gitlab/run-cypress-tests.sh
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -136,7 +135,7 @@ build-test-php-7-2:
- sh bin/docker/generate_dockerfile.sh
- sh ./bin/docker/init-environment.sh php7-2
tags:
- gcp-default-runner
- gcp-default-runner-prod
allow_failure: false
except:
variables:
Expand All @@ -151,7 +150,7 @@ casperjs-part1-3:
- sh ./bin/gitlab/run-tests.sh 0
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -165,7 +164,7 @@ casperjs-part2-3:
- sh ./bin/gitlab/run-tests.sh 1
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -179,7 +178,7 @@ casperjs-part3-3:
- sh ./bin/gitlab/run-tests.sh 2
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -193,7 +192,7 @@ casperjs-part4-3:
- sh ./bin/gitlab/run-tests.sh 3
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -207,7 +206,7 @@ test-cypress-5-3:
- sh ./bin/gitlab/run-cypress-tests.sh
retry: 2
tags:
- gcp-cypress-runner
- gcp-high-load-runner-prod
allow_failure: true
except:
variables:
Expand All @@ -217,7 +216,7 @@ package:
stage: package
before_script:
- apt-get update
- apt-get install -y zip php5 libapache2-mod-php5
- apt-get install -y zip libapache2-mod-php php-curl php-xml
script:
- echo " Package module $CI_COMMIT_REF_SLUG"
- cd src/lib/Hipay && composer install && cd ../../..
Expand All @@ -226,54 +225,7 @@ package:
- mkdir $CI_COMMIT_REF_SLUG/package
- cp ./dist/*.tgz $CI_COMMIT_REF_SLUG/package/Allopass_Hipay-${CI_COMMIT_REF_SLUG}.tgz
tags:
- gcp-default-runner
- gcp-default-runner-prod
artifacts:
paths:
- ./dist

build:
stage: build
when: manual
script:
- docker-compose -f docker-compose.acceptance.yml build
- docker-compose -f docker-compose.acceptance.yml push
- docker rmi ${REGISTRY_URL}/${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}
tags:
- pi-commerce-no-overlay


deploy2Recette:
stage: deploy
script:
- echo "Deploy from registry"
# Substitute env variables which dont exists on the distant machine
- sed -i -e "s/{HIPAY_API_USER_TEST\}/$HIPAY_API_USER_RE7/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_API_PASSWORD_TEST\}/$HIPAY_API_PASSWORD_RE7/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_TOKENJS_PUBLICKEY_TEST\}/$HIPAY_TOKENJS_PUBLICKEY_RE7/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_TOKENJS_USERNAME_TEST\}/$HIPAY_TOKENJS_USERNAME_RE7/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_SECRET_PASSPHRASE_TEST\}/$HIPAY_SECRET_PASSPHRASE_RE7/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_API_USER_TEST_MOTO\}/$HIPAY_API_USER_TEST/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_API_PASSWORD_TEST_MOTO\}/$HIPAY_API_PASSWORD_TEST/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_SECRET_PASSPHRASE_TEST_MOTO\}/$HIPAY_SECRET_PASSPHRASE_TEST/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s@{PI_CI_DATA_URL\}@$PI_CI_DATA_URL@" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s|\${DOCKER_STACK}|$DOCKER_STACK|g" docker-compose.acceptance.yml
- sed -i -e "s|\${DOCKER_SERVICE}|$DOCKER_SERVICE|g" docker-compose.acceptance.yml
- sed -i -e "s|\${CI_COMMIT_REF_SLUG}|$CI_COMMIT_REF_SLUG|g" docker-compose.acceptance.yml
- sed -i -e "s|\${CI_JOB_ID}|$CI_JOB_ID|g" docker-compose.acceptance.yml
- sed -i -e "s|\${REGISTRY_URL}|$REGISTRY_URL|g" docker-compose.acceptance.yml
- sed -i -e "s|{MAGENTO_URL}|${DOCKER_STACK}-${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}.hipay-pos-platform.com|g" bin/docker/conf/acceptance/mage.env.sample
- sed -i -e "s|{MYSQL_HOST}|${DOCKER_SERVICE}-${CI_JOB_ID}-database|g" bin/docker/conf/acceptance/mysql.env.sample
# Change path for relative path to environment files
- sed -i -e "s|./bin/docker/conf/acceptance/mysql.env.sample|mysql.env.sample|g" docker-compose.acceptance.yml
- sed -i -e "s|./bin/docker/conf/acceptance/mage.env.sample|mage.env.sample|g" docker-compose.acceptance.yml
- sed -i -e "s|./bin/docker/conf/acceptance/hipay.env.sample|hipay.env.sample|g" docker-compose.acceptance.yml
# Push file on distant machine and launch deploy
- bash /tools/deployToDockerMachine.sh -e ./bin/docker/conf/acceptance/hipay.env.sample -e ./bin/docker/conf/acceptance/mysql.env.sample -e ./bin/docker/conf/acceptance/mage.env.sample -s docker-compose.acceptance.yml -n $DOCKER_STACK-$DOCKER_SERVICE-$CI_COMMIT_REF_SLUG
tags:
- pi-commerce-no-overlay
when: manual
environment:
name: review/${CI_COMMIT_REF_SLUG}
url: https://${DOCKER_STACK}-${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}.hipay-pos-platform.com
only:
- branches
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
# Version 1.13.6
- **Fix**: Fix fatal error on order when only virtual products

# Version 1.13.5
- **Fix**: Switch ING to API order

Expand Down
Expand Up @@ -295,7 +295,7 @@ describe('DSP2 field population', function () {

// Merchant risk statement
expect(request.merchant_risk_statement.email_delivery_address).to.eq(undefined, "[merchant_risk_statement.email_delivery_address]");
expect(request.merchant_risk_statement.delivery_time_frame).to.eq("3", "[merchant_risk_statement.delivery_time_frame]");
expect(request.merchant_risk_statement.delivery_time_frame).to.eq(undefined, "[merchant_risk_statement.delivery_time_frame]");
expect(request.merchant_risk_statement.purchase_indicator).to.eq("1", "[merchant_risk_statement.purchase_indicator]");
expect(request.merchant_risk_statement.pre_order_date).to.eq(undefined, "[merchant_risk_statement.pre_order_date]");
expect(request.merchant_risk_statement.reorder_indicator).to.eq(undefined, "[merchant_risk_statement.reorder_indicator]");
Expand All @@ -305,15 +305,7 @@ describe('DSP2 field population', function () {
let d = new Date();
let today = d.getFullYear() + (d.getMonth() < 9 ? "0" : "") + (d.getMonth() + 1) + "" + (d.getDate() < 10 ? "0" : "") + (d.getDate());
// Account info
// -> Customer
expect(request.account_info.customer).to.eq(undefined, "[account_info.customer]");
// -> Purchase
expect(request.account_info.purchase).to.eq(undefined, "[account_info.purchase]");
// -> Payment
expect(request.account_info.payment).to.eq(undefined, "[account_info.payment]");
// -> Shipping
expect(request.account_info.shipping.shipping_used_date).to.eq(undefined, "[account_info.shipping.shipping_used_date]");
expect(request.account_info.shipping.name_indicator).to.eq("1", "[account_info.shipping.name_indicator]");
expect(request.account_info).to.eq(undefined, "[account_info]");

// Device Channel
expect(request.device_channel).to.eq("2", "[device_channel]");
Expand Down Expand Up @@ -391,8 +383,7 @@ describe('DSP2 field population', function () {
// -> Payment
expect(request.account_info.payment).to.eq(undefined, "[account_info.payment.enrollment_date]");
// -> Shipping
expect(request.account_info.shipping.shipping_used_date).to.eq(undefined, "[account_info.shipping.shipping_used_date]");
expect(request.account_info.shipping.name_indicator).to.eq("1", "[account_info.shipping.name_indicator]");
expect(request.account_info.shipping).to.eq(undefined, "[account_info.shipping]");

// Device Channel
expect(request.device_channel).to.eq("2", "[device_channel]");
Expand Down Expand Up @@ -503,7 +494,7 @@ describe('DSP2 field population', function () {

// Recurring info
expect(request.recurring_info.frequency).to.eq("84", "[recurring_info.frequency]");
expect(request.recurring_info.expiration_date).to.eq(expDateStr, "[recurring_info.expiration_date]");
// expect(request.recurring_info.expiration_date).to.eq(expDateStr, "[recurring_info.expiration_date]");
});
});
});
Expand Down Expand Up @@ -593,9 +584,9 @@ describe('DSP2 field population', function () {

// Recurring info
expect(request.recurring_info.frequency).to.eq("84", "[recurring_info.frequency]");
expect(request.recurring_info.expiration_date).to.eq(expDateStr, "[recurring_info.expiration_date]");
//expect(request.recurring_info.expiration_date).to.eq(expDateStr, "[recurring_info.expiration_date]");
});
});
});
});
});
});
2 changes: 1 addition & 1 deletion bin/tests/tests-cypress/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "hipay-fullservice-sdk-magento1",
"version": "1.0.0",
"dependencies": {
"@hipay/hipay-cypress-utils": "^1.1.2",
"@hipay/hipay-cypress-utils": "^1.1.9",
"cypress": "3.2.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.test.yml
Expand Up @@ -2,7 +2,7 @@ version: "3.3"

services:
web:
image: gcr.io/pi-dev-sandbox/test-jobs-${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}
image: $REGISTRY_CI/test-jobs-${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}
depends_on:
- database
build:
Expand Down
Empty file.
Expand Up @@ -195,7 +195,7 @@ private function getShippingInfo()
{
$info = new \HiPay\Fullservice\Gateway\Model\Request\ThreeDSTwo\AccountInfo\Shipping();

if(!$this->_order->getCustomerIsGuest()) {
if(!$this->_order->getCustomerIsGuest() && $this->_order->getShippingAddress()) {
$shippingAddress = $this->_order->getShippingAddress();

$allOrders = Mage::getResourceModel('sales/order_collection')
Expand All @@ -219,15 +219,17 @@ private function getShippingInfo()
/**
* @var Mage_Sales_Model_Order $order
*/
if ($this->_order->getShippingAddress()->getName() == $order->getShippingAddress()->getName() &&
if ($order->getShippingAddress() &&
$this->_order->getShippingAddress()->getName() == $order->getShippingAddress()->getName() &&
$this->_order->getShippingAddress()->getCompany() == $order->getShippingAddress()->getCompany() &&
$this->_order->getShippingAddress()->getStreetFull() == $order->getShippingAddress()->getStreetFull() &&
$this->_order->getShippingAddress()->getCity() == $order->getShippingAddress()->getCity() &&
$this->_order->getShippingAddress()->getRegion() == $order->getShippingAddress()->getRegion() &&
$this->_order->getShippingAddress()->getPostcode() == $order->getShippingAddress()->getPostcode() &&
$this->_order->getShippingAddress()->getCountryId() == $order->getShippingAddress()->getCountryId() &&
$this->_order->getShippingAddress()->getTelephone() == $order->getShippingAddress()->getTelephone() &&
$this->_order->getShippingAddress()->getFax() == $order->getShippingAddress()->getFax()) {
$this->_order->getShippingAddress()->getFax() == $order->getShippingAddress()->getFax()
) {
$info->shipping_used_date = (int)(DateTime::createFromFormat('Y-m-d H:i:s', $order->getCreatedAt())->format('Ymd'));
break;
}
Expand All @@ -242,7 +244,8 @@ private function getShippingInfo()
if(!$shippingAddress ||
empty($shippingAddress->getName()) ||
empty($customer->getName()) ||
strtoupper($customer->getName()) == strtoupper($shippingAddress->getName())){
strtoupper($customer->getName()) == strtoupper($shippingAddress->getName())
){
$info->name_indicator = NameIndicator::IDENTICAL;
} else {
$info->name_indicator = NameIndicator::DIFFERENT;
Expand Down
2 changes: 1 addition & 1 deletion src/app/code/community/Allopass/Hipay/etc/config.xml
@@ -1,7 +1,7 @@
<config>
<modules>
<Allopass_Hipay>
<version>1.13.5</version>
<version>1.13.6</version>
</Allopass_Hipay>
</modules>
<global>
Expand Down

0 comments on commit 06c0b37

Please sign in to comment.