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

Commit

Permalink
Merge branch 'release/1.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennelandais committed Jun 13, 2018
2 parents 6dce511 + 023929b commit 8cd8eb9
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 69 deletions.
79 changes: 45 additions & 34 deletions .gitlab-ci.yml
Expand Up @@ -2,34 +2,35 @@ image: hipay/gitlab-ci-base:jessie


stages:
- build
- analysis
- package
- deploy
- sync
- build
- analysis
- package
- deploy
- sync


casperjs-part1:
stage: build
before_script:
- sh bin/docker/generate_dockerfile.sh
- sed -i -e "s/{HIPAY_API_USER_TEST\}/$HIPAY_API_USER_TEST/" ./bin/conf/stage/hipay.env.sample
- sed -i -e "s/{HIPAY_API_PASSWORD_TEST\}/$HIPAY_API_PASSWORD_TEST/" ./bin/conf/stage/hipay.env.sample
- sed -i -e "s/{HIPAY_TOKENJS_PUBLICKEY_TEST\}/$HIPAY_TOKENJS_PUBLICKEY_TEST/" ./bin/conf/stage/hipay.env.sample
- sed -i -e "s/{HIPAY_TOKENJS_USERNAME_TEST\}/$HIPAY_TOKENJS_USERNAME_TEST/" ./bin/conf/stage/hipay.env.sample
- sed -i -e "s/{HIPAY_SECRET_PASSPHRASE_TEST\}/$HIPAY_SECRET_PASSPHRASE_TEST/" ./bin/conf/stage/hipay.env.sample
- sh ./bin/docker/init-environment.sh php5.6
- sleep 400
- docker-compose -f docker-compose.yml -f docker-compose.stage.yml logs
- curl --retry 10 --retry-delay 20 -v http://magento
- sh bin/docker/generate_dockerfile.sh
- sed -i -e "s/{HIPAY_API_USER_TEST\}/$HIPAY_API_USER_TEST/" ./bin/conf/stage/hipay.env.sample
- sed -i -e "s/{HIPAY_API_PASSWORD_TEST\}/$HIPAY_API_PASSWORD_TEST/" ./bin/conf/stage/hipay.env.sample
- sed -i -e "s/{HIPAY_TOKENJS_PUBLICKEY_TEST\}/$HIPAY_TOKENJS_PUBLICKEY_TEST/" ./bin/conf/stage/hipay.env.sample
- sed -i -e "s/{HIPAY_TOKENJS_USERNAME_TEST\}/$HIPAY_TOKENJS_USERNAME_TEST/" ./bin/conf/stage/hipay.env.sample
- sed -i -e "s/{HIPAY_SECRET_PASSPHRASE_TEST\}/$HIPAY_SECRET_PASSPHRASE_TEST/" ./bin/conf/stage/hipay.env.sample
- sh ./bin/docker/init-environment.sh php5.6
- sleep 400
- docker-compose -f docker-compose.yml -f docker-compose.stage.yml logs
- curl --retry 10 --retry-delay 20 -v http://magento
script:
- sh bin/tests/casper_run_circle.sh http://magento
- sh bin/tests/casper_run_circle.sh http://magento
tags:
- magento1
- magento1
allow_failure: false
artifacts:
paths:
- bin/tests/errors
when: always
after_script:
- docker-compose -f docker-compose.yml -f docker-compose.stage.yml stop
- docker-compose -f docker-compose.yml -f docker-compose.stage.yml rm -fv
Expand All @@ -42,7 +43,9 @@ sonarqube:
SONAR_ANALYSIS_MODE: preview
SONAR_TOKEN: $SONAR_LOGIN
script:
- /usr/bin/sonar-scanner-run.sh
- /usr/bin/sonar-scanner-run.sh
tags:
- magento1

sonarqube-reports:
stage: analysis
Expand All @@ -52,35 +55,43 @@ sonarqube-reports:
SONAR_ANALYSIS_MODE: "publish"
SONAR_TOKEN: $SONAR_LOGIN
script:
- unset CI_BUILD_REF && /usr/bin/sonar-scanner-run.sh
- unset CI_BUILD_REF && /usr/bin/sonar-scanner-run.sh
tags:
- magento1

package:
stage: package
before_script:
- apt-get update
- apt-get install -y zip sshpass php5 libapache2-mod-php5
- curl -sS https://getcomposer.org/installer | php -- --filename=composer -- --install-dir=/usr/local/bin
- apt-get update
- apt-get install -y zip sshpass php5 libapache2-mod-php5
- curl -sS https://getcomposer.org/installer | php -- --filename=composer -- --install-dir=/usr/local/bin
script:
- echo " Package module $CI_COMMIT_REF_SLUG"
- cd src/lib/Hipay && composer install && cd ../../..
- rm -Rf ./vendor && cp ./composer.json.dist ./composer.json && composer install && sh ./bin/deployment/packaging.sh
- mkdir $CI_COMMIT_REF_SLUG
- mkdir $CI_COMMIT_REF_SLUG/package
- cp ./dist/*.tgz $CI_COMMIT_REF_SLUG/package
- ./bin/deployment/deploy_project.sh
- echo " Package module $CI_COMMIT_REF_SLUG"
- cd src/lib/Hipay && composer install && cd ../../..
- rm -Rf ./vendor && cp ./composer.json.dist ./composer.json && composer install && sh ./bin/deployment/packaging.sh
- mkdir $CI_COMMIT_REF_SLUG
- mkdir $CI_COMMIT_REF_SLUG/package
- cp ./dist/*.tgz $CI_COMMIT_REF_SLUG/package
- ./bin/deployment/deploy_project.sh
tags:
- magento1
artifacts:
paths:
- ./dist
- ./dist

deploy:
stage: deploy
tags:
- magento1
script:
- docker exec deploy.hipay-pos-platform.com /deploy/deploy_project.sh $CI_PROJECT_NAME $CI_COMMIT_REF_NAME gitlab
- docker exec deploy.hipay-pos-platform.com /deploy/deploy_project.sh $CI_PROJECT_NAME $CI_COMMIT_REF_NAME gitlab

sync:
stage: sync
tags:
- magento1
script:
- git clone --mirror https://$GITLAB_USER:$GITLAB_PASSWORD@gitlab.hipay.org/pi-ecommerce/hipay-fullservice-sdk-magento1.git
- cd hipay-fullservice-sdk-magento1.git
- git push --mirror https://$GITHUB_USER:$GITHUB_PASSWORD@github.com/hipay/hipay-fullservice-sdk-magento1.git
- git clone --mirror https://$GITLAB_USER:$GITLAB_PASSWORD@gitlab.hipay.org/pi-ecommerce/hipay-fullservice-sdk-magento1.git
- cd hipay-fullservice-sdk-magento1.git
- git push --mirror https://$GITHUB_USER:$GITHUB_PASSWORD@github.com/hipay/hipay-fullservice-sdk-magento1.git
allow_failure: true
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
# Version 1.9.1

- Fix : no transaction reference on 118
- Fix : split payment bug

# Version 1.9.0

- Add support for Oney credit long payment method
Expand Down
Expand Up @@ -15,16 +15,15 @@ casper.test.begin('Send Notification to Magento from TPP BackOffice via ' + paym
test.assertExists(x('//div[@id="order_history_block"]/ul/li[contains(., "Notification from Hipay: status: code-' + status + '")][position()=last()]'), "Notification " + status + " captured !");
var operation = this.fetchText(x('//div[@id="order_history_block"]/ul/li[contains(., "Notification from Hipay: status: code-' + status + '")][position()=last()]/preceding-sibling::li[position()=1]'));
operation = operation.split('\n')[4].split('.')[0].trim();
if(status != 118)
test.assertNotEquals(operation.indexOf('successful'), -1, "Successful operation !");
else
test.assertNotEquals(operation.indexOf('accepted'), -1, "Successful operation !");
test.assertNotEquals(operation.indexOf('successful'), -1, "Successful operation !");
} catch(e) {
if(String(e).indexOf('operation') != -1)
if(String(e).indexOf('operation') != -1){
test.fail("Failure on status operation: '" + operation + "'");
else
if(status != 117)
}else{
if(status != 117){
test.fail("Failure: Notification " + status + " not exists");
}
}
}
};

Expand Down
Expand Up @@ -34,6 +34,7 @@ casper.test.begin('Change Hash Algorithm ' + paymentType + ' with ' + typeCC, fu
.then(function() {
this.echo("Synchronize Hashing Algorithm", "INFO");
this.waitForSelector('button#synchronize_button', function success() {
this.click("#hipay_hipay_hash_algorithm-head");
var current = this.evaluate(function () {
return document.querySelector('select#hipay_hipay_hash_algorithm_test').value;
});
Expand Down
7 changes: 4 additions & 3 deletions bin/tests/012_GIROPAY/1_frontend/1200-GIROPAY_FRONTEND.js
Expand Up @@ -57,8 +57,9 @@ casper.test.begin('Test Checkout ' + paymentType + ' with ' + typeCC, function(t
this.waitForSelector('input[name="weiterButton"]', function success() {
this.click('input[name="weiterButton"]');
this.waitForSelector('input[name="BezahlButton"]', function success() {
this.sendKeys('input[name="ticket/tan"]', "123456");
this.click('input[name="BezahlButton"]');
this.fillSelectors("form:first-of-type", {
'input[name="ticket/tan"]': "123456"
}, true);
test.info("TAN code inserted");
this.waitForSelector('input[name="back2MerchantButton"]', function success() {
this.click('input[name="back2MerchantButton"]');
Expand All @@ -85,4 +86,4 @@ casper.test.begin('Test Checkout ' + paymentType + ' with ' + typeCC, function(t
.run(function() {
test.done();
});
});
});
3 changes: 1 addition & 2 deletions circle.yml
Expand Up @@ -13,8 +13,7 @@ dependencies:
- sh bin/docker/generate_dockerfile.sh
test:
override:
- case $CIRCLE_NODE_INDEX in 0) sh ./bin/docker/init-environment.circle.sh php5.6 ;; 1) sh ./bin/docker/init-environment.circle.sh php7-0 ;; 2) sh ./bin/docker/init-environment.circle.sh php5.6 1.8.0.0 1.6_1.8 ;; esac:
parallel: true
- sh ./bin/docker/init-environment.circle.sh php7-0
- sleep 60
- curl --retry 30 --retry-delay 3 -v $MAGENTO_URL:$PORT_WEB

2 changes: 1 addition & 1 deletion magento.sh
Expand Up @@ -103,4 +103,4 @@ elif [ "$1" = "notif" ]; then

else
echo "Incorrect argument ! Please check the HiPay's Helper via the following command : 'sh magento.sh' or 'sh magento.sh --help'"
fi
fi
2 changes: 1 addition & 1 deletion sonar-project.properties
Expand Up @@ -2,7 +2,7 @@
sonar.projectKey=hipay-fullservice-sdk-magento1
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=HiPay Fullservice extension for Magento v1
sonar.projectVersion=1.9.0
sonar.projectVersion=1.9.1

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
Expand Down
10 changes: 4 additions & 6 deletions src/app/code/community/Allopass/Hipay/Helper/Data.php
Expand Up @@ -316,8 +316,6 @@ private function addItem($product, $action, $products = null)

return $item;
}


}

/**
Expand Down Expand Up @@ -549,7 +547,7 @@ public function insertSplitPayment($order, $profile, $customerId, $cardToken)
public function splitPaymentsExists($orderId)
{
$collection = Mage::getModel('hipay/splitPayment')->getCollection()->addFieldToFilter('order_id', $orderId);
if (!$collection->empty()) {
if (!$collection->getSize()) {
return true;
}

Expand Down Expand Up @@ -1374,12 +1372,12 @@ public function getMappingShipping($codeShippingMethod, $storeId = null)
* @param $mapping
* @return string
*/
function calculateEstimatedDate($mapping)
public function calculateEstimatedDate($mapping)
{
if (is_array($mapping)) {
$today = new \Datetime();
$daysDelay = $mapping['delay_preparation'] + $mapping['delay_delivery'];
$interval = new \DateInterval ("P{$daysDelay}D");
$interval = new \DateInterval("P{$daysDelay}D");
return $today->add($interval)->format("Y-m-d");
}

Expand All @@ -1392,7 +1390,7 @@ function calculateEstimatedDate($mapping)
* @param $mapping array Result of mapping
* @return null|string JSON
*/
function calculateDeliveryMethod($mapping)
public function calculateDeliveryMethod($mapping)
{
if (is_array($mapping)) {
$itemsDelivery = Mage::helper('hipay/collection')->getFullItemsDelivery();
Expand Down
28 changes: 14 additions & 14 deletions src/app/code/community/Allopass/Hipay/Model/Method/Abstract.php
Expand Up @@ -564,20 +564,6 @@ public function processResponse($gatewayResponse, $payment, $amount)
break;
}

$this->addTransaction(
$payment,
$gatewayResponse->getTransactionReference(),
Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
array('is_transaction_closed' => 0),
array(),
Mage::helper('hipay')->getTransactionMessage(
$payment,
self::OPERATION_SALE,
null,
$amount
)
);

$message = Mage::helper("hipay")->__('Capture Requested by Hipay.');

/** @noinspection PhpMethodParametersCountMismatchInspection */
Expand Down Expand Up @@ -613,6 +599,20 @@ public function processResponse($gatewayResponse, $payment, $amount)
break;
}

$this->addTransaction(
$payment,
$gatewayResponse->getTransactionReference(),
Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE,
array('is_transaction_closed' => 0),
array(),
Mage::helper('hipay')->getTransactionMessage(
$payment,
self::OPERATION_SALE,
null,
$amount
)
);

/**
* If status Capture Requested is configured to validate the order and is a direct capture
* notification (118), we break because order is already validate.
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.9.0</version>
<version>1.9.1</version>
</Allopass_Hipay>
</modules>
<global>
Expand Down

0 comments on commit 8cd8eb9

Please sign in to comment.