File tree Expand file tree Collapse file tree 13 files changed +865
-13
lines changed
app/code/Magento/Authorizenet
functional/tests/app/Magento
Authorizenet/Test/Repository
Sales/Test/Block/Adminhtml/Order/View
integration/testsuite/Magento/Authorizenet
Controller/Directpost/Payment Expand file tree Collapse file tree 13 files changed +865
-13
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ protected function _responseAction($area = 'frontend')
73
73
$ helper = $ this ->dataFactory ->create ($ area );
74
74
75
75
$ params = [];
76
- $ data = $ this ->getRequest ()->getPostValue ();
76
+ $ data = $ this ->getRequest ()->getParams ();
77
+
77
78
/* @var $paymentMethod \Magento\Authorizenet\Model\DirectPost */
78
79
$ paymentMethod = $ this ->_objectManager ->create ('Magento\Authorizenet\Model\Directpost ' );
79
80
@@ -110,9 +111,8 @@ protected function _responseAction($area = 'frontend')
110
111
$ params ['redirect ' ] = $ helper ->getRedirectIframeUrl ($ result );
111
112
}
112
113
114
+ //registering parameter for iframe content
113
115
$ this ->_coreRegistry ->register (Iframe::REGISTRY_KEY , $ params );
114
- $ this ->_view ->addPageLayoutHandles ();
115
- $ this ->_view ->loadLayout (false )->renderLayout ();
116
116
}
117
117
118
118
/**
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public function __construct(
52
52
* Response action.
53
53
* Action for Authorize.net SIM Relay Request.
54
54
*
55
- * @return void
55
+ * @return \Magento\Framework\Controller\ResultInterface
56
56
*/
57
57
public function execute ()
58
58
{
@@ -67,10 +67,11 @@ public function execute()
67
67
$ paymentMethod ->validateResponse ();
68
68
} catch (LocalizedException $ e ) {
69
69
$ this ->logger ->critical ($ e ->getMessage ());
70
- $ this -> _redirect ( ' noroute ' );
71
- return ;
70
+
71
+ return $ this -> _redirect ( ' noroute ' ) ;
72
72
}
73
73
$ this ->_responseAction ('adminhtml ' );
74
- $ this ->resultFactory ->create (ResultFactory::TYPE_PAGE );
74
+
75
+ return $ this ->resultFactory ->create (ResultFactory::TYPE_PAGE );
75
76
}
76
77
}
Original file line number Diff line number Diff line change @@ -12,10 +12,12 @@ class Response extends \Magento\Authorizenet\Controller\Directpost\Payment
12
12
* Response action.
13
13
* Action for Authorize.net SIM Relay Request.
14
14
*
15
- * @return void
15
+ * @return \Magento\Framework\Controller\ResultInterface
16
16
*/
17
17
public function execute ()
18
18
{
19
19
$ this ->_responseAction ('frontend ' );
20
+
21
+ return $ this ->resultFactory ->create (\Magento \Framework \Controller \ResultFactory::TYPE_PAGE );
20
22
}
21
23
}
Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ protected function buildRequest(\Magento\Framework\DataObject $payment)
332
332
->setXCity ($ billing ->getCity ())
333
333
->setXState ($ billing ->getRegion ())
334
334
->setXZip ($ billing ->getPostcode ())
335
- ->setXCountry ($ billing ->getCountry ())
335
+ ->setXCountry ($ billing ->getCountryId ())
336
336
->setXPhone ($ billing ->getTelephone ())
337
337
->setXFax ($ billing ->getFax ())
338
338
->setXCustId ($ order ->getCustomerId ())
@@ -352,7 +352,7 @@ protected function buildRequest(\Magento\Framework\DataObject $payment)
352
352
->setXShipToCity ($ shipping ->getCity ())
353
353
->setXShipToState ($ shipping ->getRegion ())
354
354
->setXShipToZip ($ shipping ->getPostcode ())
355
- ->setXShipToCountry ($ shipping ->getCountry ());
355
+ ->setXShipToCountry ($ shipping ->getCountryId ());
356
356
}
357
357
358
358
$ request ->setXPoNum ($ payment ->getPoNumber ())
Original file line number Diff line number Diff line change @@ -747,7 +747,11 @@ protected function processPaymentFraudStatus(\Magento\Sales\Model\Order\Payment
747
747
return $ this ;
748
748
}
749
749
750
- $ payment ->setIsFraudDetected (true );
750
+ $ fdsFilterAction = (string )$ fraudDetailsResponse ->getFdsFilterAction ();
751
+ if ($ this ->fdsFilterActionIsReportOnly ($ fdsFilterAction ) === false ) {
752
+ $ payment ->setIsFraudDetected (true );
753
+ }
754
+
751
755
$ payment ->setAdditionalInformation ('fraud_details ' , $ fraudData );
752
756
} catch (\Exception $ e ) {
753
757
//this request is optional
@@ -993,4 +997,16 @@ private function getPsrLogger()
993
997
}
994
998
return $ this ->psrLogger ;
995
999
}
1000
+
1001
+ /**
1002
+ * Checks if filter action is Report Only. Transactions that trigger this filter are processed as normal,
1003
+ * but are also reported in the Merchant Interface as triggering this filter.
1004
+ *
1005
+ * @param string $fdsFilterAction
1006
+ * @return bool
1007
+ */
1008
+ private function fdsFilterActionIsReportOnly ($ fdsFilterAction )
1009
+ {
1010
+ return $ fdsFilterAction === (string )$ this ->dataHelper ->getFdsFilterActionLabel ('report ' );
1011
+ }
996
1012
}
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ public function setDataFromOrder(
123
123
->setXCity (strval ($ billing ->getCity ()))
124
124
->setXState (strval ($ billing ->getRegion ()))
125
125
->setXZip (strval ($ billing ->getPostcode ()))
126
- ->setXCountry (strval ($ billing ->getCountry ()))
126
+ ->setXCountry (strval ($ billing ->getCountryId ()))
127
127
->setXPhone (strval ($ billing ->getTelephone ()))
128
128
->setXFax (strval ($ billing ->getFax ()))
129
129
->setXCustId (strval ($ billing ->getCustomerId ()))
@@ -151,7 +151,7 @@ public function setDataFromOrder(
151
151
)->setXShipToZip (
152
152
strval ($ shipping ->getPostcode ())
153
153
)->setXShipToCountry (
154
- strval ($ shipping ->getCountry ())
154
+ strval ($ shipping ->getCountryId ())
155
155
);
156
156
}
157
157
Original file line number Diff line number Diff line change 71
71
<item name =" value" xsi : type =" number" >0</item >
72
72
</field >
73
73
</dataset >
74
+ <dataset name =" authorizenet_authorize_capture" >
75
+ <field name =" payment/authorizenet_directpost/payment_action" xsi : type =" array" >
76
+ <item name =" scope" xsi : type =" string" >payment</item >
77
+ <item name =" scope_id" xsi : type =" number" >1</item >
78
+ <item name =" label" xsi : type =" string" />
79
+ <item name =" value" xsi : type =" string" >authorize_capture</item >
80
+ </field >
81
+ </dataset >
82
+ <dataset name =" authorizenet_authorize_capture_rollback" >
83
+ <field name =" payment/authorizenet_directpost/payment_action" xsi : type =" array" >
84
+ <item name =" scope" xsi : type =" string" >payment</item >
85
+ <item name =" scope_id" xsi : type =" number" >1</item >
86
+ <item name =" label" xsi : type =" string" />
87
+ <item name =" value" xsi : type =" string" >authorize</item >
88
+ </field >
89
+ </dataset >
74
90
</repository >
75
91
</config >
Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ class Info extends Block
29
29
*/
30
30
protected $ group = '//th[text()="Customer Group"]/following-sibling::* ' ;
31
31
32
+ /**
33
+ * Item options.
34
+ *
35
+ * @var string
36
+ */
37
+ protected $ itemOptions = '//div[@class= \'product-sku-block \' and contains(normalize-space(.), \'{SKU} \')] '
38
+ . '/following-sibling::*[@class="item-options"] ' ;
39
+
32
40
/**
33
41
* Get email from the data inside block
34
42
*
@@ -48,4 +56,29 @@ public function getCustomerGroup()
48
56
{
49
57
return $ this ->_rootElement ->find ($ this ->group , Locator::SELECTOR_XPATH )->getText ();
50
58
}
59
+
60
+ /**
61
+ * Get Product options.
62
+ *
63
+ * @param string $sku
64
+ * @return array
65
+ */
66
+ public function getProductOptions ($ sku )
67
+ {
68
+ $ selector = str_replace ('{SKU} ' , $ sku , $ this ->itemOptions );
69
+ $ productOption = $ this ->_rootElement ->find ($ selector , Locator::SELECTOR_XPATH );
70
+ $ result = [];
71
+ if ($ productOption ->isVisible ()) {
72
+ $ keyItem = $ productOption ->getElements ('dt ' );
73
+ $ valueItem = $ productOption ->getElements ('dd ' );
74
+ foreach ($ keyItem as $ key => $ item ) {
75
+ $ result [$ item ->getText ()] = null ;
76
+ if (isset ($ valueItem [$ key ])) {
77
+ $ result [$ item ->getText ()] = $ valueItem [$ key ]->getText ();
78
+ }
79
+ }
80
+ }
81
+
82
+ return $ result ;
83
+ }
51
84
}
You can’t perform that action at this time.
0 commit comments