Skip to content

Commit 7527a1e

Browse files
committed
MAGETWO-53317: Unable to place order within direct payment method from admin
- Solo/Switch cc form related methods are marked as deprecated - Start Year, Start Month and Issue Number fields are removed from cc forms
1 parent a5fa3af commit 7527a1e

File tree

10 files changed

+31
-205
lines changed

10 files changed

+31
-205
lines changed

app/code/Magento/Payment/Block/Form/Cc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public function hasVerification()
108108
/**
109109
* Whether switch/solo card type available
110110
*
111+
* @deprecated
111112
* @return bool
112113
*/
113114
public function hasSsCardType()
@@ -123,6 +124,7 @@ public function hasSsCardType()
123124
/**
124125
* Solo/switch card start year
125126
*
127+
* @deprecated
126128
* @return array
127129
*/
128130
public function getSsStartYears()

app/code/Magento/Payment/Model/CcConfig.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function __construct(
6262
* Solo/switch card start years
6363
*
6464
* @return array
65+
* @deprecated
6566
*/
6667
public function getSsStartYears()
6768
{
@@ -119,6 +120,7 @@ public function hasVerification()
119120
* Whether switch/solo card type available
120121
*
121122
* @return bool
123+
* @deprecated
122124
*/
123125
public function hasSsCardType()
124126
{

app/code/Magento/Payment/Model/CcGenericConfigProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public function getConfig()
5151
'months' => [$methodCode => $this->getCcMonths()],
5252
'years' => [$methodCode => $this->getCcYears()],
5353
'hasVerification' => [$methodCode => $this->hasVerification($methodCode)],
54-
'hasSsCardType' => [$methodCode => $this->hasSsCardType($methodCode)],
55-
'ssStartYears' => [$methodCode => $this->getSsStartYears()],
5654
'cvvImageUrl' => [$methodCode => $this->getCvvImageUrl()]
5755
]
5856
]
@@ -66,6 +64,7 @@ public function getConfig()
6664
* Solo/switch card start years
6765
*
6866
* @return array
67+
* @deprecated
6968
*/
7069
protected function getSsStartYears()
7170
{
@@ -144,6 +143,7 @@ protected function hasVerification($methodCode)
144143
*
145144
* @param string $methodCode
146145
* @return bool
146+
* @deprecated
147147
*/
148148
protected function hasSsCardType($methodCode)
149149
{

app/code/Magento/Payment/Test/Unit/Model/CcConfigTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ protected function setUp()
4444
);
4545
}
4646

47-
public function testGetSsStartYears()
48-
{
49-
$this->assertCount(6, $this->model->getSsStartYears());
50-
$this->assertEquals(date("Y"), $this->model->getSsStartYears()[date("Y")]);
51-
}
52-
5347
public function testGetCcAvailableTypes()
5448
{
5549
$data = [1, 2, 3];
@@ -85,11 +79,6 @@ public function testHasVerification()
8579
$this->assertEquals(true, $this->model->hasVerification());
8680
}
8781

88-
public function testHasSsCardType()
89-
{
90-
$this->assertEquals(false, $this->model->hasSsCardType());
91-
}
92-
9382
public function testGetCvvImageUrl()
9483
{
9584
$params = ['_secure' => true];

app/code/Magento/Payment/view/adminhtml/templates/form/cc.phtml

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -80,72 +80,4 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
8080
</div>
8181
</div>
8282
<?php endif; ?>
83-
84-
<?php if ($block->hasSsCardType()): ?>
85-
<div id="<?php /* @noEscape */ echo $code; ?>_cc_type_ss_div">
86-
<div class="field-type required admin__field _required">
87-
<label class="admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_issue">
88-
<span><?php echo $block->escapeHtml(__('Switch/Solo/Maestro Only')); ?></span>
89-
</label>
90-
</div>
91-
<div class="admin__field field-issue">
92-
<label class="admin__field-label"
93-
for="<?php /* @noEscape */ echo $code; ?>_cc_issue">
94-
<span><?php echo $block->escapeHtml(__('Issue Number')); ?></span>
95-
</label>
96-
97-
<div class="admin__field-control">
98-
<input type="text" title="<?php echo $block->escapeHtml(__('Issue Number')); ?>"
99-
class="validate-cc-ukss cvv admin__control-cvv admin__control-text"
100-
id="<?php /* @noEscape */ echo $code; ?>_cc_issue" name="payment[cc_ss_issue]" value=""/>
101-
</div>
102-
</div>
103-
<div class="field field-date">
104-
<label class="admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_start_month">
105-
<span><?php echo $block->escapeHtml(__('Start Date')); ?></span>
106-
</label>
107-
<div class="admin__field-control">
108-
<select id="<?php /* @noEscape */ echo $code; ?>_start_month" name="payment[cc_ss_start_month]"
109-
class="validate-cc-ukss admin__control-select admin__control-select-month">
110-
<?php foreach ($block->getCcMonths() as $k => $v): ?>
111-
<option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : '' ?>"
112-
<?php if ($k == $block->getInfoData('cc_ss_start_month')): ?> selected="selected"<?php endif ?>>
113-
<?php echo $block->escapeHtml($v); ?>
114-
</option>
115-
<?php endforeach ?>
116-
</select>
117-
<select id="<?php /* @noEscape */ echo $code; ?>_start_year" name="payment[cc_ss_start_year]"
118-
class="validate-cc-ukss admin__control-select admin__control-select-year">
119-
<?php foreach ($block->getSsStartYears() as $k => $v): ?>
120-
<option value="<?php /* @noEscape */ echo $block->escapeHtml($k) ? $k : '' ?>"
121-
<?php if ($k == $block->getInfoData('cc_ss_start_year')): ?> selected="selected"<?php endif ?>>
122-
<?php echo $block->escapeHtml($v); ?>
123-
</option>
124-
<?php endforeach ?>
125-
</select>
126-
</div>
127-
</div>
128-
129-
<div class="adv-container">&nbsp;</div>
130-
131-
<script>
132-
require(['jquery', 'prototype'], function(jQuery){
133-
134-
//<![CDATA[
135-
SSChecked<?php /* @noEscape */ echo $code; ?> = function() {
136-
var elm = $('<?php /* @noEscape */ echo $code; ?>_cc_type');
137-
if (['SS','SM','SO'].indexOf(elm.value) != -1) {
138-
jQuery('#' + '<?php /* @noEscape */ echo $code; ?>_cc_type_ss_div').show().removeClass('ignore-validate');
139-
} else {
140-
jQuery('#' + '<?php /* @noEscape */ echo $code; ?>_cc_type_ss_div').hide().addClass('ignore-validate');
141-
}
142-
};
143-
Event.observe($('<?php /* @noEscape */ echo $code; ?>_cc_type'), 'change', SSChecked<?php /* @noEscape */ echo $code; ?>);
144-
SSChecked<?php /* @noEscape */ echo $code; ?>();
145-
//]]>
146-
147-
});
148-
</script>
149-
</div>
150-
<?php endif; ?>
15183
</fieldset>

app/code/Magento/Payment/view/frontend/templates/form/cc.phtml

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -109,64 +109,5 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
109109
</div>
110110
</div>
111111
<?php endif; ?>
112-
<?php if ($block->hasSsCardType()): ?>
113-
<div class="field switch solo required" id="<?php /* @noEscape */ echo $code; ?>_cc_type_ss_div">
114-
<div class="nested">
115-
<div class="field switch solo required">
116-
<label for="<?php /* @noEscape */ echo $code; ?>_cc_issue" class="label">
117-
<span><?php echo $block->escapeHtml(__('Switch/Solo/Maestro Only')); ?></span>
118-
</label>
119-
</div>
120-
<div class="field number required">
121-
<label for="<?php /* @noEscape */ echo $code; ?>_cc_issue" class="label">
122-
<span><?php echo $block->escapeHtml(__('Issue Number')); ?></span>
123-
</label>
124-
<div class="control">
125-
<input type="text" title="<?php echo $block->escapeHtml(__('Issue Number')); ?>" class="input-text cvv"
126-
id="<?php /* @noEscape */ echo $code; ?>_cc_issue" name="payment[cc_ss_issue]" value=""
127-
data-validate='{"validate-cc-ukss":true}'/>
128-
</div>
129-
</div>
130-
131-
<div class="field date required">
132-
<label for="<?php /* @noEscape */ echo $code; ?>_start_month" class="label">
133-
<span><?php echo $block->escapeHtml(__('Start Date')); ?></span>
134-
</label>
135-
<div class="control">
136-
<div class="fields group group-2">
137-
<div class="field no-label">
138-
<div class="control">
139-
<select id="<?php /* @noEscape */ echo $code; ?>_start_month" name="payment[cc_ss_start_month]"
140-
class="select month" data-validate='{"validate-cc-ukss":true}'>
141-
<?php foreach ($block->getCcMonths() as $k => $v): ?>
142-
<option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : ''; ?>"
143-
<?php if ($k == $block->getInfoData('cc_ss_start_month')): ?> selected="selected"<?php endif; ?>>
144-
<?php echo $block->escapeHtml($v); ?>
145-
</option>
146-
<?php endforeach ?>
147-
</select>
148-
</div>
149-
</div>
150-
<div class="field no-label">
151-
<div class="control">
152-
<select id="<?php /* @noEscape */ echo $code; ?>_start_year"
153-
name="payment[cc_ss_start_year]" class="select year"
154-
data-validate='{"validate-cc-ukss":true}'>
155-
<?php foreach ($block->getSsStartYears() as $k => $v): ?>
156-
<option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : ''; ?>"
157-
<?php if ($k == $block->getInfoData('cc_ss_start_year')): ?> selected="selected"<?php endif; ?>>
158-
<?php echo $block->escapeHtml($v); ?>
159-
</option>
160-
<?php endforeach ?>
161-
</select>
162-
</div>
163-
</div>
164-
</div>
165-
</div>
166-
</div>
167-
<div class="adv container" data-validation-msg="validate-cc-ukss">&nbsp;</div>
168-
</div>
169-
</div>
170-
<?php endif; ?>
171112
<?php echo $block->getChildHtml() ?>
172113
</fieldset>

app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -124,66 +124,4 @@
124124
</div>
125125
</div>
126126
<!-- /ko -->
127-
<!-- ko if: (hasSsCardType())-->
128-
<div class="field switch solo required" data-bind="attr: {id: getCode() + '_cc_type_ss_div'}">
129-
<div class="nested">
130-
<div class="field switch-solo required">
131-
<label data-bind="attr: {for: getCode() + '_cc_issue'}" class="label">
132-
<span><!-- ko i18n: 'Switch/Solo/Maestro Only'--><!-- /ko --></span>
133-
</label>
134-
</div>
135-
<div class="field number required">
136-
<label data-bind="attr: {for: getCode() + '_cc_issue'}" class="label">
137-
<span><!-- ko i18n: 'Issue Number'--><!-- /ko --></span>
138-
</label>
139-
<div class="control">
140-
<input type="number" name="payment[cc_ss_issue]"
141-
value=""
142-
class="input-text cvv"
143-
data-bind="attr: {id: getCode() + '_cc_issue', title: $t('Issue Number'), 'data-container': getCode() + '-cc-issue', 'data-validate': JSON.stringify({'validate-cc-ukss':true})}, enable: isActive($parents)"/>
144-
</div>
145-
</div>
146-
147-
<div class="field date required">
148-
<label data-bind="attr: {for: getCode() + '_start_month'}" class="label">
149-
<span><!-- ko i18n: 'Start Date'--><!-- /ko --></span>
150-
</label>
151-
<div class="control">
152-
<div class="fields group group-2">
153-
<div class="field no-label month">
154-
<div class="control">
155-
<select name="payment[cc_ss_start_month]"
156-
class="select select-month"
157-
data-bind="attr: {id: getCode() + '_start_month', 'data-container': getCode() + '-cc-start-month', 'data-validate': JSON.stringify({'validate-cc-ukss':true})},
158-
enable: isActive($parents),
159-
options: getCcMonthsValues(),
160-
optionsValue: 'value',
161-
optionsText: 'month',
162-
optionsCaption: $t('Month'),
163-
value: creditCardSsStartMonth">
164-
</select>
165-
</div>
166-
</div>
167-
<div class="field no-label year">
168-
<div class="control">
169-
<select name="payment[cc_ss_start_year]"
170-
class="select select-year"
171-
data-bind="attr: {id: getCode() + '_start_year', 'data-container': getCode() + '-cc-start-year',
172-
'data-validate': JSON.stringify({'validate-cc-ukss':true})},
173-
enable: isActive($parents),
174-
options: getSsStartYearsValues(),
175-
optionsValue: 'value',
176-
optionsText: 'year',
177-
optionsCaption: $t('Year'),
178-
value: creditCardSsStartYear">
179-
</select>
180-
</div>
181-
</div>
182-
</div>
183-
</div>
184-
</div>
185-
<div class="adv container" data-validation-msg="validate-cc-ukss">&nbsp;</div>
186-
</div>
187-
</div>
188-
<!-- /ko -->
189127
</fieldset>

app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt
110110
* Credit card expiration month.
111111
*/
112112
const CC_EXP_MONTH = 'cc_exp_month';
113-
/*
113+
114+
/**
114115
* Credit card SS start year.
116+
*
117+
* @deprecated
115118
*/
116119
const CC_SS_START_YEAR = 'cc_ss_start_year';
117120
/*
@@ -154,8 +157,11 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt
154157
* Credit card debug response serialized.
155158
*/
156159
const CC_DEBUG_RESPONSE_SERIALIZED = 'cc_debug_response_serialized';
157-
/*
160+
161+
/**
158162
* Credit card SS start month.
163+
*
164+
* @deprecated
159165
*/
160166
const CC_SS_START_MONTH = 'cc_ss_start_month';
161167
/*
@@ -206,8 +212,11 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt
206212
* Credit card debug response body.
207213
*/
208214
const CC_DEBUG_RESPONSE_BODY = 'cc_debug_response_body';
209-
/*
215+
216+
/**
210217
* Credit card SS issue.
218+
*
219+
* @deprecated
211220
*/
212221
const CC_SS_ISSUE = 'cc_ss_issue';
213222
/*
@@ -463,20 +472,23 @@ public function getCcSecureVerify();
463472
* Gets the credit card SS issue for the order payment.
464473
*
465474
* @return string|null Credit card SS issue.
475+
* @deprecated
466476
*/
467477
public function getCcSsIssue();
468478

469479
/**
470480
* Gets the credit card SS start month for the order payment.
471481
*
472482
* @return string|null Credit card SS start month.
483+
* @deprecated
473484
*/
474485
public function getCcSsStartMonth();
475486

476487
/**
477488
* Gets the credit card SS start year for the order payment.
478489
*
479490
* @return string|null Credit card SS start year.
491+
* @deprecated
480492
*/
481493
public function getCcSsStartYear();
482494

app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public function getQuote()
101101
* Whether switch/solo card type available
102102
*
103103
* @return true
104+
* @deprecated
104105
*/
105106
public function hasSsCardType()
106107
{

0 commit comments

Comments
 (0)