Skip to content

Commit

Permalink
Merge branch 'release/2.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennelandais committed Sep 3, 2019
2 parents 44bbcc2 + e651dc4 commit 9275c90
Show file tree
Hide file tree
Showing 66 changed files with 3,049 additions and 1,197 deletions.
20 changes: 6 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ stages:
- package
- build
- deploy
- sync

variables:
PROJECT_NAME_TEST_PS17_1: ${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}-17-1
Expand All @@ -32,6 +31,7 @@ variables:
- sed -i -e "s/{HIPAY_TOKENJS_USERNAME_TEST\}/$HIPAY_TOKENJS_USERNAME_TEST/" ./bin/docker/conf/test/env
- sed -i -e "s/{HIPAY_SECRET_PASSPHRASE_TEST\}/$HIPAY_SECRET_PASSPHRASE_TEST/" ./bin/docker/conf/test/env
- sed -i "s/$(echo {HIPAY_SECRET_PASSPHRASE_TEST} | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/$(echo '$HIPAY_SECRET_PASSPHRASE_TEST' | sed -e 's/[\/&]/\\&/g')/g" ./bin/docker/conf/test/env
- sed -i -e "s@{PI_CI_DATA_URL\}@$PI_CI_DATA_URL@" ./bin/docker/conf/test/env
artifacts:
paths:
- bin/tests/errors
Expand All @@ -58,7 +58,7 @@ test-casper-17-1:
- docker-compose -p $PROJECT_NAME_TEST_PS17_1 -f docker-compose.test.yml stop
- docker-compose -p $PROJECT_NAME_TEST_PS17_1 -f docker-compose.test.yml rm -fv
- docker-compose -p $PROJECT_NAME_TEST_PS17_1 -f docker-compose.test.yml up -d
- sleep 300
- until docker-compose -p $PROJECT_NAME_TEST_PS17_1 -f docker-compose.test.yml logs | grep -m 1 "DOCKER PRESTASHOP TO HIPAY stage IS UP" ; do sleep 1 ; done
- docker-compose -p $PROJECT_NAME_TEST_PS17_1 -f docker-compose.test.yml logs
- curl --retry 10 --retry-delay 20 -v http:\/\/${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}-web/
- sh bin/tests/casper_run_circle.sh 0 ps17 http:\/\/${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}-web/
Expand All @@ -75,7 +75,7 @@ test-casper-17-2:
- docker-compose -p $PROJECT_NAME_TEST_PS17_2 -f docker-compose.test.yml stop
- docker-compose -p $PROJECT_NAME_TEST_PS17_2 -f docker-compose.test.yml rm -fv
- docker-compose -p $PROJECT_NAME_TEST_PS17_2 -f docker-compose.test.yml up -d
- sleep 300
- until docker-compose -p $PROJECT_NAME_TEST_PS17_2 -f docker-compose.test.yml logs | grep -m 1 "DOCKER PRESTASHOP TO HIPAY stage IS UP" ; do sleep 1 ; done
- docker-compose -p $PROJECT_NAME_TEST_PS17_2 -f docker-compose.test.yml logs
- curl --retry 10 --retry-delay 20 -v http:\/\/${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}-web/
- sh bin/tests/casper_run_circle.sh 1 ps17 http:\/\/${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}-web/
Expand All @@ -93,7 +93,7 @@ test-cypress-17-1:
- docker-compose -p $PROJECT_NAME_TEST_PS17_3 -f docker-compose.test.yml stop
- docker-compose -p $PROJECT_NAME_TEST_PS17_3 -f docker-compose.test.yml rm -fv
- docker-compose -p $PROJECT_NAME_TEST_PS17_3 -f docker-compose.test.yml up -d
- sleep 300
- until docker-compose -p $PROJECT_NAME_TEST_PS17_3 -f docker-compose.test.yml logs | grep -m 1 "DOCKER PRESTASHOP TO HIPAY stage IS UP" ; do sleep 1 ; done
- docker-compose -p $PROJECT_NAME_TEST_PS17_3 -f docker-compose.test.yml logs
- curl --retry 10 --retry-delay 20 -v http:\/\/${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}-web/
- cd bin/tests/tests-cypress
Expand Down Expand Up @@ -182,6 +182,8 @@ deploy2recette:
- sed -i -e "s/{PS_DOMAIN\}/${DOCKER_STACK}-${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}-16.hipay-pos-platform.com/" ./bin/docker/conf/acceptance/env16
- sed -i -e "s/{PS_DOMAIN\}/${DOCKER_STACK}-${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}-17.hipay-pos-platform.com/" ./bin/docker/conf/acceptance/env17
- sed -i "s/$(echo {HIPAY_SECRET_PASSPHRASE_RECETTE} | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/$(echo '$HIPAY_SECRET_PASSPHRASE_RE7' | sed -e 's/[\/&]/\\&/g')/g" ./bin/docker/conf/acceptance/env
- sed -i -e "s@{PI_CI_DATA_URL\}@$PI_CI_DATA_URL@" ./bin/docker/conf/acceptance/env

# Substitute env variables which doesn't exists on the distant machine
- /tools/substitute-env-var.sh docker-compose.acceptance.yml
# Change path for relative path to environment files
Expand All @@ -193,13 +195,3 @@ deploy2recette:
allow_failure: true
tags:
- pi-commerce-no-overlay

sync:
stage: sync
script:
- git clone --mirror https://$GITLAB_USER:[email protected]/pi-ecommerce/hipay-enterprise-sdk-prestashop.git
- cd hipay-enterprise-sdk-prestashop.git
- git push --mirror https://$GITHUB_USER:[email protected]/hipay/hipay-enterprise-sdk-prestashop.git
allow_failure: true
tags:
- pi-commerce-no-overlay
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 2.8.0

- Added 3DSv2 handling

# Version 2.7.1

- Get payment method configuration from PHP SDK
Expand Down
5 changes: 5 additions & 0 deletions bin/docker/conf/acceptance/env
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ HIPAY_API_PASSWORD_TEST={HIPAY_API_PASSWORD_RECETTE}
HIPAY_TOKENJS_PUBLICKEY_TEST={HIPAY_TOKENJS_PUBLICKEY_RECETTE}
HIPAY_TOKENJS_USERNAME_TEST={HIPAY_TOKENJS_USERNAME_RECETTE}
HIPAY_SECRET_PASSPHRASE_TEST={HIPAY_SECRET_PASSPHRASE_RECETTE}

#====================================================
# Configuration PI DATA URL
#=====================================================
PI_DATA_URL={PI_CI_DATA_URL}
5 changes: 5 additions & 0 deletions bin/docker/conf/development/env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ HIPAY_API_PASSWORD_TEST=
HIPAY_TOKENJS_PUBLICKEY_TEST=
HIPAY_TOKENJS_USERNAME_TEST=
HIPAY_SECRET_PASSPHRASE_TEST=

#====================================================
# Configuration PI DATA URL
#=====================================================
PI_DATA_URL=
5 changes: 5 additions & 0 deletions bin/docker/conf/test/env
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ HIPAY_API_PASSWORD_TEST={HIPAY_API_PASSWORD_TEST}
HIPAY_TOKENJS_PUBLICKEY_TEST={HIPAY_TOKENJS_PUBLICKEY_TEST}
HIPAY_TOKENJS_USERNAME_TEST={HIPAY_TOKENJS_USERNAME_TEST}
HIPAY_SECRET_PASSPHRASE_TEST={HIPAY_SECRET_PASSPHRASE_TEST}

#====================================================
# Configuration PI DATA URL
#=====================================================
PI_DATA_URL={PI_CI_DATA_URL}
16 changes: 13 additions & 3 deletions bin/docker/images/prestashop/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ if [ ! -f /var/www/html/prestashopConsole.phar ];then
printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
printf "\n${COLOR_SUCCESS} INSTALLATION SDK PHP ${NC}\n"
printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
cd /var/www/html/modules/hipay_enterprise/ \
&& composer install --no-dev
cd /var/www/html/modules/hipay_enterprise/

cp composer.json composer.json.bak
cat composer.json.bak | python -c "import sys, json; composerObj=json.load(sys.stdin); composerObj['scripts'] = {'post-install-cmd': ['@managePiDataURLDev'], 'post-update-cmd': ['@managePiDataURLDev'], 'managePiDataURLDev': [\"sed -i 's@https://stage-data.hipay.com@"$PI_DATA_URL"@g' lib/vendor/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/HTTP/Configuration/Configuration.php\", \"sed -i 's@https://data.hipay.com@"$PI_DATA_URL"@g' lib/vendor/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/HTTP/Configuration/Configuration.php\"]}; print json.dumps(composerObj, False, True, True, True, None, 2);" > composer.json
rm composer.json.bak

composer install --no-dev

printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
printf "\n${COLOR_SUCCESS} INSTALLATION PRESTASHOP CONSOLE ${NC}\n"
Expand Down Expand Up @@ -103,7 +108,12 @@ fi
chown -R www-data:www-data /var/www/html
chmod -R $MOD_DROITS /var/www/html


printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
printf "\n${COLOR_SUCCESS} HOSTS CONGIGURATION ${NC}\n"
printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
cp /etc/hosts ~/hosts.bak
sed -i 's/^127\.0\.0\.1\s*localhost/127.0.0.1 localhost data.hipay.com stage-data.hipay.com/g' ~/hosts.bak
cp ~/hosts.bak /etc/hosts

#===================================#
# START WEBSERVER
Expand Down
3 changes: 2 additions & 1 deletion bin/tests/Modules/17/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ exports.personalInformation = function personalInformation(test) {
'input[name="id_gender"]': 'true',
'input[name="firstname"]': 'TEST',
'input[name="lastname"]': 'TEST',
'input[name="email"]': '[email protected]'
'input[name="email"]': '[email protected]',
'input[name="psgdpr"]': 'true'
}, false);
this.click("section#checkout-personal-information-step footer.form-footer button.continue");
this.echo("Done", "COMMENT");
Expand Down
7 changes: 4 additions & 3 deletions bin/tests/tests-cypress/cypress/fixtures/order.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"lastOrderId": "16",
"lastOrderCartId": "24",
"lastCapturedOrderId": "66"
"lastOrderId": "7",
"lastOrderCartId": "7",
"lastCapturedOrderId": "66",
"lastTransactionId": "800004136891"
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Update notification box', function () {
.should('be.visible')
.should(($div) => {
const text = $div.text();
expect(text).to.match(/^(\s*)Une nouvelle version du module HiPay Enterprise est disponible\.(\s*)Voir les détails de la version 2\.7\.0(\s*)ou(\s*)mettre à jour\.(\s*)$/);
expect(text).to.match(/^(\s*)Une nouvelle version du module HiPay Enterprise est disponible\.(\s*)Voir les détails de la version [0-9]+\.[0-9]+\.[0-9]+(\s*)ou(\s*)mettre à jour\.(\s*)$/);
});
cy.adminLogOut();
});
Expand All @@ -43,7 +43,7 @@ describe('Update notification box', function () {
.should('have.class', 'alert-danger')
.should(($div) => {
const text = $div.text();
expect(text).to.match(/^(\s*)Une nouvelle version du module HiPay Enterprise est disponible\.(\s*)Voir les détails de la version 2\.7\.0(\s*)ou(\s*)mettre à jour\.(\s*)$/);
expect(text).to.match(/^(\s*)Une nouvelle version du module HiPay Enterprise est disponible\.(\s*)Voir les détails de la version [0-9]+\.[0-9]+\.[0-9]+(\s*)ou(\s*)mettre à jour\.(\s*)$/);
});
cy.adminLogOut();
});
Expand Down
Loading

0 comments on commit 9275c90

Please sign in to comment.