Skip to content

Commit

Permalink
ECheck bug fix; filter creditcard number in paypage transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Juncai committed Mar 13, 2015
1 parent 0b73248 commit 7bf3015
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/code/local/Litle/CreditCard/Model/PaymentLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function merchantData(Varien_Object $payment)
'user' => $this->getConfigData('user'),
'password' => $this->getConfigData('password'),
'merchantId' => $this->getMerchantId($payment),
'merchantSdk' => 'Magento;8.15.2',
'merchantSdk' => 'Magento;8.15.4',
'reportGroup' => $this->getMerchantId($payment),
'customerId' => $order->getCustomerEmail(),
'url' => $this->getConfigData('url'),
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/Litle/CreditCard/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Litle_CreditCard>
<version>8.15.3</version>
<version>8.15.4</version>
</Litle_CreditCard>
</modules>
<global>
Expand Down
33 changes: 29 additions & 4 deletions app/code/local/Litle/LEcheck/Model/PaymentLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public function getContactInformation($contactInfo)
$retArray["addressLine2"] = $contactInfo->getStreet(2);
$retArray["addressLine3"] = $contactInfo->getStreet(3);
$retArray["city"] = $contactInfo->getCity();
$retArray["state"] = $contactInfo->getRegion();
$region = Mage::getModel('directory/region')->load($contactInfo->getRegionId());
$retArray["state"] = $region->getCode();
$retArray["zip"] = $contactInfo->getPostcode();
$retArray["country"] = $contactInfo->getCountry();
$retArray["email"] = $contactInfo->getCustomerEmail();
Expand Down Expand Up @@ -166,7 +167,7 @@ public function merchantData(Varien_Object $payment)
$hash = array('user'=> $this->getConfigData("user"),
'password'=> $this->getConfigData("password"),
'merchantId'=>$this->getMerchantId($payment),
'merchantSdk' => 'Magento;8.15.2',
'merchantSdk' => 'Magento;8.15.4',
'reportGroup'=>$this->getMerchantId($payment),
'url'=>$this->getConfigData("url"),
'proxy'=>$this->getConfigData("proxy"),
Expand Down Expand Up @@ -264,13 +265,11 @@ public function capture (Varien_Object $payment, $amount)
$order = $payment->getOrder();
$orderId =$order->getIncrementId();
$amountToPass = ($amount* 100);

if (!empty($order)){
$hash = array(
'orderId'=> $orderId,
'amount'=> $amountToPass,
'orderSource'=> "ecommerce",
'verify'=>'true',
'billToAddress'=> $this->getBillToAddress($payment),
'shipToAddress'=> $this->getAddressInfo($payment),
'echeck'=> $this->getEcheckInfo($payment)
Expand All @@ -282,6 +281,32 @@ public function capture (Varien_Object $payment, $amount)
}
$this->processResponse($payment,$litleResponse);
}
/**
* this method is called if we are authorising AND
* capturing a transaction with verification
*/
public function order (Varien_Object $payment, $amount)
{
$order = $payment->getOrder();
$orderId =$order->getIncrementId();
$amountToPass = ($amount* 100);
if (!empty($order)){
$hash = array(
'orderId'=> $orderId,
'amount'=> $amountToPass,
'orderSource'=> "ecommerce",
'verify'=>'true',
'billToAddress'=> $this->getBillToAddress($payment),
'shipToAddress'=> $this->getAddressInfo($payment),
'echeck'=> $this->getEcheckInfo($payment)
);
$merchantData = $this->merchantData($payment);
$hash_in = array_merge($hash,$merchantData);
$litleRequest = new LitleOnlineRequest();
$litleResponse = $litleRequest->echeckSaleRequest($hash_in);
}
$this->processResponse($payment,$litleResponse);
}

/**
* called if refunding
Expand Down
4 changes: 4 additions & 0 deletions app/code/local/Litle/LEcheck/Model/Transactiontypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public function toOptionArray()
'value' => Mage_Paygate_Model_Authorizenet::ACTION_AUTHORIZE_CAPTURE,
'label' => 'Sale'
),
array(
'value' => Mage_Paygate_Model_Authorizenet::ACTION_ORDER,
'label' => 'Sale With Verification'
),
);
}
}
2 changes: 1 addition & 1 deletion app/code/local/Litle/LEcheck/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Litle_LEcheck>
<version>8.15.3</version>
<version>8.15.4</version>
</Litle_LEcheck>
</modules>
<global>
Expand Down
2 changes: 1 addition & 1 deletion app/code/local/Litle/Palorus/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Litle_Palorus>
<version>8.15.3</version>
<version>8.15.4</version>
</Litle_Palorus>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,21 @@ $_id = $_time . substr($_session,13);
}

function submitAfterLitle() {
var cc_num = encodeURI($('creditcard_cc_number').name);
var cc_cid = encodeURI($('creditcard_cc_cid').name);
var kvPairs = Form.serialize(_form).split("&");
for ( var i = kvPairs.length-1; i>=0; i--) {
if(kvPairs[i].indexOf(cc_num) > -1 || kvPairs[i].indexOf(cc_cid) > -1)
kvPairs.splice(i,1);
}
var request = new Ajax.Request(
_saveUrl,
{
method:'post',
onComplete: _onComplete,
onSuccess: _onSave,
onFailure: checkout.ajaxFailure.bind(checkout),
parameters: Form.serialize(_form)
parameters: kvPairs.join("&")
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<property environment="env" />

<!-- set global properties for this build -->
<property name="version" value="8.15.3"/>
<property name="version" value="8.15.4"/>
<property name="pathToLitleMagentoIntegrationFolder" value="${env.WORKSPACE}/"/>
<property name="pathToFolderToSaveIn" value="${env.WORKSPACE}/output/"/>

Expand Down

0 comments on commit 7bf3015

Please sign in to comment.