7
7
// @codingStandardsIgnoreFile
8
8
9
9
/**
10
- * @see \Magento\Authorizenet\Block\Directpost\Form
10
+ * @var \Magento\Authorizenet\Block\Transparent\Iframe $block
11
+ * @see \Magento\Authorizenet\Block\Transparent\Iframe
11
12
*/
12
- ?>
13
- <?php
14
- $ _form = $ block ;
15
- $ _code = $ _form -> getMethodCode ( );
16
- $ _method = $ _form -> getMethod ( );
17
- $ _controller = $ block ->getRequest ()-> getControllerName ( );
18
- $ _orderUrl = $ this -> helper ( ' Magento\Authorizenet\Helper\Backend\Data ' )-> getPlaceOrderAdminUrl ( );
13
+ $ code = $ block -> getMethodCode ();
14
+ $ method = $ block -> getMethod ();
15
+ $ controller = $ block-> escapeHtml ( $ block -> getRequest ()-> getControllerName ()) ;
16
+ $ orderUrl = $ block -> escapeUrl ( $ this -> helper ( ' Magento\Authorizenet\Helper\Backend\Data ' )-> getPlaceOrderAdminUrl () );
17
+ $ ccType = $ block -> getInfoData ( ' cc_type ' );
18
+ $ ccExpMonth = $ block ->getInfoData ( ' cc_exp_month ' );
19
+ $ ccExpYear = $ block -> getInfoData ( ' cc_exp_year ' );
19
20
?>
20
21
<!-- IFRAME for request to our server -->
21
- <iframe id="order-directpost-iframe" allowtransparency="true" frameborder="0" name="iframeSubmitOrder" style="display:none;width:100%;background-color:transparent" src="<?php /* @escapeNotVerified */ echo $ block ->getViewFileUrl ('blank.html ' ) ?> "></iframe>
22
+ <iframe id="order-directpost-iframe" allowtransparency="true" frameborder="0" name="iframeSubmitOrder"
23
+ style="display:none;width:100%;background-color:transparent"
24
+ src="<?php /* @noEscape */ echo $ block ->getViewFileUrl ('blank.html ' ); ?> ">
25
+ </iframe>
22
26
<!-- IFRAME for request to Authorize.net -->
23
- <iframe id="directpost-iframe" allowtransparency="true" frameborder="0" name="iframeDirectPost" style="display:none;width:100%;background-color:transparent" src="<?php /* @escapeNotVerified */ echo $ block ->getViewFileUrl ('blank.html ' ) ?> "></iframe>
24
- <fieldset class="admin__fieldset payment-method" id="payment_form_<?php /* @escapeNotVerified */ echo $ _code ?> " style="display:none;">
27
+ <iframe id="directpost-iframe" allowtransparency="true" frameborder="0" name="iframeDirectPost" style="display:none;width:100%;background-color:transparent"
28
+ src="<?php /* @noEscape */ echo $ block ->getViewFileUrl ('blank.html ' ); ?> ">
29
+ </iframe>
30
+ <fieldset class="admin__fieldset payment-method" id="payment_form_<?php /* @noEscape */ echo $ code ; ?> " style="display:none;">
25
31
<div class="admin__field _required">
26
- <label for="<?php /* @escapeNotVerified */ echo $ _code ?> _cc_type"
27
- class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __ ('Credit Card Type ' ) ?> </span></label>
32
+ <label for="<?php /* @noEscape */ echo $ code ; ?> _cc_type" class="admin__field-label">
33
+ <span><?php echo $ block ->escapeHtml (__ ('Credit Card Type ' )); ?> </span>
34
+ </label>
28
35
<div class="admin__field-control">
29
- <select id="<?php /* @escapeNotVerified */ echo $ _code ?> _cc_type"
30
- name="payment[cc_type]"
36
+ <select id="<?php /* @noEscape */ echo $ code ; ?> _cc_type" name="payment[cc_type]"
31
37
class="required-entry validate-cc-type-select admin__control-select">
32
- <?php $ _ccType = $ _form ->getInfoData ('cc_type ' ) ?>
33
38
<option value=""></option>
34
- <?php foreach ($ _form ->getCcAvailableTypes () as $ _typeCode => $ _typeName ): ?>
35
- <option value="<?php /* @escapeNotVerified */ echo $ _typeCode ?> "
36
- <?php if ($ _typeCode == $ _ccType ): ?> selected="selected"<?php endif ?> ><?php /* @escapeNotVerified */ echo $ _typeName ?> </option>
37
- <?php endforeach ?>
39
+ <?php foreach ($ block ->getCcAvailableTypes () as $ typeCode => $ typeName ): ?>
40
+ <option value="<?php echo $ block ->escapeHtml ($ typeCode ); ?> "
41
+ <?php if ($ typeCode == $ ccType ): ?> selected="selected"<?php endif ; ?> >
42
+ <?php echo $ block ->escapeHtml ($ typeName ); ?>
43
+ </option>
44
+ <?php endforeach ; ?>
38
45
</select>
39
46
</div>
40
47
</div>
41
48
<div class="admin__field _required">
42
- <label for="<?php /* @escapeNotVerified */ echo $ _code ?> _cc_number"
43
- class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __ ('Credit Card Number ' ) ?> </span></label>
49
+ <label for="<?php /* @noEscape */ echo $ code ; ?> _cc_number" class="admin__field-label">
50
+ <span><?php echo $ block ->escapeHtml (__ ('Credit Card Number ' )); ?> </span>
51
+ </label>
44
52
45
53
<div class="admin__field-control">
46
- <input type="text" id="<?php /* @escapeNotVerified */ echo $ _code ?> _cc_number"
54
+ <input type="text" id="<?php /* @noEscape */ echo $ code ; ?> _cc_number"
47
55
name="payment[cc_number]"
48
56
class="input-text required-entry validate-cc-number admin__control-text"
49
- value="<?php /* @escapeNotVerified */ echo $ block ->getInfoData ('cc_number ' ) ?> "/>
57
+ value="<?php /* @noEscape */ echo $ block ->getInfoData ('cc_number ' ); ?> "/>
50
58
</div>
51
59
</div>
52
60
<div class="admin__field _required">
53
- <label for="<?php /* @escapeNotVerified */ echo $ _code ?> _expiration"
54
- class="admin__field-label"><span><?php /* @escapeNotVerified */ echo __ ('Expiration Date ' ) ?> </span></label>
61
+ <label for="<?php /* @noEscape */ echo $ code ; ?> _expiration" class="admin__field-label">
62
+ <span><?php echo $ block ->escapeHtml (__ ('Expiration Date ' )); ?> </span>
63
+ </label>
55
64
56
65
<div class="admin__field-control">
57
- <select id="<?php /* @escapeNotVerified */ echo $ _code ?> _expiration"
66
+ <select id="<?php /* @noEscape */ echo $ code ; ?> _expiration"
58
67
name="payment[cc_exp_month]"
59
68
class="validate-cc-exp required-entry admin__control-select admin__control-select-month">
60
- <?php $ _ccExpMonth = $ _form ->getInfoData ('cc_exp_month ' ) ?>
61
- <?php foreach ($ _form ->getCcMonths () as $ k => $ v ): ?>
62
- <option value="<?php /* @escapeNotVerified */ echo $ k ?> "
63
- <?php if ($ k == $ _ccExpMonth ): ?> selected="selected"<?php endif ?> ><?php /* @escapeNotVerified */ echo $ v ?> </option>
64
- <?php endforeach ?>
69
+ <?php foreach ($ block ->getCcMonths () as $ k => $ v ): ?>
70
+ <option value="<?php echo $ block ->escapeHtml ($ k ); ?> "
71
+ <?php if ($ k == $ ccExpMonth ): ?> selected="selected"<?php endif ; ?> >
72
+ <?php echo $ block ->escapeHtml ($ v ); ?>
73
+ </option>
74
+ <?php endforeach ; ?>
65
75
</select>
66
- <?php $ _ccExpYear = $ _form ->getInfoData ('cc_exp_year ' ) ?>
67
- <select id="<?php /* @escapeNotVerified */ echo $ _code ?> _expiration_yr"
76
+ <select id="<?php /* @noEscape */ echo $ code ; ?> _expiration_yr"
68
77
name="payment[cc_exp_year]"
69
78
class="required-entry admin__control-select admin__control-select-year">
70
- <?php foreach ($ _form ->getCcYears () as $ k => $ v ): ?>
71
- <option value="<?php /* @escapeNotVerified */ echo $ k ? $ k : '' ?> "
72
- <?php if ($ k == $ _ccExpYear ): ?> selected="selected"<?php endif ?> ><?php /* @escapeNotVerified */ echo $ v ?> </option>
79
+ <?php foreach ($ block ->getCcYears () as $ k => $ v ): ?>
80
+ <option value="<?php /* @noEscape */ echo $ k ? $ block ->escapeHtml ($ k ) : '' ; ?> "
81
+ <?php if ($ k == $ ccExpYear ): ?> selected="selected"<?php endif ; ?> >
82
+ <?php echo $ block ->escapeHtml ($ v ); ?>
83
+ </option>
73
84
<?php endforeach ?>
74
85
</select>
75
86
</div>
76
87
</div>
77
88
<?php if ($ _form ->hasVerification ()): ?>
78
89
<div class="admin__field _required">
79
- <label for="<?php /* @escapeNotVerified */ echo $ _code ?> _cc_cid"><span><?php /* @escapeNotVerified */ echo __ ('Card Verification Number ' ) ?> </span></label>
90
+ <label for="<?php /* @noEscape */ echo $ code ; ?> _cc_cid">
91
+ <span><?php echo $ block ->escapeHtml (__ ('Card Verification Number ' )); ?> </span>
92
+ </label>
80
93
81
94
<div class="admin__field-control">
82
95
<input type="text"
83
96
class="required-entry input-text validate-cc-cvn admin__control-text"
84
- id="<?php /* @escapeNotVerified */ echo $ _code ?> _cc_cid" name="payment[cc_cid]"
85
- value="<?php /* @escapeNotVerified */ echo $ block ->getInfoData ('cc_cid ' ) ?> "/>
97
+ id="<?php /* @noEscape */ echo $ code ; ?> _cc_cid" name="payment[cc_cid]"
98
+ value="<?php /* @noEscape */ echo $ block ->getInfoData ('cc_cid ' ) ?> "/>
86
99
</div>
87
100
</div>
88
101
<?php endif ; ?>
@@ -98,19 +111,19 @@ $_orderUrl = $this->helper('Magento\Authorizenet\Helper\Backend\Data')->getPlace
98
111
/**
99
112
* Disable card server validation in admin
100
113
*/
101
- order.addExcludedPaymentMethod('<?php /* @escapeNotVerified */ echo $ _code ?> ');
114
+ order.addExcludedPaymentMethod('<?php /* @noEscape */ echo $ code ; ?> ');
102
115
103
116
<?php if (!$ block ->isAjaxRequest ()): ?>
104
117
document.observe('dom:loaded', function(){
105
118
<?php endif ; ?>
106
119
107
120
directPostModel = new directPost(
108
- '<?php /* @escapeNotVerified */ echo $ _code ?> ',
121
+ '<?php /* @noEscape */ echo $ code ; ?> ',
109
122
'directpost-iframe',
110
- '<?php /* @escapeNotVerified */ echo $ _controller ?> ',
111
- '<?php /* @escapeNotVerified */ echo $ _orderUrl ?> ',
112
- '<?php /* @escapeNotVerified */ echo $ _method -> getCgiUrl () ?> ',
113
- '<?php /* @escapeNotVerified */ echo $ block ->getUrl ('*/*/save ' , ['_secure ' => $ block ->getRequest ()->isSecure ()]) ?> ');
123
+ '<?php /* @noEscape */ echo $ controller ; ?> ',
124
+ '<?php /* @noEscape */ echo $ orderUrl ; ?> ',
125
+ '<?php echo $ block -> escapeUrl ( $ method -> getCgiUrl ()); ?> ',
126
+ '<?php /* @noEscape */ echo $ block ->getUrl ('*/*/save ' , ['_secure ' => $ block ->getRequest ()->isSecure ()]) ?> ');
114
127
115
128
<?php if (!$ block ->isAjaxRequest ()): ?>
116
129
});
0 commit comments