Skip to content

Commit

Permalink
1.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dyd committed Nov 20, 2020
1 parent cebbbb1 commit e80bdb7
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is a Payment Module for Magento Community Edition, that gives you the abili
Requirements
------------

* Magento Community Edition > 1.7 (Tested up to: __1.9.3.1__)
* Magento Community Edition > 1.7 (Tested up to: __1.9.3.6__)
* [GenesisPHP v1.18.4](https://github.com/GenesisGateway/genesis_php/releases/tag/1.18.4) - (Integrated in Module)
* PCI-certified server in order to use ```emerchantpay Direct```

Expand Down
23 changes: 23 additions & 0 deletions app/code/community/EMerchantPay/Genesis/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class EMerchantPay_Genesis_Helper_Data extends Mage_Core_Helper_Abstract
const RAW_DETAILS_TRANSACTION_TYPE = 'transaction_type';
const RAW_DETAILS_TERMINAL_TOKEN = 'terminal_token';

const PLATFORM_TRANSACTION_PREFIX = 'mage_';

/**
* Include Genesis library
*
Expand Down Expand Up @@ -1077,4 +1079,25 @@ public function getCaptureForRefund(Varien_Object $payment)

return $capture;
}

/**
* Return Store frontend name
*
* @return string
*/
public function getStoreName()
{
return Mage::app()->getStore()->getFrontendName();
}

/**
* Return platform transaction prefix
*
* @return string
*/
public function getPlatformTransactionPrefix()
{
return self::PLATFORM_TRANSACTION_PREFIX;
}

}
15 changes: 8 additions & 7 deletions app/code/community/EMerchantPay/Genesis/Model/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,22 @@ public function order(Varien_Object $payment, $amount)

$genesis = new \Genesis\Genesis('WPF\Create');

$orderItemsList = $this->getHelper()->getItemList($order);
$orderItemsList = $this->getHelper()->getItemList($order);
$platformPrefix = $this->getHelper()->getPlatformTransactionPrefix();

$genesis
->request()
->setTransactionId(
$this->getHelper()->genTransactionId(
$order->getIncrementId()
$platformPrefix . $order->getIncrementId()
)
)
->setCurrency(
$order->getOrderCurrencyCode()
)
->setAmount($amount)
->setUsage(
$this->getHelper()->__('Magento Payment')
$this->getHelper()->__('Payment via') . ' ' . $this->getHelper()->getStoreName()
)
->setDescription($orderItemsList)
->setCustomerPhone($billing->getTelephone())
Expand Down Expand Up @@ -364,7 +365,7 @@ public function capture(Varien_Object $payment, $amount)
->request()
->setTransactionId(
$this->getHelper()->genTransactionId(
$payment->getOrder()->getIncrementId()
$payment->getOrder()->getIncrementId()
)
)
->setRemoteIp(
Expand Down Expand Up @@ -473,7 +474,7 @@ public function refund(Varien_Object $payment, $amount)
->request()
->setTransactionId(
$this->getHelper()->genTransactionId(
$payment->getOrder()->getIncrementId()
$payment->getOrder()->getIncrementId()
)
)
->setRemoteIp(
Expand Down Expand Up @@ -594,7 +595,7 @@ public function void(Varien_Object $payment)
->request()
->setTransactionId(
$this->getHelper()->genTransactionId(
$payment->getOrder()->getIncrementId()
$payment->getOrder()->getIncrementId()
)
)
->setRemoteIp(
Expand Down Expand Up @@ -1110,7 +1111,7 @@ public function submitRecurringProfile(
$amount
)
->setUsage(
$this->getHelper()->__('Magento Init Recurring Payment')
$this->getHelper()->__('Recurring Payment via') . ' ' . $this->getHelper()->getStoreName()
)
->setDescription(
$this->getHelper()->getRecurringProfileItemDescription(
Expand Down
17 changes: 13 additions & 4 deletions app/code/community/EMerchantPay/Genesis/Model/Direct.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ protected function processTransaction(Varien_Object $payment, $amount)

$billing = $order->getBillingAddress();
$shipping = $order->getShippingAddress();
$platform_prefix = $this->getHelper()->getPlatformTransactionPrefix();

$genesis = new \Genesis\Genesis(
$this->getTransactionTypeRequestClassName(
Expand All @@ -269,14 +270,18 @@ protected function processTransaction(Varien_Object $payment, $amount)
->request()
->setTransactionId(
$this->getHelper()->genTransactionId(
$order->getIncrementId()
$platform_prefix . $order->getIncrementId()
)
)
->setRemoteIp(
$this->getHelper()->getRemoteAddress()
)
->setUsage(
$this->getHelper()->getItemList($order)
$this->getHelper()->__('Payment via')
. ' '
. $this->getHelper()->getStoreName()
. ' '
. $this->getHelper()->getItemList($order)
)
->setCurrency(
$order->getOrderCurrencyCode()
Expand Down Expand Up @@ -692,7 +697,9 @@ public function void(Varien_Object $payment)
$genesis
->request()
->setTransactionId(
$this->getHelper()->genTransactionId($payment->getOrder()->getIncrementId())
$this->getHelper()->genTransactionId(
$payment->getOrder()->getIncrementId()
)
)
->setRemoteIp(
$this->getHelper()->getRemoteAddress()
Expand Down Expand Up @@ -1021,7 +1028,9 @@ public function submitRecurringProfile(
->setTransactionId(
$profile->getInternalReferenceId()
)
->setUsage('Magento Init Recurring Payment')
->setUsage(
$this->getHelper()->__('Recurring Payment via') . ' ' . $this->getHelper()->getStoreName()
)
->setMoto('')
->setRemoteIp(
$this->getHelper()->getRemoteAddress()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,13 @@ protected function chargeRecurringProfile(
}
}

$platform_prefix = $this->getHelper()->getPlatformTransactionPrefix();
$genesis = new \Genesis\Genesis("Financial\\Cards\\Recurring\\RecurringSale");

$genesis
->request()
->setTransactionId(
$this->getHelper()->genTransactionId()
$this->getHelper()->genTransactionId($platform_prefix)
)
->setReferenceId(
$initRecurringCaptureTransaction->getTxnId()
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/EMerchantPay/Genesis/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GNU General Public License for more details.
<config>
<modules>
<EMerchantPay_Genesis>
<version>1.5.6</version>
<version>1.5.7</version>
</EMerchantPay_Genesis>
</modules>

Expand Down
4 changes: 3 additions & 1 deletion app/locale/en_GB/EMerchantPay_Genesis.csv
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"InstaDebit","InstaDebit Payin"
"Instant Transfer","Instant Transfer"
"Itau","Itau"
"Payment via","Payment via"
"Recurring Payment via","Recurring Payment via"
"Magento Payment","Magento Payment"
"Magento Capture","Magento Capture"
"Magento Refund","Magento Refund"
Expand Down Expand Up @@ -76,4 +78,4 @@
"You will be redirected to our partner's website, where you can safely pay with your credit card.","You will be redirected to our partner's website, where you can safely pay with your credit card."
"Your payment session has been cancelled successfully!","Your payment session has been cancelled successfully!"
"eps","eps"
"You cannot finish the payment as a guest, please login / register.","You cannot finish the payment as a guest, please login / register."
"You cannot finish the payment as a guest, please login / register.","You cannot finish the payment as a guest, please login / register."
1 change: 1 addition & 0 deletions app/locale/en_US/EMerchantPay_Genesis.csv
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"InstaDebit","InstaDebit Payin"
"Instant Transfer","Instant Transfer"
"Itau","Itau"
"Payment via","Payment via"
"Magento Payment","Magento Payment"
"Magento Capture","Magento Capture"
"Magento Refund","Magento Refund"
Expand Down

0 comments on commit e80bdb7

Please sign in to comment.