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
38b1c397
Commit
38b1c397
authored
Nov 01, 2018
by
attilak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes based on code review
parent
d8991b0b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
327 deletions
+50
-327
Gateway/Http/Client/TransactionPayment.php
Gateway/Http/Client/TransactionPayment.php
+3
-9
Helper/Data.php
Helper/Data.php
+18
-6
view/frontend/web/css/styles.css
view/frontend/web/css/styles.css
+4
-0
view/frontend/web/js/adyen.checkout.js
view/frontend/web/js/adyen.checkout.js
+0
-287
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
...nd/web/js/view/payment/method-renderer/adyen-cc-method.js
+1
-2
view/frontend/web/template/payment/cc-form.html
view/frontend/web/template/payment/cc-form.html
+24
-23
No files found.
Gateway/Http/Client/TransactionPayment.php
View file @
38b1c397
...
...
@@ -30,12 +30,6 @@ use Magento\Payment\Gateway\Http\ClientInterface;
*/
class
TransactionPayment
implements
ClientInterface
{
/**
* @var \Adyen\Client
*/
protected
$client
;
/**
* PaymentRequest constructor.
*
...
...
@@ -59,8 +53,6 @@ class TransactionPayment implements ClientInterface
$this
->
_adyenLogger
=
$adyenLogger
;
$this
->
_recurringType
=
$recurringType
;
$this
->
_appState
=
$context
->
getAppState
();
$this
->
client
=
$this
->
_adyenHelper
->
initializeAdyenClient
();
}
/**
...
...
@@ -72,7 +64,9 @@ class TransactionPayment implements ClientInterface
{
$request
=
$transferObject
->
getBody
();
$service
=
new
\Adyen\Service\Checkout
(
$this
->
client
);
$client
=
$this
->
_adyenHelper
->
initializeAdyenClient
();
$service
=
new
\Adyen\Service\Checkout
(
$client
);
try
{
$response
=
$service
->
payments
(
$request
);
...
...
Helper/Data.php
View file @
38b1c397
...
...
@@ -1175,7 +1175,7 @@ class Data extends AbstractHelper
// initialize client
$apiKey
=
$this
->
getAPIKey
(
$storeId
);
$client
=
new
\Adyen\
Client
();
$client
=
$this
->
createAdyen
Client
();
$client
->
setApplicationName
(
"Magento 2 plugin"
);
$client
->
setXApiKey
(
$apiKey
);
...
...
@@ -1194,6 +1194,14 @@ class Data extends AbstractHelper
return
$client
;
}
/**
* @return \Adyen\Client
* @throws \Adyen\AdyenException
*/
private
function
createAdyenClient
()
{
return
new
\Adyen\Client
();
}
/**
* Retrieve origin keys for platform's base url
*
...
...
@@ -1209,8 +1217,7 @@ class Data extends AbstractHelper
if
(
!
$originKey
=
$this
->
cache
->
load
(
"Adyen_origin_key_for_"
.
$domain
))
{
$originKey
=
""
;
if
(
$originKeys
=
$this
->
getOriginKeys
(
$domain
))
{
$originKey
=
$originKeys
[
$domain
];
if
(
$originKey
=
$this
->
getOriginKeyForUrl
(
$domain
))
{
$this
->
cache
->
save
(
$originKey
,
"Adyen_origin_key_for_"
.
$domain
,
array
(),
60
*
60
*
24
);
}
}
...
...
@@ -1219,13 +1226,13 @@ class Data extends AbstractHelper
}
/**
* Get origin key
s
for a specific url using the adyen api library client
* Get origin key for a specific url using the adyen api library client
*
* @param $url
* @return mixed
* @throws \Adyen\AdyenException
*/
private
function
getOriginKey
s
(
$url
)
private
function
getOriginKey
ForUrl
(
$url
)
{
$params
=
array
(
"originDomains"
=>
array
(
...
...
@@ -1237,7 +1244,12 @@ class Data extends AbstractHelper
$service
=
$this
->
adyenServiceFactory
->
createCheckoutUtility
(
$client
);
$respone
=
$service
->
originKeys
(
$params
);
return
$respone
[
'originKeys'
];
if
(
empty
(
$originKey
=
$respone
[
'originKeys'
][
$url
]))
{
$originKey
=
""
;
}
return
$originKey
;
}
/**
...
...
view/frontend/web/css/styles.css
View file @
38b1c397
...
...
@@ -174,6 +174,10 @@
font-weight
:
400
;
}
#adyen-cc-form
.fieldset
>
.holdername.field
{
margin-bottom
:
10px
;
}
#adyen-cc-form
.helper-text
{
font-size
:
11px
;
color
:
rgb
(
144
,
162
,
189
);
...
...
view/frontend/web/js/adyen.checkout.js
deleted
100644 → 0
View file @
d8991b0b
This diff is collapsed.
Click to expand it.
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
View file @
38b1c397
...
...
@@ -30,8 +30,7 @@ define(
'
Magento_Checkout/js/model/quote
'
,
'
Adyen_Payment/js/model/installments
'
,
'
mage/url
'
,
'
Adyen_Payment/js/adyen.2.0.0
'
,
'
Adyen_Payment/js/adyen.checkout
'
'
Adyen_Payment/js/adyen.2.0.0
'
],
function
(
$
,
ko
,
Component
,
customer
,
creditCardData
,
additionalValidators
,
quote
,
installments
,
url
)
{
...
...
view/frontend/web/template/payment/cc-form.html
View file @
38b1c397
...
...
@@ -68,29 +68,6 @@
<br/>
<!-- /ko -->
<div
class=
"field holdername type"
>
<label
data-bind=
"attr: {for: 'creditCardHolderName'}"
class=
"label"
>
<span>
<!-- ko text: $t('Credit Card Owner')--><!-- /ko -->
</span>
</label>
<div
class=
"control"
>
<input
type=
"text"
class=
"input-text required-entry"
data-encrypted-name=
"holderName"
value=
""
data-bind=
"attr: {
id: 'creditCardHolderName',
title: $t('Credit Card Owner'),
placeholder: $t('Credit Card Owner'),
'data-container': getCode() + '-cc-owner'
},
enable: isActive($parents),
value: creditCardOwner,
valueUpdate: 'keyup' "
data-validate=
"{required:true}"
/>
</div>
</div>
<div
class=
"field type"
>
<label
data-bind=
"attr: {for: getCode() + '_cc_type'}"
class=
"label"
>
<span>
<!-- ko text: $t('Credit Card Type')--><!-- /ko -->
</span>
...
...
@@ -120,6 +97,30 @@
"
>
</div>
</div>
<div
class=
"field holdername type"
>
<label
data-bind=
"attr: {for: 'creditCardHolderName'}"
class=
"label"
>
<span>
<!-- ko text: $t('Credit Card Owner')--><!-- /ko -->
</span>
</label>
<div
class=
"control"
>
<input
type=
"text"
class=
"input-text required-entry"
data-encrypted-name=
"holderName"
value=
""
data-bind=
"attr: {
id: 'creditCardHolderName',
title: $t('Credit Card Owner'),
placeholder: $t('Credit Card Owner'),
'data-container': getCode() + '-cc-owner'
},
enable: isActive($parents),
value: creditCardOwner,
valueUpdate: 'keyup' "
data-validate=
"{required:true}"
/>
</div>
</div>
<div
class=
"field number cardContainerField"
>
<div
afterRender=
"renderSecureFields()"
data-bind=
"attr: { id: 'cardContainer'}"
></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