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
a1cfbcc3
Commit
a1cfbcc3
authored
Sep 22, 2015
by
rikterbeek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup code, removed test log statements
parent
b0117bac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
95 deletions
+6
-95
app/code/Adyen/Payment/Block/Form/Cc.php
app/code/Adyen/Payment/Block/Form/Cc.php
+0
-3
app/code/Adyen/Payment/Model/Api/PaymentRequest.php
app/code/Adyen/Payment/Model/Api/PaymentRequest.php
+0
-11
app/code/Adyen/Payment/Model/Method/AdyenAbstract.php
app/code/Adyen/Payment/Model/Method/AdyenAbstract.php
+1
-1
app/code/Adyen/Payment/Model/Method/Cc.php
app/code/Adyen/Payment/Model/Method/Cc.php
+0
-29
app/code/Adyen/Payment/Model/Method/Hpp.php
app/code/Adyen/Payment/Model/Method/Hpp.php
+5
-51
No files found.
app/code/Adyen/Payment/Block/Form/Cc.php
View file @
a1cfbcc3
...
...
@@ -52,8 +52,6 @@ class Cc extends \Magento\Payment\Block\Form
parent
::
__construct
(
$context
,
$data
);
$this
->
_paymentConfig
=
$paymentConfig
;
$this
->
logger
=
$logger
;
$this
->
logger
->
critical
(
"IN FORM PHP FILE"
);
}
/**
...
...
@@ -64,7 +62,6 @@ class Cc extends \Magento\Payment\Block\Form
*/
public
function
getCcAvailableTypes
()
{
$this
->
logger
->
critical
(
"TEST"
);
$types
=
$this
->
_paymentConfig
->
getCcTypes
();
if
(
$method
=
$this
->
getMethod
())
{
$availableTypes
=
$method
->
getConfigData
(
'cctypes'
);
...
...
app/code/Adyen/Payment/Model/Api/PaymentRequest.php
View file @
a1cfbcc3
...
...
@@ -73,8 +73,6 @@ class PaymentRequest extends \Magento\Framework\Object
$orderCurrencyCode
=
$order
->
getOrderCurrencyCode
();
$merchantAccount
=
$this
->
getConfigData
(
"merchant_account"
);
$this
->
_logger
->
critical
(
"fullApiRequest1 "
);
$request
=
array
(
"action"
=>
"Payment.authorise"
,
"paymentRequest.merchantAccount"
=>
$merchantAccount
,
...
...
@@ -89,8 +87,6 @@ class PaymentRequest extends \Magento\Framework\Object
"paymentRequest.browserInfo.acceptHeader"
=>
$_SERVER
[
'HTTP_ACCEPT'
]
);
$billingAddress
=
$order
->
getBillingAddress
();
if
(
$billingAddress
)
...
...
@@ -135,10 +131,6 @@ class PaymentRequest extends \Magento\Framework\Object
);
$request
=
array_merge
(
$request
,
$requestCreditCardDetails
);
}
$this
->
_logger
->
critical
(
"fullApiRequest"
);
$this
->
_logger
->
critical
(
print_r
(
$request
,
true
));
return
$this
->
_apiRequest
(
$request
);
}
...
...
@@ -178,9 +170,6 @@ class PaymentRequest extends \Magento\Framework\Object
}
parse_str
(
$results
,
$results
);
$this
->
_logger
->
critical
(
"result is"
.
print_r
(
$results
,
true
));
curl_close
(
$ch
);
return
$results
;
...
...
app/code/Adyen/Payment/Model/Method/AdyenAbstract.php
View file @
a1cfbcc3
...
...
@@ -54,7 +54,7 @@ class AdyenAbstract extends \Magento\Payment\Model\Method\AbstractMethod impleme
*/
public
function
postRequest
(
Object
$request
,
ConfigInterface
$config
)
{
//
TODO: Implement postRequest() method.
//
Not needed only used for global configuration settings
}
...
...
app/code/Adyen/Payment/Model/Method/Cc.php
View file @
a1cfbcc3
...
...
@@ -136,21 +136,12 @@ class Cc extends \Magento\Payment\Model\Method\Cc
{
parent
::
assignData
(
$data
);
$infoInstance
=
$this
->
getInfoInstance
();
$this
->
_logger
->
critical
(
"Assign data!!:"
.
print_r
(
$data
,
true
));
$infoInstance
->
setAdditionalInformation
(
'encrypted_data'
,
$data
[
'encrypted_data'
]);
$this
->
_logger
->
critical
(
"encrypted dat:"
.
$data
[
'encrypted_data'
]);
return
$this
;
}
public
function
authorize
(
\Magento\Payment\Model\InfoInterface
$payment
,
$amount
)
{
$this
->
_logger
->
critical
(
"TEST in authorize FUNTION !!:"
);
if
(
!
$this
->
canAuthorize
())
{
throw
new
\Magento\Framework\Exception\LocalizedException
(
__
(
'The authorize action is not available.'
));
}
...
...
@@ -174,40 +165,21 @@ class Cc extends \Magento\Payment\Model\Method\Cc
public
function
getConfigPaymentAction
()
{
// return $this->getConfigData('payment_action');
$this
->
_logger
->
critical
(
"TEST getConfigPaymentAction !!:"
);
return
\Magento\Payment\Model\Method\AbstractMethod
::
ACTION_AUTHORIZE
;
}
protected
function
_processRequest
(
\Magento\Framework\Object
$payment
,
$amount
,
$request
)
{
switch
(
$request
)
{
case
"authorise"
:
$response
=
$this
->
_paymentRequest
->
fullApiRequest
(
$payment
);
break
;
}
$this
->
_logger
->
critical
(
"HIERRR result is "
.
print_r
(
$response
,
true
));
if
(
!
empty
(
$response
))
{
$this
->
_logger
->
critical
(
"NOT EMPTY "
);
$this
->
_processResponse
(
$payment
,
$response
);
// print_r($response);die();
// $this->_processResponse($payment, $response, $request);
}
else
{
$this
->
_logger
->
critical
(
" EMPTY response"
);
throw
new
\Magento\Framework\Exception\LocalizedException
(
__
(
'Empty result.'
));
}
...
...
@@ -305,7 +277,6 @@ class Cc extends \Magento\Payment\Model\Method\Cc
*/
public
function
getCheckoutRedirectUrl
()
{
$this
->
_logger
->
critical
(
"CHECKOUT URL"
.
$this
->
_urlBuilder
->
getUrl
(
'adyen/process/validate3d/'
));
return
$this
->
_urlBuilder
->
getUrl
(
'adyen/process/validate3d/'
);
}
...
...
app/code/Adyen/Payment/Model/Method/Hpp.php
View file @
a1cfbcc3
...
...
@@ -127,52 +127,13 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
return
$this
->
_paymentMethodType
;
}
public
function
isAvailable
(
$quote
=
null
)
{
$this
->
_logger
->
critical
(
"HPP IS AVAILABLE!! IS TRUE"
);
return
true
;
}
public
function
initialize
(
$paymentAction
,
$stateObject
)
{
$this
->
_logger
->
critical
(
"initialize FROPM HPP Payment action is:"
.
$paymentAction
);
$requestType
=
null
;
switch
(
$paymentAction
)
{
case
self
::
ACTION_AUTHORIZE
:
$requestType
=
self
::
REQUEST_TYPE_AUTH_ONLY
;
//intentional
case
self
::
ACTION_AUTHORIZE_CAPTURE
:
// $requestType = $requestType ?: self::REQUEST_TYPE_AUTH_CAPTURE;
$payment
=
$this
->
getInfoInstance
();
$order
=
$payment
->
getOrder
();
$order
->
setCanSendNewEmailFlag
(
false
);
$payment
->
setBaseAmountAuthorized
(
$order
->
getBaseTotalDue
());
$payment
->
setAmountAuthorized
(
$order
->
getTotalDue
());
// $payment->setAnetTransType($requestType);
break
;
default
:
break
;
}
$state
=
\Magento\Sales\Model\Order
::
STATE_NEW
;
$stateObject
->
setState
(
$state
);
$stateObject
->
setStatus
(
$this
->
_adyenHelper
->
getAdyenAbstractConfigData
(
'order_status'
));
}
/**
* Get config payment action url
* Used to universalize payment actions when processing payment place
*
* @return string
* @api
*/
// public function getConfigPaymentAction()
// {
// // IMPORTANT need to set authorize_capture in config as well
// $this->_logger->critical("TEST getConfigPaymentAction FROM HPP!!:");
// return \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE_CAPTURE;
// }
/**
* Checkout redirect URL getter for onepage checkout (hardcode)
*
...
...
@@ -182,7 +143,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
*/
public
function
getCheckoutRedirectUrl
()
{
// return $this->_urlBuilder->getUrl('paypal/payflowexpress/start');
return
$this
->
_urlBuilder
->
getUrl
(
'adyen/process/redirect'
);
}
...
...
@@ -199,8 +159,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
*/
public
function
postRequest
(
Object
$request
,
ConfigInterface
$config
)
{
$this
->
_logger
->
critical
(
"postRequest"
);
// TODO: Implement postRequest() method.
// Implement postRequest() method.
}
/**
...
...
@@ -285,7 +244,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
mktime
(
date
(
"H"
),
date
(
"i"
),
date
(
"s"
),
date
(
"m"
),
date
(
"j"
)
+
$deliveryDays
,
date
(
"Y"
))
);
$formFields
[
'skinCode'
]
=
$skinCode
;
//
$formFields['shopperLocale'] = $shopperLocale;
$formFields
[
'shopperLocale'
]
=
$shopperLocale
;
$formFields
[
'countryCode'
]
=
$countryCode
;
$formFields
[
'shopperIP'
]
=
$shopperIP
;
$formFields
[
'browserInfo'
]
=
$browserInfo
;
...
...
@@ -301,14 +260,10 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
//blocked methods
$formFields
[
'blockedMethods'
]
=
""
;
$baseUrl
=
$this
->
storeManager
->
getStore
(
$this
->
getStore
())
->
getBaseUrl
(
\Magento\Framework\UrlInterface
::
URL_TYPE_LINK
);
$formFields
[
'resURL'
]
=
$baseUrl
.
'adyen/process/result'
;
// echo $adyFields['resURL'];die();
// $password = Mage::helper('core')->decrypt($this->_getConfigData('notification_password'));
$hmacKey
=
$this
->
_adyenHelper
->
getHmac
();
$brandCode
=
$this
->
getInfoInstance
()
->
getCcType
();
...
...
@@ -316,7 +271,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$formFields
[
'brandCode'
]
=
$brandCode
;
}
// Sort the array by key using SORT_STRING order
ksort
(
$formFields
,
SORT_STRING
);
...
...
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