Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Adyen Magento2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared Libs
Adyen Magento2
Commits
d459a91b
Commit
d459a91b
authored
Dec 08, 2017
by
basm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PW-261 Removed the detailed refusal reasons
Added frontend CVC validation
parent
b29b1216
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
42 deletions
+32
-42
Gateway/Validator/GeneralResponseValidator.php
Gateway/Validator/GeneralResponseValidator.php
+1
-25
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
...nd/web/js/view/payment/method-renderer/adyen-cc-method.js
+9
-2
view/frontend/web/template/payment/cc-form.html
view/frontend/web/template/payment/cc-form.html
+9
-4
view/frontend/web/template/payment/hpp-form.html
view/frontend/web/template/payment/hpp-form.html
+13
-11
No files found.
Gateway/Validator/GeneralResponseValidator.php
View file @
d459a91b
...
...
@@ -114,31 +114,7 @@ class GeneralResponseValidator extends AbstractValidator
}
break
;
case
"Refused"
:
if
(
$response
[
'refusalReason'
])
{
$refusalReason
=
$response
[
'refusalReason'
];
switch
(
$refusalReason
)
{
case
"Transaction Not Permitted"
:
$errorMsg
=
__
(
'The transaction is not permitted.'
);
break
;
case
"CVC Declined"
:
$errorMsg
=
__
(
'Declined due to the Card Security Code(CVC) being incorrect. Please check your CVC code!'
);
break
;
case
"Restricted Card"
:
$errorMsg
=
__
(
'The card is restricted.'
);
break
;
case
"803 PaymentDetail not found"
:
$errorMsg
=
__
(
'The payment is REFUSED because the saved card is removed. Please try an other payment method.'
);
break
;
case
"Expiry month not set"
:
$errorMsg
=
__
(
'The expiry month is not set. Please check your expiry month!'
);
break
;
default
:
$errorMsg
=
__
(
'The payment is REFUSED.'
);
break
;
}
}
else
{
$errorMsg
=
__
(
'The payment is REFUSED.'
);
}
$errorMsg
=
__
(
'The payment is REFUSED.'
);
// this will result the specific error
throw
new
\Magento\Framework\Exception\LocalizedException
(
__
(
$errorMsg
));
break
;
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
View file @
d459a91b
...
...
@@ -39,6 +39,8 @@ define(
function
(
_
,
$
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
,
customer
,
creditCardData
,
quote
,
ko
,
installments
,
adyenEncrypt
)
{
'
use strict
'
;
var
cvcLength
=
ko
.
observable
(
4
);
return
Component
.
extend
({
defaults
:
{
template
:
'
Adyen_Payment/payment/cc-form
'
,
...
...
@@ -79,9 +81,11 @@ define(
// what card is this ??
var
creditcardType
=
creditCardData
.
creditCard
.
type
;
if
(
creditcardType
)
{
cvcLength
(
4
);
if
(
creditcardType
!=
"
AE
"
){
cvcLength
(
3
);
}
if
(
creditcardType
in
allInstallments
)
{
// get for the creditcard the installments
var
installmentCreditcard
=
allInstallments
[
creditcardType
];
...
...
@@ -125,6 +129,9 @@ define(
}
};
},
getCvcLength
:
function
()
{
return
cvcLength
();
},
isActive
:
function
()
{
return
true
;
},
...
...
view/frontend/web/template/payment/cc-form.html
View file @
d459a91b
...
...
@@ -178,13 +178,18 @@
class=
"input-text cvv"
data-encrypted-name=
"cvc"
value=
""
data-bind=
"attr: {id: getCode() + '_cc_cid',
data-bind=
"attr: {
id: getCode() + '_cc_cid',
title: $t('Card Verification Number'),
'data-container': getCode() + '-cc-cvv',
'data-validate': JSON.stringify({'required-number':true, 'validate-card-cvv':'#' + getCode() + '_cc_type'})},
'data-validate': JSON.stringify({'required-number':true, 'validate-card-cvv':'#' + getCode() + '_cc_type'}),
maxLength : getCvcLength(),
oninput:'javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);'
},
enable: isActive($parents),
value: creditCardVerificationNumber"
data-validate=
"{required:true}"
/>
value: creditCardVerificationNumber"
,
data-validate=
"{required:true}"
/>
<div
class=
"field-tooltip toggle"
>
<span
class=
"field-tooltip-action action-cvv"
tabindex=
"0"
...
...
view/frontend/web/template/payment/hpp-form.html
View file @
d459a91b
...
...
@@ -71,7 +71,7 @@
<!-- ko if: isPaymentMethodOpenInvoiceMethod() -->
<!-- ko if: showGender() -->
<div
class=
"field gender
_type
type required"
>
<div
class=
"field gender type required"
>
<label
data-bind=
"attr: {for: getCode() + '_gender_type'}"
class=
"label"
>
<span>
<!-- ko text: $t('Gender')--><!-- /ko -->
</span>
</label>
...
...
@@ -91,7 +91,7 @@
<!--/ko-->
<!-- ko if: showDob() -->
<div
class=
"field required"
>
<div
class=
"field
dob type
required"
>
<label
data-bind=
"attr: {for: getCode() + '_dob'}"
class=
"label"
>
<span>
<!-- ko text: $t('Date of Birth')--><!-- /ko -->
</span>
</label>
...
...
@@ -112,7 +112,7 @@
<!--/ko-->
<!-- ko if: showTelephone() -->
<div
class=
"field required"
>
<div
class=
"field
telephone type
required"
>
<label
data-bind=
"attr: {for: getCode() + '_telephone'}"
class=
"label"
>
<span>
<!-- ko text: $t('Telephone')--><!-- /ko -->
</span>
</label>
...
...
@@ -120,20 +120,21 @@
<input
type=
"number"
class=
"input-text"
name=
"payment[telephone]"
data-bind=
"
attr: {
id: getCode() + '_telephone',
title: $t('Telephone'),
'data-container': getCode() + '-telephone',
'data-validate': JSON.stringify({'required-number':true })
},
value: telephone"
attr: {
id: getCode() + '_telephone',
title: $t('Telephone'),
'data-container': getCode() + '-telephone',
'data-validate': JSON.stringify({'required-number':true })
},
value: telephone"
data-validate=
"{required:true}"
/>
</div>
</div>
<!--/ko-->
<!-- ko if: showSsn() -->
<div
class=
"field required"
>
<div
class=
"field
ssn type
required"
>
<label
data-bind=
"attr: {for: getCode() + '_ssn'}"
class=
"label"
>
<span>
<!-- ko text: $t('Personal number (last digits)')--><!-- /ko -->
</span>
</label>
...
...
@@ -149,6 +150,7 @@
maxlength : getSsnLength()
},
value: ssn"
data-validate=
"{required:true}"
/>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment