Version Notes
* fix issue with authorize.net that affected some installations.
* fix issue with bad/duplicate session identifiers.
Download this release
Release Info
Developer | Riskified_Mage |
Extension | riskified_magento |
Version | 1.0.6.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.6.1 to 1.0.6.2
- app/code/community/Riskified/Full/.DS_Store +0 -0
- app/code/community/Riskified/Full/Helper/Data.php +1 -2
- app/code/community/Riskified/Full/Helper/Order.php +72 -57
- {lib/riskified_php_sdk/src/Riskified → app/code/community/Riskified/Full/Test}/.DS_Store +0 -0
- app/code/community/Riskified/Full/etc/config.xml +1 -1
- package.xml +7 -5
app/code/community/Riskified/Full/.DS_Store
CHANGED
Binary file
|
app/code/community/Riskified/Full/Helper/Data.php
CHANGED
@@ -47,8 +47,7 @@ class Riskified_Full_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
47 |
}
|
48 |
|
49 |
public function getSessionId(){
|
50 |
-
|
51 |
-
return $visitorData['session_id'];
|
52 |
}
|
53 |
|
54 |
/**
|
47 |
}
|
48 |
|
49 |
public function getSessionId(){
|
50 |
+
return Mage::getModel('core/cookie')->get('rCookie');
|
|
|
51 |
}
|
52 |
|
53 |
/**
|
app/code/community/Riskified/Full/Helper/Order.php
CHANGED
@@ -202,7 +202,7 @@ class Riskified_Full_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
202 |
}
|
203 |
|
204 |
private function getOrder($model) {
|
205 |
-
$
|
206 |
'id' => $model->getId(),
|
207 |
'name' => $model->getIncrementId(),
|
208 |
'email' => $model->getCustomerEmail(),
|
@@ -223,7 +223,14 @@ class Riskified_Full_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
223 |
'cancelled_at' => $this->formatDateAsIso8601($this->getCancelledAt($model)),
|
224 |
'financial_status' => $model->getState(),
|
225 |
'fulfillment_status' => $model->getStatus()
|
226 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
$order->customer = $this->getCustomer($model);
|
229 |
$order->shipping_address = $this->getShippingAddress($model);
|
@@ -231,7 +238,10 @@ class Riskified_Full_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
231 |
$order->payment_details = $this->getPaymentDetails($model);
|
232 |
$order->line_items = $this->getLineItems($model);
|
233 |
$order->shipping_lines = $this->getShippingLines($model);
|
234 |
-
|
|
|
|
|
|
|
235 |
|
236 |
Mage::helper('full/log')->log("getOrder(): ".PHP_EOL.json_encode(json_decode($order->toJson())));
|
237 |
|
@@ -285,69 +295,75 @@ class Riskified_Full_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
285 |
$transactionId = $payment->getTransactionId();
|
286 |
|
287 |
$gateway_name = $payment->getMethod();
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
}
|
336 |
|
337 |
-
if (
|
338 |
$cvv_result_code = $payment->getCcCidStatus();
|
339 |
}
|
340 |
-
if (
|
341 |
$credit_card_number = $payment->getCcLast4();
|
342 |
}
|
343 |
-
if (
|
344 |
$credit_card_company = $payment->getCcType();
|
345 |
}
|
346 |
-
if (
|
347 |
$avs_result_code = $payment->getCcAvsStatus();
|
348 |
}
|
349 |
|
350 |
-
if($credit_card_number) {
|
351 |
$credit_card_number = "XXXX-XXXX-XXXX-" . $credit_card_number;
|
352 |
}
|
353 |
$credit_card_bin = $payment->getAdditionalInformation('riskified_cc_bin');
|
@@ -364,7 +380,6 @@ class Riskified_Full_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
364 |
|
365 |
private function getLineItems($model) {
|
366 |
$line_items = array();
|
367 |
-
//foreach ($model->getItemsCollection() as $key => $val) {
|
368 |
foreach ($model->getAllVisibleItems() as $key => $val) {
|
369 |
$line_items[] = new Model\LineItem(array_filter(array(
|
370 |
'price' => $val->getPrice(),
|
@@ -501,4 +516,4 @@ class Riskified_Full_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
501 |
Mage::helper('full/log')->logException($e);
|
502 |
}
|
503 |
}
|
504 |
-
}
|
202 |
}
|
203 |
|
204 |
private function getOrder($model) {
|
205 |
+
$order_array = array(
|
206 |
'id' => $model->getId(),
|
207 |
'name' => $model->getIncrementId(),
|
208 |
'email' => $model->getCustomerEmail(),
|
223 |
'cancelled_at' => $this->formatDateAsIso8601($this->getCancelledAt($model)),
|
224 |
'financial_status' => $model->getState(),
|
225 |
'fulfillment_status' => $model->getStatus()
|
226 |
+
);
|
227 |
+
|
228 |
+
if (Mage::getSingleton('admin/session')->isLoggedIn()) {
|
229 |
+
unset($order_array['browser_ip']);
|
230 |
+
unset($order_array['cart_token']);
|
231 |
+
}
|
232 |
+
|
233 |
+
$order = new Model\Order(array_filter($order_array,'strlen'));
|
234 |
|
235 |
$order->customer = $this->getCustomer($model);
|
236 |
$order->shipping_address = $this->getShippingAddress($model);
|
238 |
$order->payment_details = $this->getPaymentDetails($model);
|
239 |
$order->line_items = $this->getLineItems($model);
|
240 |
$order->shipping_lines = $this->getShippingLines($model);
|
241 |
+
|
242 |
+
if (!Mage::getSingleton('admin/session')->isLoggedIn()) {
|
243 |
+
$order->client_details = $this->getClientDetails($model);
|
244 |
+
}
|
245 |
|
246 |
Mage::helper('full/log')->log("getOrder(): ".PHP_EOL.json_encode(json_decode($order->toJson())));
|
247 |
|
295 |
$transactionId = $payment->getTransactionId();
|
296 |
|
297 |
$gateway_name = $payment->getMethod();
|
298 |
+
|
299 |
+
try {
|
300 |
+
switch ($gateway_name) {
|
301 |
+
case 'authorizenet':
|
302 |
+
$cards_data = array_values($payment->getAdditionalInformation('authorize_cards'));
|
303 |
+
$card_data = $cards_data[0];
|
304 |
+
$avs_result_code = $card_data['cc_avs_result_code']; // getAvsResultCode
|
305 |
+
$cvv_result_code = $card_data['cc_response_code']; // getCardCodeResponseCode
|
306 |
+
$credit_card_number = $card_data['cc_last4'];
|
307 |
+
$credit_card_company = $card_data['cc_type'];
|
308 |
+
break;
|
309 |
+
case 'paypal_express':
|
310 |
+
case 'paypaluk_express':
|
311 |
+
$payer_email = $payment->getAdditionalInformation('paypal_payer_email');
|
312 |
+
$payer_status = $payment->getAdditionalInformation('paypal_payer_status');
|
313 |
+
$payer_address_status = $payment->getAdditionalInformation('paypal_address_status');
|
314 |
+
$protection_eligibility = $payment->getAdditionalInformation('paypal_protection_eligibility');
|
315 |
+
$payment_status = $payment->getAdditionalInformation('paypal_payment_status');
|
316 |
+
$pending_reason = $payment->getAdditionalInformation('paypal_pending_reason');
|
317 |
+
|
318 |
+
return new Model\PaymentDetails(array_filter(array(
|
319 |
+
'authorization_id' => $transactionId,
|
320 |
+
'payer_email' => $payer_email,
|
321 |
+
'payer_status' => $payer_status,
|
322 |
+
'payer_address_status' => $payer_address_status,
|
323 |
+
'protection_eligibility' => $protection_eligibility,
|
324 |
+
'payment_status' => $payment_status,
|
325 |
+
'pending_reason' => $pending_reason
|
326 |
+
), 'strlen'));
|
327 |
+
|
328 |
+
case 'paypal_direct':
|
329 |
+
case 'paypaluk_direct':
|
330 |
+
$avs_result_code = $payment->getAdditionalInformation('paypal_avs_code');
|
331 |
+
$cvv_result_code = $payment->getAdditionalInformation('paypal_cvv2_match');
|
332 |
+
$credit_card_number = $payment->getCcLast4();
|
333 |
+
$credit_card_company = $payment->getCcType();
|
334 |
+
break;
|
335 |
+
|
336 |
+
case 'sagepaydirectpro':
|
337 |
+
$sage = $model->getSagepayInfo();
|
338 |
+
$avs_result_code = $sage->getData('address_result');
|
339 |
+
$cvv_result_code = $sage->getData('cv2result');
|
340 |
+
$credit_card_number = $sage->getData('last_four_digits');
|
341 |
+
$credit_card_company = $sage->getData('card_type');
|
342 |
+
break;
|
343 |
+
|
344 |
+
default:
|
345 |
+
Mage::helper('full/log')->log("unknown gateway:" . $gateway_name);
|
346 |
+
break;
|
347 |
+
}
|
348 |
+
} catch (Exception $e) {
|
349 |
+
Mage::helper('full/log')->logException($e);
|
350 |
+
Mage::getSingleton('adminhtml/session')->addError('Riskified extension: ' . $e->getMessage());
|
351 |
}
|
352 |
|
353 |
+
if (!isset($cvv_result_code)) {
|
354 |
$cvv_result_code = $payment->getCcCidStatus();
|
355 |
}
|
356 |
+
if (!isset($credit_card_number)) {
|
357 |
$credit_card_number = $payment->getCcLast4();
|
358 |
}
|
359 |
+
if (!isset($credit_card_company)) {
|
360 |
$credit_card_company = $payment->getCcType();
|
361 |
}
|
362 |
+
if (!isset($avs_result_code)) {
|
363 |
$avs_result_code = $payment->getCcAvsStatus();
|
364 |
}
|
365 |
|
366 |
+
if (!isset($credit_card_number)) {
|
367 |
$credit_card_number = "XXXX-XXXX-XXXX-" . $credit_card_number;
|
368 |
}
|
369 |
$credit_card_bin = $payment->getAdditionalInformation('riskified_cc_bin');
|
380 |
|
381 |
private function getLineItems($model) {
|
382 |
$line_items = array();
|
|
|
383 |
foreach ($model->getAllVisibleItems() as $key => $val) {
|
384 |
$line_items[] = new Model\LineItem(array_filter(array(
|
385 |
'price' => $val->getPrice(),
|
516 |
Mage::helper('full/log')->logException($e);
|
517 |
}
|
518 |
}
|
519 |
+
}
|
{lib/riskified_php_sdk/src/Riskified → app/code/community/Riskified/Full/Test}/.DS_Store
RENAMED
Binary file
|
app/code/community/Riskified/Full/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Riskified_Full>
|
5 |
-
<version>1.0.6.
|
6 |
</Riskified_Full>
|
7 |
</modules>
|
8 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Riskified_Full>
|
5 |
+
<version>1.0.6.2</version>
|
6 |
</Riskified_Full>
|
7 |
</modules>
|
8 |
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>riskified_magento</name>
|
4 |
-
<version>1.0.6.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -9,12 +9,14 @@
|
|
9 |
<summary>Riskified Magento extension</summary>
|
10 |
<description>Riskified reviews, approves & guarantees
|
11 |
transactions you would otherwise decline.</description>
|
12 |
-
<notes>*
|
|
|
|
|
13 |
</notes>
|
14 |
<authors><author><name>Riskified_Mage</name><user>Riskified_Mage</user><email>support@riskified.com</email></author></authors>
|
15 |
-
<date>2014-
|
16 |
-
<time>
|
17 |
-
<contents><target name="magecommunity"><dir name="Riskified"><dir name="Full"><dir><dir name="Helper"><file name="Data.php" hash="
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>4.4.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>riskified_magento</name>
|
4 |
+
<version>1.0.6.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
9 |
<summary>Riskified Magento extension</summary>
|
10 |
<description>Riskified reviews, approves & guarantees
|
11 |
transactions you would otherwise decline.</description>
|
12 |
+
<notes>* fix issue with authorize.net that affected some installations.
|
13 |
+
* fix issue with bad/duplicate session identifiers.
|
14 |
+

|
15 |
</notes>
|
16 |
<authors><author><name>Riskified_Mage</name><user>Riskified_Mage</user><email>support@riskified.com</email></author></authors>
|
17 |
+
<date>2014-12-01</date>
|
18 |
+
<time>14:42:54</time>
|
19 |
+
<contents><target name="magecommunity"><dir name="Riskified"><dir name="Full"><dir><dir name="Helper"><file name="Data.php" hash="2d3f448cc5a13b49950826af2cd07148"/><file name="Debug.php" hash="18335d988a142ee639ea59dbecafa15c"/><file name="Log.php" hash="14125243576ab5b08f40066d24b7241d"/><dir name="Order"><file name="Invoice.php" hash="fd6fcbdedd44551785eddd0e1a482e80"/><file name="Status.php" hash="201a5c07c1d0d0b0a15d3bfb94a46d4b"/></dir><file name="Order.php" hash="e6284b5e5c81ccad3293108c2cb68bc5"/></dir><dir name="Model"><file name="Authorizenet.php" hash="bd42f62d06a036b9da7709d2e40fc8f1"/><file name="Cron.php" hash="187b86ebe9238ff132ed0337f05a8ae9"/><file name="Observer.php" hash="06632a84cf031f54d6d706a709a36ee8"/><dir name="Resource"><dir name="Retry"><file name="Collection.php" hash="fd62ad4e4cdd8d372751bfa9988cc3a9"/></dir><file name="Retry.php" hash="3be3db7e54bd8bb45e0faffa1941f515"/></dir><file name="Retry.php" hash="89e7344139affa4fe0b9a252a5d1c592"/><dir name="System"><dir name="Config"><dir name="Source"><file name="ApprovedState.php" hash="5c620d1039347218354bd58c2238ecb4"/><file name="CaptureCase.php" hash="daafa6f53c65fa6e6e7ffbb067dbbbba"/><file name="DeclinedState.php" hash="a00907072c06ade079483e3db03bb94f"/><file name="Env.php" hash="4d923355b3e56fac95c2a9b3c353ab76"/></dir></dir></dir></dir><dir name="Test"><dir name="Config"><file name="General.php" hash="a5d4950c5655960879e7d75c06977941"/></dir><dir name="Helper"><dir name="General"><dir name="fixtures"><file name="extensionConfigEnabled.yaml" hash="eec8c8d8a1d5de49897b19740cf8e074"/></dir></dir><file name="General.php" hash="607c9711656be48084f6688e114b6bf6"/></dir><dir name="Model"><file name="Environments.php" hash="f3fc028d17c82b9b84b709b932e64eae"/></dir><file name=".DS_Store" hash="3c8a9b40165ed36dee5272758bacaf05"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FullController.php" hash="f80e78a808e99f11a7bc00bd02be3f2e"/></dir><file name="ResponseController.php" hash="f94e138bbd1e0b358db4252e8b029390"/></dir><dir name="etc"><file name="config.xml" hash="3d5cb0ac04b5b6bc0cec8e63b6f13226"/><file name="system.xml" hash="9ed5ff1209c08a7babb0e286804c1f9b"/></dir><dir name="sql"><dir name="riskified_full_setup"><file name="mysql4-install-1.0.1.php" hash="6d29dde79353e8bfefa6ea7bc2ef562a"/><file name="mysql4-upgrade-1.0.2.0-1.0.2.1.php" hash="822e85326678a320f141a3ae948e4a24"/><file name="mysql4-upgrade-1.0.4-1.0.5.0.php" hash="557115e1a978d9b194b2cd1cfb8b5a95"/><file name="mysql4-upgrade-1.0.5.5-1.0.6.0.php" hash="0318846fbe8f3e56d8f7d3fdc750e102"/></dir></dir></dir><file name=".DS_Store" hash="3d700965c172761e3d44283ed7b58325"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Riskified_Full.xml" hash="d684caecdf710e5d0173ca07e5c5d1c0"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="full.xml" hash="8dbb3dd16fcb5821eb07e9b5d978d55c"/></dir><dir name="template"><dir name="full"><file name="jsinit.phtml" hash="1fa1a2c756390efab5d74835c14d743e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="full.xml" hash="9497753e5c3d2860062c5446c058b4bc"/></dir><dir name="template"><dir name="full"><file name="riskified.phtml" hash="fe4a577c6ef98316d906c36c17f11406"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="riskified"><file name="logo.jpg" hash="0ac96bf07aa8b8ecb3ff06c2ccbf0827"/></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="riskified_php_sdk"><file name="README.md" hash="f37118baa641e4ef6d670bb1c0298482"/><dir><dir name="sample"><file name="callback.php" hash="e0e206ca3553f2c0922a15a7481cb8f4"/><file name="order_webhook.php" hash="cf8e01be41300977badd171849bf8022"/><file name="run_callback_server.sh" hash="4094bd7d6579f1e5d3a50f8c7b59d5ec"/><file name="upload_historical.php" hash="7ab3a6d71d49067cd612f9ea9b5c4d61"/></dir><dir name="src"><dir name="Riskified"><dir name="Common"><file name="Env.php" hash="84e45f0aa5bd289db005825a8180a10d"/><dir name="Exception"><file name="BaseException.php" hash="6b0c99663a9464b1d94a70647762fbbd"/></dir><file name="Riskified.php" hash="179b51abb6c86b1ca2df4eeb6ce92ea8"/><dir name="Signature"><file name="HttpDataSignature.php" hash="1dd9e2860b72a950129915e31b8098d7"/></dir></dir><dir name="DecisionNotification"><dir name="Exception"><file name="AuthorizationException.php" hash="d0afa3159091dee8dfc2edbf78605e4b"/><file name="BadHeaderException.php" hash="a9ad232eccc5f3fbf2385229b3917fdc"/><file name="BadPostJsonException.php" hash="e9c6c80fc14f61b6f4dc679268cc9a62"/><file name="NotificationException.php" hash="e7471ba97940647607f6d93e04634694"/></dir><dir name="Model"><file name="Notification.php" hash="7a6222da40d7080e6a3f717d8df0bcfe"/></dir></dir><dir name="OrderWebhook"><dir name="Exception"><file name="ClassMismatchPropertyException.php" hash="0b61463eecd2b4b237c50efc90ea5651"/><file name="CurlException.php" hash="c98029e1388f37a891f5beb43518267b"/><file name="FormatMismatchPropertyException.php" hash="d7577cc5fe88341118a489c3e153da63"/><file name="InvalidPropertyException.php" hash="331144340d634a5c100ca9c4f85347c8"/><file name="MalformedJsonException.php" hash="168231cdde49266f7f35b8c122a2aa10"/><file name="MissingPropertyException.php" hash="3f905c4999f3d31b2ee798cbd09cb12f"/><file name="MultiplePropertiesException.php" hash="d6d6e681bed74a479ccf271b2a77a73a"/><file name="PropertyException.php" hash="dbe58dcc08acdc52d5619340257ca193"/><file name="TypeMismatchPropertyException.php" hash="df81b3eb45b8979466dd2bafc205b4e8"/><file name="UnsuccessfulActionException.php" hash="a7c0ceb6ad717fe4aadddd737dc229e9"/></dir><dir name="Model"><file name="AbstractModel.php" hash="e29ec55ba50896ea098fdfd088708dbb"/><file name="Address.php" hash="9aa66915feaa94c38c5e06c7e33bd136"/><file name="Attribute.php" hash="621d144b627f5be7850e14e557397270"/><file name="ClientDetails.php" hash="64257d1b717a9bfd1505f7b647aba488"/><file name="Customer.php" hash="907022894f3ed02029ac5eee839d62a6"/><file name="DiscountCode.php" hash="8c6aedd5ca895deb3df6de23e985f505"/><file name="Fulfillment.php" hash="fc008b1b39f2d459637a1b9d32246ab8"/><file name="LineItem.php" hash="06895618140d24fb8d9f0530d7b5d278"/><file name="Order.php" hash="6d1b11d9d5ccaf405bc8fceb01348519"/><file name="OrderCancellation.php" hash="1cf46df75a02e2e28df30b38518ce11c"/><file name="PaymentDetails.php" hash="a0fd3db455eb045241b3fd9b49ab3a18"/><file name="Refund.php" hash="2730565ede65b148da38cee4b3d28c9c"/><file name="RefundDetails.php" hash="cb307e6893fcb68666d0e00ff1fa52b5"/><file name="ShippingLine.php" hash="67df5f3ae5dc14b0751a0ee1824511cc"/><file name="TaxLine.php" hash="f5ebdea62d786c06766609d9d7aa4fc8"/></dir><dir name="Transport"><file name="AbstractTransport.php" hash="f11f1ec189b2940cd89c01dde0ddfe12"/><file name="CurlTransport.php" hash="50f4f69ef329bcc552b546393d8fe86e"/></dir></dir><file name="autoloader.php" hash="67658efe459a30d30e30f7bb52ccdedf"/></dir></dir></dir><file name=".gitignore" hash="73f01e1298c44b6cc3e24a70cad8c56c"/></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>4.4.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|