File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,18 @@ class CIMAuthorizeRequest extends CIMAbstractRequest
1414 public function getData ()
1515 {
1616 $ this ->validate ('cardReference ' , 'amount ' );
17-
1817 $ data = $ this ->getBaseData ();
19-
2018 $ this ->addTransactionData ($ data );
19+ $ this ->addExtraOptions ($ data );
20+ return $ data ;
21+ }
22+
23+ private function addExtraOptions (\SimpleXMLElement $ data )
24+ {
25+ $ extraOptions = $ data ->addChild ('extraOptions ' );
26+ $ node = dom_import_simplexml ($ extraOptions );
27+ $ nodeOwner = $ node ->ownerDocument ;
28+ $ node ->appendChild ($ nodeOwner ->createCDATASection ("x_duplicate_window=0 " ));
2129 return $ data ;
2230 }
2331
@@ -45,7 +53,6 @@ protected function addTransactionData(\SimpleXMLElement $data)
4553 if (!empty ($ desc )) {
4654 $ action ->order ->description = $ desc ;
4755 }
48-
4956 return $ data ;
5057 }
5158
Original file line number Diff line number Diff line change @@ -31,4 +31,10 @@ public function testGetData()
3131 $ this ->assertEquals ('27057151 ' , $ data ->transaction ->profileTransAuthOnly ->customerShippingAddressId );
3232 $ this ->assertEquals ('Test authorize transaction ' , $ data ->transaction ->profileTransAuthOnly ->order ->description );
3333 }
34+
35+ public function testShouldReturnExtraOptionsToDisableDuplicateWindowPeriod ()
36+ {
37+ $ data = $ this ->request ->getData ();
38+ $ this ->assertEquals ('x_duplicate_window=0 ' , strip_tags ($ data ->extraOptions ));
39+ }
3440}
You can’t perform that action at this time.
0 commit comments