Version Notes
Fixed bugs with multi-address checkout
Download this release
Release Info
| Developer | Classy Llama |
| Extension | CLS_Paypal_Credit_Card_Tokenization |
| Version | 1.0.5 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.4 to 1.0.5
- app/code/community/CLS/Paypal/CHANGELOG.txt +6 -1
- app/code/community/CLS/Paypal/Model/Observer.php +53 -47
- app/code/community/CLS/Paypal/Model/Paypal/Stored/Customerstored/Direct.php +3 -0
- app/code/community/CLS/Paypal/Model/Paypal/Stored/Customerstored/Payflow.php +3 -0
- app/code/community/CLS/Paypal/etc/config.xml +1 -1
- package.xml +5 -5
app/code/community/CLS/Paypal/CHANGELOG.txt
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
CLS_Paypal 1.0.4 (10/23/2013)
|
| 2 |
=======================================
|
| 3 |
-
Fixed bugs in orderstored and customerstored methods when
|
| 4 |
enabled for a specific website
|
| 5 |
|
| 6 |
|
| 1 |
+
CLS_Paypal 1.0.5 (1/22/2014)
|
| 2 |
+
=======================================
|
| 3 |
+
[FIXED] Bugs with multi-address checkout
|
| 4 |
+
|
| 5 |
+
|
| 6 |
CLS_Paypal 1.0.4 (10/23/2013)
|
| 7 |
=======================================
|
| 8 |
+
[FIXED] Fixed bugs in orderstored and customerstored methods when
|
| 9 |
enabled for a specific website
|
| 10 |
|
| 11 |
|
app/code/community/CLS/Paypal/Model/Observer.php
CHANGED
|
@@ -174,62 +174,68 @@ class CLS_Paypal_Model_Observer
|
|
| 174 |
*/
|
| 175 |
public function checkoutSubmitAllAfter(Varien_Event_Observer $observer)
|
| 176 |
{
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
$customerId = $order->getData('customer_id');
|
| 181 |
-
|
| 182 |
-
if (!$customerId) {
|
| 183 |
-
// Save transaction details for registered customers only
|
| 184 |
-
return;
|
| 185 |
}
|
| 186 |
|
| 187 |
-
$
|
| 188 |
-
|
| 189 |
|
| 190 |
-
|
| 191 |
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
if ($helper->isSdkPaymentMethod($paymentMethod)) {
|
| 196 |
-
if (
|
| 197 |
-
$payment->hasAdditionalInformation('cc_save_future') &&
|
| 198 |
-
($payment->getAdditionalInformation('cc_save_future') == 'Y')
|
| 199 |
-
) {
|
| 200 |
-
// Create new stored card
|
| 201 |
-
$customerstoredModel = Mage::getModel('cls_paypal/customerstored');
|
| 202 |
-
$customerstoredModel->setData(array(
|
| 203 |
-
'transaction_id' => $payment->getData('transaction_id'),
|
| 204 |
-
'customer_id' => $customerId,
|
| 205 |
-
'cc_type' => $payment->getData('cc_type'),
|
| 206 |
-
'cc_last4' => $payment->getData('cc_last4'),
|
| 207 |
-
'cc_exp_month' => $payment->getData('cc_exp_month'),
|
| 208 |
-
'cc_exp_year' => $payment->getData('cc_exp_year'),
|
| 209 |
-
'date' => Varien_Date::formatDate(true, true),
|
| 210 |
-
'payment_method' => $paymentMethod
|
| 211 |
-
));
|
| 212 |
-
$customerstoredModel->save();
|
| 213 |
-
}
|
| 214 |
}
|
| 215 |
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
if (
|
| 226 |
-
|
| 227 |
-
$
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
$customerstoredModel->save();
|
| 231 |
}
|
| 232 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
}
|
| 234 |
}
|
| 235 |
}
|
| 174 |
*/
|
| 175 |
public function checkoutSubmitAllAfter(Varien_Event_Observer $observer)
|
| 176 |
{
|
| 177 |
+
$orders = $observer->getOrders();
|
| 178 |
+
if (is_null($orders)) {
|
| 179 |
+
$orders = array($observer->getOrder());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
}
|
| 181 |
|
| 182 |
+
foreach($orders as $order) {
|
| 183 |
+
/** @var $order Mage_Sales_Model_Order */
|
| 184 |
|
| 185 |
+
$customerId = $order->getData('customer_id');
|
| 186 |
|
| 187 |
+
if (!$customerId) {
|
| 188 |
+
// Save transaction details for registered customers only
|
| 189 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
}
|
| 191 |
|
| 192 |
+
$payment = $order->getPayment();
|
| 193 |
+
$paymentMethod = $payment->getMethod();
|
| 194 |
+
|
| 195 |
+
if ( isset($paymentMethod) && $payment->getData('transaction_id') ) {
|
| 196 |
+
|
| 197 |
+
/** @var $helper CLS_Paypal_Helper_Data */
|
| 198 |
+
$helper = Mage::helper('cls_paypal');
|
| 199 |
+
|
| 200 |
+
if ($helper->isSdkPaymentMethod($paymentMethod)) {
|
| 201 |
+
if (
|
| 202 |
+
$payment->hasAdditionalInformation('cc_save_future') &&
|
| 203 |
+
($payment->getAdditionalInformation('cc_save_future') == 'Y')
|
| 204 |
+
) {
|
| 205 |
+
// Create new stored card
|
| 206 |
+
$customerstoredModel = Mage::getModel('cls_paypal/customerstored');
|
| 207 |
+
$customerstoredModel->setData(array(
|
| 208 |
+
'transaction_id' => $payment->getData('transaction_id'),
|
| 209 |
+
'customer_id' => $customerId,
|
| 210 |
+
'cc_type' => $payment->getData('cc_type'),
|
| 211 |
+
'cc_last4' => $payment->getData('cc_last4'),
|
| 212 |
+
'cc_exp_month' => $payment->getData('cc_exp_month'),
|
| 213 |
+
'cc_exp_year' => $payment->getData('cc_exp_year'),
|
| 214 |
+
'date' => Varien_Date::formatDate(true, true),
|
| 215 |
+
'payment_method' => $paymentMethod
|
| 216 |
+
));
|
| 217 |
$customerstoredModel->save();
|
| 218 |
}
|
| 219 |
}
|
| 220 |
+
|
| 221 |
+
elseif ($helper->isCustomerstoredPaymentMethod($paymentMethod)) {
|
| 222 |
+
// Update existing stored card
|
| 223 |
+
$customerstoredModel = Mage::getModel('cls_paypal/customerstored');
|
| 224 |
+
|
| 225 |
+
if ($payment->hasAdditionalInformation('stored_card_id')) {
|
| 226 |
+
// Reference payment using existing customer's stored card
|
| 227 |
+
$storedCardId = $payment->getAdditionalInformation('stored_card_id');
|
| 228 |
+
$customerstoredModel->load($storedCardId);
|
| 229 |
+
|
| 230 |
+
if ($customerstoredModel->getId()) {
|
| 231 |
+
// Update stored card record with a new transaction ID
|
| 232 |
+
$customerstoredModel
|
| 233 |
+
->setData('transaction_id', $payment->getData('transaction_id'))
|
| 234 |
+
->setData('date', Varien_Date::formatDate(true, false));
|
| 235 |
+
$customerstoredModel->save();
|
| 236 |
+
}
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
}
|
| 240 |
}
|
| 241 |
}
|
app/code/community/CLS/Paypal/Model/Paypal/Stored/Customerstored/Direct.php
CHANGED
|
@@ -115,6 +115,9 @@ class CLS_Paypal_Model_Paypal_Stored_Customerstored_Direct extends CLS_Paypal_Mo
|
|
| 115 |
{
|
| 116 |
// Get Reference ID
|
| 117 |
$paymentStoredCardId = $this->getInfoInstance()->getData('stored_card_id');
|
|
|
|
|
|
|
|
|
|
| 118 |
$referenceId = null;
|
| 119 |
|
| 120 |
if ($paymentStoredCardId) {
|
| 115 |
{
|
| 116 |
// Get Reference ID
|
| 117 |
$paymentStoredCardId = $this->getInfoInstance()->getData('stored_card_id');
|
| 118 |
+
if (is_null($paymentStoredCardId)) {
|
| 119 |
+
$paymentStoredCardId = $this->getInfoInstance()->getAdditionalInformation('stored_card_id');
|
| 120 |
+
}
|
| 121 |
$referenceId = null;
|
| 122 |
|
| 123 |
if ($paymentStoredCardId) {
|
app/code/community/CLS/Paypal/Model/Paypal/Stored/Customerstored/Payflow.php
CHANGED
|
@@ -67,6 +67,9 @@ class CLS_Paypal_Model_Paypal_Stored_Customerstored_Payflow extends CLS_Paypal_M
|
|
| 67 |
{
|
| 68 |
// Get Reference ID
|
| 69 |
$paymentStoredCardId = $this->_commonMethod->getInfoInstance()->getData('stored_card_id');
|
|
|
|
|
|
|
|
|
|
| 70 |
$referenceId = null;
|
| 71 |
|
| 72 |
if ($paymentStoredCardId) {
|
| 67 |
{
|
| 68 |
// Get Reference ID
|
| 69 |
$paymentStoredCardId = $this->_commonMethod->getInfoInstance()->getData('stored_card_id');
|
| 70 |
+
if (is_null($paymentStoredCardId)) {
|
| 71 |
+
$paymentStoredCardId = $this->_commonMethod->getInfoInstance()->getAdditionalInformation('stored_card_id');
|
| 72 |
+
}
|
| 73 |
$referenceId = null;
|
| 74 |
|
| 75 |
if ($paymentStoredCardId) {
|
app/code/community/CLS/Paypal/etc/config.xml
CHANGED
|
@@ -30,7 +30,7 @@
|
|
| 30 |
<config>
|
| 31 |
<modules>
|
| 32 |
<CLS_Paypal>
|
| 33 |
-
<version>1.0.
|
| 34 |
</CLS_Paypal>
|
| 35 |
</modules>
|
| 36 |
|
| 30 |
<config>
|
| 31 |
<modules>
|
| 32 |
<CLS_Paypal>
|
| 33 |
+
<version>1.0.5</version>
|
| 34 |
</CLS_Paypal>
|
| 35 |
</modules>
|
| 36 |
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>CLS_Paypal_Credit_Card_Tokenization</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -73,11 +73,11 @@ Enable the module's various features from these groups, as well as setting
|
|
| 73 |
their configuration options independently of the standard credit card
|
| 74 |
and billing agreement configurations.
|
| 75 |
</description>
|
| 76 |
-
<notes>Fixed bugs with
|
| 77 |
<authors><author><name>Classy Llama</name><user>classyllama</user><email>info@classyllama.com</email></author></authors>
|
| 78 |
-
<date>
|
| 79 |
-
<time>
|
| 80 |
-
<contents><target name="magecommunity"><dir name="CLS"><dir name="Paypal"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><file name="Customer.php" hash="bdda7f26580da00836dc14c760ce7bd4"/></dir></dir></dir></dir><dir name="Customer"><file name="Storedcard.php" hash="1f0ea64d4d88d8acc69b491ad157013d"/></dir><dir name="Payment"><dir name="Form"><file name="Cc.php" hash="bd28bf5a1476b6d000f7ddcfc8097520"/></dir></dir><dir name="Paypal"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Location.php" hash="51a66bf4179183e15d74e2dd60867d08"/></dir></dir></dir></dir><dir name="Payflow"><dir name="Advanced"><file name="Form.php" hash="431cc885b585b3a6ae44b3e63b4a3500"/></dir><dir name="Link"><file name="Form.php" hash="803988293c751db8be065174648ea789"/></dir></dir><dir name="Payment"><dir name="Form"><file name="Customerstored.php" hash="705a1066768956fa2757aa6974df6a90"/><dir name="Orderstored"><file name="Agreement.php" hash="51a809dde7da3c5fb7adaccfc94583fe"/></dir><file name="Orderstored.php" hash="aae8127491dcace2d2800879b2743157"/></dir></dir></dir><dir name="Paypaluk"><dir name="Payment"><dir name="Form"><dir name="Orderstored"><file name="Agreement.php" hash="f2cefe3e8fc148a628b8c7275401845d"/></dir></dir></dir></dir></dir><file name="CHANGELOG.txt" hash="
|
| 81 |
<compatible/>
|
| 82 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 83 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>CLS_Paypal_Credit_Card_Tokenization</name>
|
| 4 |
+
<version>1.0.5</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
| 7 |
<channel>community</channel>
|
| 73 |
their configuration options independently of the standard credit card
|
| 74 |
and billing agreement configurations.
|
| 75 |
</description>
|
| 76 |
+
<notes>Fixed bugs with multi-address checkout</notes>
|
| 77 |
<authors><author><name>Classy Llama</name><user>classyllama</user><email>info@classyllama.com</email></author></authors>
|
| 78 |
+
<date>2014-01-22</date>
|
| 79 |
+
<time>21:43:07</time>
|
| 80 |
+
<contents><target name="magecommunity"><dir name="CLS"><dir name="Paypal"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><file name="Customer.php" hash="bdda7f26580da00836dc14c760ce7bd4"/></dir></dir></dir></dir><dir name="Customer"><file name="Storedcard.php" hash="1f0ea64d4d88d8acc69b491ad157013d"/></dir><dir name="Payment"><dir name="Form"><file name="Cc.php" hash="bd28bf5a1476b6d000f7ddcfc8097520"/></dir></dir><dir name="Paypal"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Location.php" hash="51a66bf4179183e15d74e2dd60867d08"/></dir></dir></dir></dir><dir name="Payflow"><dir name="Advanced"><file name="Form.php" hash="431cc885b585b3a6ae44b3e63b4a3500"/></dir><dir name="Link"><file name="Form.php" hash="803988293c751db8be065174648ea789"/></dir></dir><dir name="Payment"><dir name="Form"><file name="Customerstored.php" hash="705a1066768956fa2757aa6974df6a90"/><dir name="Orderstored"><file name="Agreement.php" hash="51a809dde7da3c5fb7adaccfc94583fe"/></dir><file name="Orderstored.php" hash="aae8127491dcace2d2800879b2743157"/></dir></dir></dir><dir name="Paypaluk"><dir name="Payment"><dir name="Form"><dir name="Orderstored"><file name="Agreement.php" hash="f2cefe3e8fc148a628b8c7275401845d"/></dir></dir></dir></dir></dir><file name="CHANGELOG.txt" hash="42f8ab28ce7895ac97e42e75eb891b94"/><dir name="Helper"><file name="Data.php" hash="0d3f45c57c94284712bd91aa4b19351b"/><dir name="Orderstored"><file name="Agreement.php" hash="d84455b451593c2eaa46522e09834da7"/></dir><dir name="Paypal"><file name="Data.php" hash="f60bf2892eb63645f2eab96bc7dc6b4a"/></dir><file name="Storedcard.php" hash="874a70e486c9b8ed353167245f9ed07a"/></dir><file name="LICENSE.txt" hash="71db18446bebc23ced8dd62644d16b5f"/><dir name="Model"><file name="Customerstored.php" hash="8be7c468362ad43b6a09d4c223d36515"/><file name="Observer.php" hash="457631f86139aa7666657e9b6658af89"/><dir name="Paypal"><dir name="Api"><file name="Nvp.php" hash="cef7500ca76ea7f62ed4ee5843fcf17c"/></dir><file name="Config.php" hash="dc8223a0fc3b8d6659184d1fe6c0330b"/><file name="Direct.php" hash="9f551d5e14e99451ca02f79d2f78f4ab"/><dir name="Express"><file name="Checkout.php" hash="021cbbf4e0985106ab24bfa8bd62abb4"/></dir><file name="Express.php" hash="67b5631bf57b2797050c73c7378aee9c"/><file name="Info.php" hash="d6d8415242d2a63eb831cac84f276701"/><dir name="Method"><dir name="Orderstored"><file name="Agreement.php" hash="dea76e2815bdffc8a7225840574b12ac"/></dir></dir><file name="Payflowadvanced.php" hash="333a909b6b48c6c3c864e591d5ee0a4d"/><file name="Payflowlink.php" hash="98129dfc3d9a5236e8c5a94cddbeb6d3"/><file name="Payflowpro.php" hash="dbfa4f171934f4f26d05515ca5ae36b1"/><dir name="Stored"><file name="Abstract.php" hash="946b41be7b003f821fa091e25974e2e1"/><dir name="Customerstored"><file name="Direct.php" hash="1fb16f32ce53c7825d9460c57de571ef"/><file name="Payflow.php" hash="b01eba2260d72dc3dc60efa6277502b1"/><file name="Payflowadvanced.php" hash="5d5b02436cf305412bfec098eea85e09"/><file name="Payflowlink.php" hash="83a4de2a5192635c48af3aac8b2cb7e2"/><file name="Payflowpro.php" hash="394ec117863b90196f141d1df367b068"/></dir><file name="Customerstored.php" hash="f9fe1df0936372d6abcb30b3129c080b"/><dir name="Orderstored"><file name="Direct.php" hash="403bd0b06c2f235c9480eaf05d449b3b"/><file name="Payflow.php" hash="98fae36789f67423db4a520b7feaa01f"/><file name="Payflowadvanced.php" hash="8dd64cf3c2b9ae5560b3a06204d59751"/><file name="Payflowlink.php" hash="71b134111dc49d20692c3ffae3bfa1c7"/><file name="Payflowpro.php" hash="08bac93661b9234b0546ab429f4a3931"/></dir><file name="Orderstored.php" hash="2f9b44b951f3f7dfe80ab8153be7f8bc"/><file name="Payflow.php" hash="288f16ab9d9d2b0d8957c8887f528b99"/></dir></dir><dir name="Paypaluk"><dir name="Api"><file name="Nvp.php" hash="ef27f778fde49eab569c6f3944702ec4"/></dir><dir name="Express"><file name="Checkout.php" hash="6a2a85e0acb0645d025c8823a5b3cd2f"/></dir><file name="Express.php" hash="b491f2d6acf89a29f4a23dc573f8e44f"/><dir name="Method"><file name="Agreement.php" hash="c86f295fa6312888b45c0f4a68fd27df"/><dir name="Orderstored"><file name="Agreement.php" hash="8534a919294e533247ef5cebdef434ce"/></dir></dir></dir><dir name="Resource"><dir name="Customerstored"><file name="Collection.php" hash="818889cb1eedd1e2047d09f6270f9b30"/></dir><file name="Customerstored.php" hash="0dd4ba6646ffbd32efbe6e4f0bc4e3c7"/></dir></dir><file name="README.md" hash="3371344d77a0c17859e4b7e75380b0a7"/><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="CreateController.php" hash="edd90db7fcc89ccfd5519864debed3ad"/></dir></dir></dir><dir name="Customer"><file name="StoredcardController.php" hash="60c3403cd13a9ff1805506f5988cabdb"/></dir><dir name="Paypal"><file name="ExpressController.php" hash="53f83f79f948ffc0eb6abdfc5d8f60b0"/></dir><dir name="PaypalUk"><file name="ExpressController.php" hash="639821dc1c01a0276052579c5507a599"/></dir></dir><dir name="etc"><file name="config.xml" hash="796e7de924e0fab5cc481b8ea86c3500"/><file name="system.xml" hash="4d5998c927b5739a52c078c99644bd32"/></dir><dir name="sql"><dir name="cls_paypal_setup"><file name="install-0.0.1.php" hash="33f870045a3cc0da094eed143adaf57b"/><file name="upgrade-0.3.0-0.3.1.php" hash="240dd4eae586f033ec6efad99773fbce"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="cls_paypal.xml" hash="6747dd281152c450e1511f9d551c9766"/></dir><dir name="template"><dir name="cls_paypal"><dir name="payment"><dir name="form"><file name="cc.phtml" hash="a23359ef60f0cf4041f4dd406c1cb286"/><file name="customer_stored.phtml" hash="6004f23604bb7de0a409494bb0c0c439"/><file name="order_stored.phtml" hash="7620eacd6d2351df7e827eb168d03236"/></dir></dir><dir name="sales"><dir name="order"><dir name="create"><dir name="form"><file name="address.phtml" hash="a452ddc2a6e812f0872e82ad931b9dac"/></dir></dir></dir><dir name="payment"><dir name="form"><dir name="orderstored"><file name="agreement.phtml" hash="5a080925e336f505381cba5e43f70e07"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cls_paypal.xml" hash="0e2a6af1135e6fb29dda4b267797a6bd"/></dir><dir name="template"><dir name="cls_paypal"><dir name="customer"><file name="storedcard.phtml" hash="4756af996c65fb83a09ab0312a66bd1f"/></dir><dir name="payment"><dir name="form"><file name="cc.phtml" hash="bd55fa445bea026721116b29dfadbb73"/><file name="customer_stored.phtml" hash="591d82906294e37f5c2e317f71144a0f"/></dir></dir><dir name="paypal"><dir name="payflow"><file name="info.phtml" hash="548f1b761782c2351482dd1d1f44a7af"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CLS_Paypal.xml" hash="9e629aac18f2e5f2c9feb266985c912f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="CLS_Paypal.csv" hash="ab57482877d914bb1d02021d95c65520"/></dir></target></contents>
|
| 81 |
<compatible/>
|
| 82 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 83 |
</package>
|
