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.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jprotin committed Dec 12, 2016
2 parents cf52b3b + 3a356c4 commit 8dc4145
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Version 1.5.0
New - Add a custom_data management
New - Add a device fingerprint for Direct POST
New - Add a specific success page management

# Version 1.4.0
New - Repository with Docker for tests
New - Direct POST with token javascript
Expand Down
29 changes: 29 additions & 0 deletions custom/CustomData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* This custom class must be placed in the folder /AlloPass/Hipay/Helper
* You have to personalize the method getCustomData and return an json of your choice.
*
*/
class Allopass_Hipay_Helper_CustomData extends Mage_Core_Helper_Abstract
{
/**
* Return yours customs datas in a array for gateway transaction request
*
* @param array $payment
* @param float $amount
*
*/
public function getCustomData($payment,$amount)
{
$customData = array();

// An example of adding custom data
if ($payment)
{
$customData['my_field_custom_1'] = $payment->getOrder()->getBaseCurrencyCode();
}

return $customData;
}
}
3 changes: 2 additions & 1 deletion src/app/code/community/Allopass/Hipay/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,9 @@ public function is3dSecure($use3dSecure, $config3dsRules, $payment = false)
* @return string
*/
public function getCheckoutSuccessPage($payment) {
// if empty success page magento
return empty(Mage::getStoreConfig('payment/'.$payment->getMethod().'/success_redirect_page')) ?
'checkout/onepage/success' :
Mage::getUrl('checkout/onepage/success') :
Mage::getStoreConfig('payment/'.$payment->getMethod().'/success_redirect_page');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ public function getGatewayParams($payment,$amount,$token=null)
$params['cdata1'] = Mage::getUrl('adminhtml/sales_order/view',array('_secure'=>true,'order_id'=>$payment->getOrder()->getId()));

// Add custom data for transaction request
if(class_exists('Allopass_Hipay_Helper_CustomData') &&
if(class_exists('Allopass_Hipay_Helper_CustomData',false) &&
method_exists(Mage::helper('hipay/customData'),'getCustomData'))
{
$customData = Mage::helper('hipay/customData')->getCustomData($payment,$amount);
Expand Down
2 changes: 1 addition & 1 deletion src/app/code/community/Allopass/Hipay/etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<config>
<modules>
<Allopass_Hipay>
<version>1.4.0</version>
<version>1.5.0</version>
</Allopass_Hipay>
</modules>
<global>
Expand Down

0 comments on commit 8dc4145

Please sign in to comment.