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
482fd41f
Commit
482fd41f
authored
Jul 25, 2016
by
Rik ter Beek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#67 Adyen Sepa is now using Facade implementation
parent
830f0edc
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
2147 additions
and
389 deletions
+2147
-389
Gateway/Config/SepaConfig.php
Gateway/Config/SepaConfig.php
+41
-0
Gateway/Http/Client/TransactionAuthorization.php
Gateway/Http/Client/TransactionAuthorization.php
+104
-0
Gateway/Http/Client/TransactionCancel.php
Gateway/Http/Client/TransactionCancel.php
+98
-0
Gateway/Http/Client/TransactionCapture.php
Gateway/Http/Client/TransactionCapture.php
+98
-0
Gateway/Http/Client/TransactionRefund.php
Gateway/Http/Client/TransactionRefund.php
+98
-0
Gateway/Http/TransferFactory.php
Gateway/Http/TransferFactory.php
+59
-0
Gateway/Request/AddressDataBuilder.php
Gateway/Request/AddressDataBuilder.php
+104
-0
Gateway/Request/CancelDataBuilder.php
Gateway/Request/CancelDataBuilder.php
+68
-0
Gateway/Request/CaptureDataBuilder.php
Gateway/Request/CaptureDataBuilder.php
+77
-0
Gateway/Request/CustomerDataBuilder.php
Gateway/Request/CustomerDataBuilder.php
+62
-0
Gateway/Request/MerchantAccountDataBuilder.php
Gateway/Request/MerchantAccountDataBuilder.php
+60
-0
Gateway/Request/PaymentDataBuilder.php
Gateway/Request/PaymentDataBuilder.php
+72
-0
Gateway/Request/RecurringDataBuilder.php
Gateway/Request/RecurringDataBuilder.php
+105
-0
Gateway/Request/RefundDataBuilder.php
Gateway/Request/RefundDataBuilder.php
+77
-0
Gateway/Request/SepaAuthorizationBuilder.php
Gateway/Request/SepaAuthorizationBuilder.php
+54
-0
Gateway/Response/PaymentAuthorisationDetailsHandler.php
Gateway/Response/PaymentAuthorisationDetailsHandler.php
+58
-0
Gateway/Response/PaymentCancelDetailsHandler.php
Gateway/Response/PaymentCancelDetailsHandler.php
+48
-0
Gateway/Response/PaymentCaptureDetailsHandler.php
Gateway/Response/PaymentCaptureDetailsHandler.php
+51
-0
Gateway/Response/PaymentCommentHistoryHandler.php
Gateway/Response/PaymentCommentHistoryHandler.php
+68
-0
Gateway/Response/PaymentRefundDetailsHandler.php
Gateway/Response/PaymentRefundDetailsHandler.php
+52
-0
Gateway/Validator/CancelResponseValidator.php
Gateway/Validator/CancelResponseValidator.php
+49
-0
Gateway/Validator/CaptureResponseValidator.php
Gateway/Validator/CaptureResponseValidator.php
+49
-0
Gateway/Validator/GeneralResponseValidator.php
Gateway/Validator/GeneralResponseValidator.php
+68
-0
Gateway/Validator/RefundResponseValidator.php
Gateway/Validator/RefundResponseValidator.php
+48
-0
Gateway/Validator/SepaValidator.php
Gateway/Validator/SepaValidator.php
+116
-0
Model/AdyenGenericConfigProvider.php
Model/AdyenGenericConfigProvider.php
+1
-1
Model/Cron.php
Model/Cron.php
+3
-3
Model/Method/Sepa.php
Model/Method/Sepa.php
+0
-363
Model/Ui/AdyenSepaConfigProvider.php
Model/Ui/AdyenSepaConfigProvider.php
+39
-18
Observer/AdyenSepaDataAssignObserver.php
Observer/AdyenSepaDataAssignObserver.php
+73
-0
etc/config.xml
etc/config.xml
+11
-1
etc/di.xml
etc/di.xml
+195
-0
etc/events.xml
etc/events.xml
+29
-0
etc/frontend/di.xml
etc/frontend/di.xml
+1
-1
view/frontend/web/js/view/payment/method-renderer/adyen-sepa-method.js
.../web/js/view/payment/method-renderer/adyen-sepa-method.js
+11
-2
No files found.
Gateway/Config/SepaConfig.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Config
;
/**
* Class Config
*/
class
SepaConfig
extends
\Magento\Payment\Gateway\Config\Config
{
const
KEY_ACTIVE
=
'active'
;
/**
* Get Payment configuration status
* @return bool
*/
public
function
isActive
()
{
return
(
bool
)
$this
->
getValue
(
self
::
KEY_ACTIVE
);
}
}
Gateway/Http/Client/TransactionAuthorization.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Http\Client
;
use
Magento\Payment\Gateway\Http\ClientInterface
;
/**
* Class TransactionSale
*/
class
TransactionAuthorization
implements
ClientInterface
{
/**
* @var \Adyen\Client
*/
protected
$_client
;
/**
* PaymentRequest constructor.
*
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType
* @param array $data
*/
public
function
__construct
(
\Magento\Framework\Model\Context
$context
,
\Magento\Framework\Encryption\EncryptorInterface
$encryptor
,
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Adyen\Payment\Model\RecurringType
$recurringType
,
array
$data
=
[]
)
{
$this
->
_encryptor
=
$encryptor
;
$this
->
_adyenHelper
=
$adyenHelper
;
$this
->
_adyenLogger
=
$adyenLogger
;
$this
->
_recurringType
=
$recurringType
;
$this
->
_appState
=
$context
->
getAppState
();
// initialize client
$webserviceUsername
=
$this
->
_adyenHelper
->
getWsUsername
();
$webservicePassword
=
$this
->
_adyenHelper
->
getWsPassword
();
$client
=
new
\Adyen\Client
();
$client
->
setApplicationName
(
"Magento 2 plugin"
);
$client
->
setUsername
(
$webserviceUsername
);
$client
->
setPassword
(
$webservicePassword
);
if
(
$this
->
_adyenHelper
->
isDemoMode
())
{
$client
->
setEnvironment
(
\Adyen\Environment
::
TEST
);
}
else
{
$client
->
setEnvironment
(
\Adyen\Environment
::
LIVE
);
}
// assign magento log
$client
->
setLogger
(
$adyenLogger
);
$this
->
_client
=
$client
;
}
/**
* @param \Magento\Payment\Gateway\Http\TransferInterface $transferObject
* @return mixed
* @throws ClientException
*/
public
function
placeRequest
(
\Magento\Payment\Gateway\Http\TransferInterface
$transferObject
)
{
$request
=
$transferObject
->
getBody
();
// call lib
$service
=
new
\Adyen\Service\Payment
(
$this
->
_client
);
try
{
$response
=
$service
->
authorise
(
$request
);
}
catch
(
\Adyen\AdyenException
$e
)
{
$response
=
null
;
}
return
$response
;
}
}
Gateway/Http/Client/TransactionCancel.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Http\Client
;
use
Magento\Payment\Gateway\Http\ClientInterface
;
/**
* Class TransactionSale
*/
class
TransactionCancel
implements
ClientInterface
{
/**
* PaymentRequest constructor.
*
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType
* @param array $data
*/
public
function
__construct
(
\Magento\Framework\Model\Context
$context
,
\Magento\Framework\Encryption\EncryptorInterface
$encryptor
,
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Adyen\Payment\Model\RecurringType
$recurringType
,
array
$data
=
[]
)
{
$this
->
_encryptor
=
$encryptor
;
$this
->
_adyenHelper
=
$adyenHelper
;
$this
->
_adyenLogger
=
$adyenLogger
;
$this
->
_recurringType
=
$recurringType
;
$this
->
_appState
=
$context
->
getAppState
();
// initialize client
$webserviceUsername
=
$this
->
_adyenHelper
->
getWsUsername
();
$webservicePassword
=
$this
->
_adyenHelper
->
getWsPassword
();
$client
=
new
\Adyen\Client
();
$client
->
setApplicationName
(
"Magento 2 plugin"
);
$client
->
setUsername
(
$webserviceUsername
);
$client
->
setPassword
(
$webservicePassword
);
if
(
$this
->
_adyenHelper
->
isDemoMode
())
{
$client
->
setEnvironment
(
\Adyen\Environment
::
TEST
);
}
else
{
$client
->
setEnvironment
(
\Adyen\Environment
::
LIVE
);
}
// assign magento log
$client
->
setLogger
(
$adyenLogger
);
$this
->
_client
=
$client
;
}
/**
* @param \Magento\Payment\Gateway\Http\TransferInterface $transferObject
* @return null
*/
public
function
placeRequest
(
\Magento\Payment\Gateway\Http\TransferInterface
$transferObject
)
{
$request
=
$transferObject
->
getBody
();
// call lib
$service
=
new
\Adyen\Service\Modification
(
$this
->
_client
);
try
{
$response
=
$service
->
cancelOrRefund
(
$request
);
}
catch
(
\Adyen\AdyenException
$e
)
{
$response
=
null
;
}
return
$response
;
}
}
\ No newline at end of file
Gateway/Http/Client/TransactionCapture.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Http\Client
;
use
Magento\Payment\Gateway\Http\ClientInterface
;
/**
* Class TransactionSale
*/
class
TransactionCapture
implements
ClientInterface
{
/**
* PaymentRequest constructor.
*
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType
* @param array $data
*/
public
function
__construct
(
\Magento\Framework\Model\Context
$context
,
\Magento\Framework\Encryption\EncryptorInterface
$encryptor
,
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Adyen\Payment\Model\RecurringType
$recurringType
,
array
$data
=
[]
)
{
$this
->
_encryptor
=
$encryptor
;
$this
->
_adyenHelper
=
$adyenHelper
;
$this
->
_adyenLogger
=
$adyenLogger
;
$this
->
_recurringType
=
$recurringType
;
$this
->
_appState
=
$context
->
getAppState
();
// initialize client
$webserviceUsername
=
$this
->
_adyenHelper
->
getWsUsername
();
$webservicePassword
=
$this
->
_adyenHelper
->
getWsPassword
();
$client
=
new
\Adyen\Client
();
$client
->
setApplicationName
(
"Magento 2 plugin"
);
$client
->
setUsername
(
$webserviceUsername
);
$client
->
setPassword
(
$webservicePassword
);
if
(
$this
->
_adyenHelper
->
isDemoMode
())
{
$client
->
setEnvironment
(
\Adyen\Environment
::
TEST
);
}
else
{
$client
->
setEnvironment
(
\Adyen\Environment
::
LIVE
);
}
// assign magento log
$client
->
setLogger
(
$adyenLogger
);
$this
->
_client
=
$client
;
}
/**
* @param \Magento\Payment\Gateway\Http\TransferInterface $transferObject
* @return null
*/
public
function
placeRequest
(
\Magento\Payment\Gateway\Http\TransferInterface
$transferObject
)
{
$request
=
$transferObject
->
getBody
();
// call lib
$service
=
new
\Adyen\Service\Modification
(
$this
->
_client
);
try
{
$response
=
$service
->
capture
(
$request
);
}
catch
(
\Adyen\AdyenException
$e
)
{
$response
=
null
;
}
return
$response
;
}
}
\ No newline at end of file
Gateway/Http/Client/TransactionRefund.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Http\Client
;
use
Magento\Payment\Gateway\Http\ClientInterface
;
/**
* Class TransactionSale
*/
class
TransactionRefund
implements
ClientInterface
{
/**
* PaymentRequest constructor.
*
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType
* @param array $data
*/
public
function
__construct
(
\Magento\Framework\Model\Context
$context
,
\Magento\Framework\Encryption\EncryptorInterface
$encryptor
,
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Adyen\Payment\Model\RecurringType
$recurringType
,
array
$data
=
[]
)
{
$this
->
_encryptor
=
$encryptor
;
$this
->
_adyenHelper
=
$adyenHelper
;
$this
->
_adyenLogger
=
$adyenLogger
;
$this
->
_recurringType
=
$recurringType
;
$this
->
_appState
=
$context
->
getAppState
();
// initialize client
$webserviceUsername
=
$this
->
_adyenHelper
->
getWsUsername
();
$webservicePassword
=
$this
->
_adyenHelper
->
getWsPassword
();
$client
=
new
\Adyen\Client
();
$client
->
setApplicationName
(
"Magento 2 plugin"
);
$client
->
setUsername
(
$webserviceUsername
);
$client
->
setPassword
(
$webservicePassword
);
if
(
$this
->
_adyenHelper
->
isDemoMode
())
{
$client
->
setEnvironment
(
\Adyen\Environment
::
TEST
);
}
else
{
$client
->
setEnvironment
(
\Adyen\Environment
::
LIVE
);
}
// assign magento log
$client
->
setLogger
(
$adyenLogger
);
$this
->
_client
=
$client
;
}
/**
* @param \Magento\Payment\Gateway\Http\TransferInterface $transferObject
* @return null
*/
public
function
placeRequest
(
\Magento\Payment\Gateway\Http\TransferInterface
$transferObject
)
{
$request
=
$transferObject
->
getBody
();
// call lib
$service
=
new
\Adyen\Service\Modification
(
$this
->
_client
);
try
{
$response
=
$service
->
refund
(
$request
);
}
catch
(
\Adyen\AdyenException
$e
)
{
$response
=
null
;
}
return
$response
;
}
}
\ No newline at end of file
Gateway/Http/TransferFactory.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Http
;
use
Magento\Payment\Gateway\Http\TransferBuilder
;
use
Magento\Payment\Gateway\Http\TransferFactoryInterface
;
use
Magento\Payment\Gateway\Http\TransferInterface
;
class
TransferFactory
implements
TransferFactoryInterface
{
/**
* @var TransferBuilder
*/
private
$transferBuilder
;
/**
* @param TransferBuilder $transferBuilder
*/
public
function
__construct
(
TransferBuilder
$transferBuilder
)
{
$this
->
transferBuilder
=
$transferBuilder
;
}
/**
* Builds gateway transfer object
*
* @param array $request
* @return TransferInterface
*/
public
function
create
(
array
$request
)
{
return
$this
->
transferBuilder
->
setBody
(
$request
)
->
build
();
}
}
\ No newline at end of file
Gateway/Request/AddressDataBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
/**
* Class AddressDataBuilder
*/
class
AddressDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* AddressDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
)
{
$this
->
adyenHelper
=
$adyenHelper
;
}
/**
* Add delivery\billing details into request
*
* @param array $buildSubject
* @return array
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$order
=
$paymentDataObject
->
getOrder
();
$result
=
[];
$billingAddress
=
$order
->
getBillingAddress
();
if
(
$billingAddress
)
{
// filter housenumber from streetLine1
$requestBilling
=
[
"street"
=>
$billingAddress
->
getStreetLine1
(),
"postalCode"
=>
$billingAddress
->
getPostcode
(),
"city"
=>
$billingAddress
->
getCity
(),
"houseNumberOrName"
=>
'NA'
,
"stateOrProvince"
=>
$billingAddress
->
getRegionCode
(),
"country"
=>
$billingAddress
->
getCountryId
()
];
// houseNumberOrName is mandatory
if
(
$requestBilling
[
'houseNumberOrName'
]
==
""
)
{
$requestBilling
[
'houseNumberOrName'
]
=
"NA"
;
}
$result
[
'billingAddress'
]
=
$requestBilling
;
}
$shippingAddress
=
$order
->
getShippingAddress
();
if
(
$shippingAddress
)
{
// filter housenumber from streetLine1
$requestDelivery
=
[
"street"
=>
$shippingAddress
->
getStreetLine1
(),
"postalCode"
=>
$shippingAddress
->
getPostcode
(),
"city"
=>
$shippingAddress
->
getCity
(),
"houseNumberOrName"
=>
'NA'
,
"stateOrProvince"
=>
$shippingAddress
->
getRegionCode
(),
"country"
=>
$shippingAddress
->
getCountryId
()
];
// houseNumberOrName is mandatory
if
(
$requestDelivery
[
'houseNumberOrName'
]
==
""
)
{
$requestDelivery
[
'houseNumberOrName'
]
=
"NA"
;
}
$result
[
'deliveryAddress'
]
=
$requestDelivery
;
}
return
$result
;
}
}
Gateway/Request/CancelDataBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
/**
* Class CustomerDataBuilder
*/
class
CancelDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* CaptureDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
)
{
$this
->
adyenHelper
=
$adyenHelper
;
}
/**
* Create cancel_or_refund request
*
* @param array $buildSubject
* @return array
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$order
=
$paymentDataObject
->
getOrder
();
$payment
=
$paymentDataObject
->
getPayment
();
$pspReference
=
$payment
->
getCcTransId
();
return
[
"reference"
=>
$order
->
getOrderIncrementId
(),
"originalReference"
=>
$pspReference
];
}
}
\ No newline at end of file
Gateway/Request/CaptureDataBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
/**
* Class CustomerDataBuilder
*/
class
CaptureDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* CaptureDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
)
{
$this
->
adyenHelper
=
$adyenHelper
;
}
/**
* Create capture request
*
* @param array $buildSubject
* @return array
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$amount
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readAmount
(
$buildSubject
);
$payment
=
$paymentDataObject
->
getPayment
();
$pspReference
=
$payment
->
getCcTransId
();
$currency
=
$payment
->
getOrder
()
->
getOrderCurrencyCode
();
//format the amount to minor units
$amount
=
$this
->
adyenHelper
->
formatAmount
(
$amount
,
$currency
);
$modificationAmount
=
[
'currency'
=>
$currency
,
'value'
=>
$amount
];
return
[
"modificationAmount"
=>
$modificationAmount
,
"reference"
=>
$payment
->
getOrder
()
->
getIncrementId
(),
"originalReference"
=>
$pspReference
];
}
}
\ No newline at end of file
Gateway/Request/CustomerDataBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
/**
* Class CustomerDataBuilder
*/
class
CustomerDataBuilder
implements
BuilderInterface
{
/**
* quest prefix
*/
const
GUEST_ID
=
'customer_'
;
/**
* Add shopper data into request
*
* @param array $buildSubject
* @return array
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$order
=
$paymentDataObject
->
getOrder
();
$billingAddress
=
$order
->
getBillingAddress
();
$customerEmail
=
$billingAddress
->
getEmail
();
$shopperIp
=
$order
->
getRemoteIp
();
$realOrderId
=
$order
->
getOrderIncrementId
();
$customerId
=
$order
->
getCustomerId
();
$shopperReference
=
(
!
empty
(
$customerId
))
?
$customerId
:
self
::
GUEST_ID
.
$realOrderId
;
return
[
"shopperIP"
=>
$shopperIp
,
"shopperEmail"
=>
$customerEmail
,
"shopperReference"
=>
$shopperReference
];
}
}
Gateway/Request/MerchantAccountDataBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
class
MerchantAccountDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* RecurringDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
)
{
$this
->
adyenHelper
=
$adyenHelper
;
}
/**
* @param array $buildSubject
* @return array
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$order
=
$paymentDataObject
->
getOrder
();
$storeId
=
$order
->
getStoreId
();
$merchantAccount
=
$this
->
adyenHelper
->
getAdyenAbstractConfigData
(
"merchant_account"
,
$storeId
);
return
[
"merchantAccount"
=>
$merchantAccount
];
}
}
\ No newline at end of file
Gateway/Request/PaymentDataBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
/**
* Payment Data Builder
*/
class
PaymentDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* PaymentDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
)
{
$this
->
adyenHelper
=
$adyenHelper
;
}
/**
* @param array $buildSubject
* @return array
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$order
=
$paymentDataObject
->
getOrder
();
$orderCurrencyCode
=
$order
->
getCurrencyCode
();
$amount
=
$order
->
getGrandTotalAmount
();
$browserInfo
=
[
'userAgent'
=>
$_SERVER
[
'HTTP_USER_AGENT'
],
'acceptHeader'
=>
$_SERVER
[
'HTTP_ACCEPT'
]];
$amount
=
[
'currency'
=>
$orderCurrencyCode
,
'value'
=>
$this
->
adyenHelper
->
formatAmount
(
$amount
,
$orderCurrencyCode
)];
return
[
"amount"
=>
$amount
,
"reference"
=>
$order
->
getOrderIncrementId
(),
"fraudOffset"
=>
"0"
,
"browserInfo"
=>
$browserInfo
];
}
}
\ No newline at end of file
Gateway/Request/RecurringDataBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
class
RecurringDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* @var \Magento\Framework\App\State
*/
private
$appState
;
/**
* RecurringDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Magento\Framework\Model\Context $context
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Magento\Framework\Model\Context
$context
)
{
$this
->
adyenHelper
=
$adyenHelper
;
$this
->
appState
=
$context
->
getAppState
();
}
/**
* @param array $buildSubject
* @return array
*/
public
function
build
(
array
$buildSubject
)
{
$result
=
[];
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$payment
=
$paymentDataObject
->
getPayment
();
// Needs to change when oneclick,cc using facade impl.
$paymentMethodCode
=
$payment
->
getMethodInstance
()
->
getCode
();
$storeId
=
null
;
if
(
$this
->
appState
->
getAreaCode
()
===
\Magento\Backend\App\Area\FrontNameResolver
::
AREA_CODE
)
{
$storeId
=
$payment
->
getOrder
()
->
getStoreId
();
}
$recurringType
=
$this
->
adyenHelper
->
getAdyenAbstractConfigData
(
'recurring_type'
,
$storeId
);
// set the recurring type
$recurringContractType
=
null
;
if
(
$recurringType
)
{
if
(
$paymentMethodCode
==
\Adyen\Payment\Model\Method\Oneclick
::
METHOD_CODE
)
{
/*
* For ONECLICK look at the recurringPaymentType that the merchant
* has selected in Adyen ONECLICK settings
*/
if
(
$payment
->
getAdditionalInformation
(
'customer_interaction'
))
{
$recurringContractType
=
\Adyen\Payment\Model\RecurringType
::
ONECLICK
;
}
else
{
$recurringContractType
=
\Adyen\Payment\Model\RecurringType
::
RECURRING
;
}
}
else
if
(
$paymentMethodCode
==
\Adyen\Payment\Model\Method\Cc
::
METHOD_CODE
)
{
if
(
$payment
->
getAdditionalInformation
(
"store_cc"
)
==
""
&&
(
$recurringType
==
"ONECLICK,RECURRING"
||
$recurringType
==
"RECURRING"
))
{
$recurringContractType
=
\Adyen\Payment\Model\RecurringType
::
RECURRING
;
}
elseif
(
$payment
->
getAdditionalInformation
(
"store_cc"
)
==
"1"
)
{
$recurringContractType
=
$recurringType
;
}
}
else
{
$recurringContractType
=
$recurringType
;
}
}
if
(
$recurringContractType
)
{
$recurring
=
[
'contract'
=>
$recurringContractType
];
$result
[
'recurring'
]
=
$recurring
;
}
return
$result
;
}
}
\ No newline at end of file
Gateway/Request/RefundDataBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
/**
* Class CustomerDataBuilder
*/
class
RefundDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* CaptureDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
)
{
$this
->
adyenHelper
=
$adyenHelper
;
}
/**
* @param array $buildSubject
* @return array
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$amount
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readAmount
(
$buildSubject
);
$payment
=
$paymentDataObject
->
getPayment
();
$pspReference
=
$payment
->
getCcTransId
();
$currency
=
$payment
->
getOrder
()
->
getOrderCurrencyCode
();
//format the amount to minor units
$amount
=
$this
->
adyenHelper
->
formatAmount
(
$amount
,
$currency
);
$modificationAmount
=
[
'currency'
=>
$currency
,
'value'
=>
$amount
];
$result
=
[
"modificationAmount"
=>
$modificationAmount
,
"reference"
=>
$payment
->
getOrder
()
->
getIncrementId
(),
"originalReference"
=>
$pspReference
];
return
$result
;
}
}
\ No newline at end of file
Gateway/Request/SepaAuthorizationBuilder.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
class
SepaAuthorizationBuilder
implements
BuilderInterface
{
/**
* @param array $buildSubject
* @return mixed
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$payment
=
$paymentDataObject
->
getPayment
();
// set brand to sepa
$request
[
'selectedBrand'
]
=
"sepadirectdebit"
;
// add bankDetails into request
$bankAccount
=
[
'iban'
=>
$payment
->
getAdditionalInformation
(
"iban"
),
'ownerName'
=>
$payment
->
getAdditionalInformation
(
"account_name"
),
'countryCode'
=>
$payment
->
getAdditionalInformation
(
"country"
)
];
$request
[
'bankAccount'
]
=
$bankAccount
;
return
$request
;
}
}
\ No newline at end of file
Gateway/Response/PaymentAuthorisationDetailsHandler.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Response
;
use
Magento\Payment\Gateway\Response\HandlerInterface
;
class
PaymentAuthorisationDetailsHandler
implements
HandlerInterface
{
/**
* @param array $handlingSubject
* @param array $response
*/
public
function
handle
(
array
$handlingSubject
,
array
$response
)
{
$payment
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$handlingSubject
);
/** @var OrderPaymentInterface $payment */
$payment
=
$payment
->
getPayment
();
// set transaction not to processing by default wait for notification
$payment
->
setIsTransactionPending
(
true
);
// no not send order confirmation mail
$payment
->
getOrder
()
->
setCanSendNewEmailFlag
(
false
);
// set pspReference as transactionId
$payment
->
setCcTransId
(
$response
[
'pspReference'
]);
$payment
->
setLastTransId
(
$response
[
'pspReference'
]);
// set transaction
$payment
->
setTransactionId
(
$response
[
'pspReference'
]);
// do not close transaction so you can do a cancel() and void
$payment
->
setIsTransactionClosed
(
false
);
$payment
->
setShouldCloseParentTransaction
(
false
);
}
}
\ No newline at end of file
Gateway/Response/PaymentCancelDetailsHandler.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Response
;
use
Magento\Payment\Gateway\Response\HandlerInterface
;
class
PaymentCancelDetailsHandler
implements
HandlerInterface
{
/**
* @param array $handlingSubject
* @param array $response
*/
public
function
handle
(
array
$handlingSubject
,
array
$response
)
{
$payment
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$handlingSubject
);
/** @var OrderPaymentInterface $payment */
$payment
=
$payment
->
getPayment
();
// set pspReference as lastTransId only!
$payment
->
setLastTransId
(
$response
[
'pspReference'
]);
// close transaction because you have cancelled the transaction
$payment
->
setIsTransactionClosed
(
true
);
$payment
->
setShouldCloseParentTransaction
(
true
);
}
}
\ No newline at end of file
Gateway/Response/PaymentCaptureDetailsHandler.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Response
;
use
Magento\Payment\Gateway\Response\HandlerInterface
;
class
PaymentCaptureDetailsHandler
implements
HandlerInterface
{
/**
* @param array $handlingSubject
* @param array $response
*/
public
function
handle
(
array
$handlingSubject
,
array
$response
)
{
$payment
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$handlingSubject
);
/** @var OrderPaymentInterface $payment */
$payment
=
$payment
->
getPayment
();
// set pspReference as lastTransId only!
$payment
->
setLastTransId
(
$response
[
'pspReference'
]);
/**
* close current transaction because you have capture the goods
* but do not close the authorisation becasue you can still cancel/refund order
*/
$payment
->
setIsTransactionClosed
(
true
);
$payment
->
setShouldCloseParentTransaction
(
false
);
}
}
\ No newline at end of file
Gateway/Response/PaymentCommentHistoryHandler.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Response
;
use
Magento\Payment\Gateway\Response\HandlerInterface
;
class
PaymentCommentHistoryHandler
implements
HandlerInterface
{
/**
* @param array $handlingSubject
* @param array $response
* @return $this
*/
public
function
handle
(
array
$handlingSubject
,
array
$response
)
{
$payment
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$handlingSubject
);
/** @var OrderPaymentInterface $payment */
$payment
=
$payment
->
getPayment
();
if
(
isset
(
$response
[
'resultCode'
]))
{
$responseCode
=
$response
[
'resultCode'
];
}
else
{
$responseCode
=
""
;
}
if
(
isset
(
$response
[
'pspReference'
]))
{
$pspReference
=
$response
[
'pspReference'
];
}
else
{
$pspReference
=
""
;
}
$type
=
'Adyen Result response:'
;
$comment
=
__
(
'%1 <br /> authResult: %2 <br /> pspReference: %3 '
,
$type
,
$responseCode
,
$pspReference
);
if
(
$responseCode
)
{
$payment
->
getOrder
()
->
setAdyenResulturlEventCode
(
$responseCode
);
}
$payment
->
getOrder
()
->
addStatusHistoryComment
(
$comment
);
return
$this
;
}
}
Gateway/Response/PaymentRefundDetailsHandler.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Response
;
use
Magento\Payment\Gateway\Response\HandlerInterface
;
class
PaymentRefundDetailsHandler
implements
HandlerInterface
{
/**
* @param array $handlingSubject
* @param array $response
*/
public
function
handle
(
array
$handlingSubject
,
array
$response
)
{
$payment
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$handlingSubject
);
/** @var OrderPaymentInterface $payment */
$payment
=
$payment
->
getPayment
();
// set pspReference as lastTransId only!
$payment
->
setLastTransId
(
$response
[
'pspReference'
]);
/**
* close current transaction because you have capture the goods
* but only on full refund close the authorisation
*/
$payment
->
setIsTransactionClosed
(
true
);
$closeParent
=
!
(
bool
)
$payment
->
getCreditmemo
()
->
getInvoice
()
->
canRefund
();
$payment
->
setShouldCloseParentTransaction
(
$closeParent
);
}
}
\ No newline at end of file
Gateway/Validator/CancelResponseValidator.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Validator
;
use
Magento\Payment\Gateway\Validator\AbstractValidator
;
class
CancelResponseValidator
extends
AbstractValidator
{
/**
* @param array $validationSubject
* @return \Magento\Payment\Gateway\Validator\ResultInterface
*/
public
function
validate
(
array
$validationSubject
)
{
$response
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readResponse
(
$validationSubject
);
$isValid
=
true
;
$errorMessages
=
[];
if
(
$response
[
'response'
]
!=
'[cancelOrRefund-received]'
)
{
$errorMsg
=
__
(
'Error with cancellation'
);
$this
->
_logger
->
critical
(
$errorMsg
);
$errorMessages
[]
=
$errorMsg
;
}
return
$this
->
createResult
(
$isValid
,
$errorMessages
);
}
}
\ No newline at end of file
Gateway/Validator/CaptureResponseValidator.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Validator
;
use
Magento\Payment\Gateway\Validator\AbstractValidator
;
class
CaptureResponseValidator
extends
AbstractValidator
{
/**
* @param array $validationSubject
* @throws \Magento\Framework\Exception\LocalizedException
*/
public
function
validate
(
array
$validationSubject
)
{
$response
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readResponse
(
$validationSubject
);
$isValid
=
true
;
$errorMessages
=
[];
if
(
$response
[
'response'
]
!=
'[capture-received]'
)
{
$errorMsg
=
__
(
'Error with capture'
);
$this
->
_logger
->
critical
(
$errorMsg
);
$errorMessages
[]
=
$errorMsg
;
}
return
$this
->
createResult
(
$isValid
,
$errorMessages
);
}
}
\ No newline at end of file
Gateway/Validator/GeneralResponseValidator.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Validator
;
use
Magento\Payment\Gateway\Validator\AbstractValidator
;
class
GeneralResponseValidator
extends
AbstractValidator
{
/**
* @param array $validationSubject
* @return \Magento\Payment\Gateway\Validator\ResultInterface
*/
public
function
validate
(
array
$validationSubject
)
{
$response
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readResponse
(
$validationSubject
);
$paymentDataObjectInterface
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$validationSubject
);
$payment
=
$paymentDataObjectInterface
->
getPayment
();
$isValid
=
true
;
$errorMessages
=
[];
// validate result
if
(
$response
)
{
switch
(
$response
[
'resultCode'
])
{
case
"Authorised"
:
$payment
->
setAdditionalInformation
(
'pspReference'
,
$response
[
'pspReference'
]);
break
;
case
"Refused"
:
$errorMsg
=
__
(
'The payment is REFUSED.'
);
$this
->
_logger
->
critical
(
$errorMsg
);
$errorMessages
[]
=
$errorMsg
;
break
;
default
:
$errorMsg
=
__
(
'Error with payment method please select different payment method.'
);
$this
->
_logger
->
critical
(
$errorMsg
);
$errorMessages
[]
=
$errorMsg
;
break
;
}
}
else
{
$errorMsg
=
__
(
'Error with payment method please select different payment method.'
);
$this
->
_logger
->
critical
(
$errorMsg
);
$errorMessages
[]
=
$errorMsg
;
}
return
$this
->
createResult
(
$isValid
,
$errorMessages
);
}
}
\ No newline at end of file
Gateway/Validator/RefundResponseValidator.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Validator
;
use
Magento\Payment\Gateway\Validator\AbstractValidator
;
class
RefundResponseValidator
extends
AbstractValidator
{
/**
* @param array $validationSubject
* @throws \Magento\Framework\Exception\LocalizedException
*/
public
function
validate
(
array
$validationSubject
)
{
$response
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readResponse
(
$validationSubject
);
$isValid
=
true
;
$errorMessages
=
[];
if
(
$response
[
'response'
]
!=
'[refund-received]'
)
{
$errorMsg
=
__
(
'Error with refund'
);
$this
->
_logger
->
critical
(
$errorMsg
);
$errorMessages
[]
=
$errorMsg
;
}
return
$this
->
createResult
(
$isValid
,
$errorMessages
);
}
}
\ No newline at end of file
Gateway/Validator/SepaValidator.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Validator
;
use
Magento\Payment\Gateway\Validator\AbstractValidator
;
use
Magento\Payment\Gateway\Validator\ResultInterfaceFactory
;
use
Magento\Payment\Gateway\ConfigInterface
;
/**
* Class SepaValidator
* @package Adyen\Payment\Gateway\Validator
*/
class
SepaValidator
extends
AbstractValidator
{
/**
* @var \Magento\Payment\Gateway\ConfigInterface
*/
private
$config
;
/**
* @param ResultInterfaceFactory $resultFactory
* @param \Magento\Payment\Gateway\ConfigInterface $config
*/
public
function
__construct
(
ResultInterfaceFactory
$resultFactory
,
ConfigInterface
$config
)
{
$this
->
config
=
$config
;
parent
::
__construct
(
$resultFactory
);
}
/**
* @param array $validationSubject
* @return \Magento\Payment\Gateway\Validator\ResultInterface
*/
public
function
validate
(
array
$validationSubject
)
{
$isValid
=
true
;
$fails
=
[];
$payment
=
$validationSubject
[
'payment'
];
$iban
=
$payment
->
getAdditionalInformation
(
'iban'
);
if
(
empty
(
$iban
)
||
!
$this
->
validateIban
(
$iban
))
{
$isValid
=
false
;
$fails
[]
=
__
(
'Invalid Iban number.'
);
}
return
$this
->
createResult
(
$isValid
,
$fails
);
}
/**
* @param $iban
* @return bool
*/
public
function
validateIban
(
$iban
)
{
$iban
=
strtolower
(
str_replace
(
' '
,
''
,
$iban
));
$countries
=
[
'al'
=>
28
,
'ad'
=>
24
,
'at'
=>
20
,
'az'
=>
28
,
'bh'
=>
22
,
'be'
=>
16
,
'ba'
=>
20
,
'br'
=>
29
,
'bg'
=>
22
,
'cr'
=>
21
,
'hr'
=>
21
,
'cy'
=>
28
,
'cz'
=>
24
,
'dk'
=>
18
,
'do'
=>
28
,
'ee'
=>
20
,
'fo'
=>
18
,
'fi'
=>
18
,
'fr'
=>
27
,
'ge'
=>
22
,
'de'
=>
22
,
'gi'
=>
23
,
'gr'
=>
27
,
'gl'
=>
18
,
'gt'
=>
28
,
'hu'
=>
28
,
'is'
=>
26
,
'ie'
=>
22
,
'il'
=>
23
,
'it'
=>
27
,
'jo'
=>
30
,
'kz'
=>
20
,
'kw'
=>
30
,
'lv'
=>
21
,
'lb'
=>
28
,
'li'
=>
21
,
'lt'
=>
20
,
'lu'
=>
20
,
'mk'
=>
19
,
'mt'
=>
31
,
'mr'
=>
27
,
'mu'
=>
30
,
'mc'
=>
27
,
'md'
=>
24
,
'me'
=>
22
,
'nl'
=>
18
,
'no'
=>
15
,
'pk'
=>
24
,
'ps'
=>
29
,
'pl'
=>
28
,
'pt'
=>
25
,
'qa'
=>
29
,
'ro'
=>
24
,
'sm'
=>
27
,
'sa'
=>
24
,
'rs'
=>
22
,
'sk'
=>
24
,
'si'
=>
19
,
'es'
=>
24
,
'se'
=>
24
,
'ch'
=>
21
,
'tn'
=>
24
,
'tr'
=>
26
,
'ae'
=>
23
,
'gb'
=>
22
,
'vg'
=>
24
];
$chars
=
[
'a'
=>
10
,
'b'
=>
11
,
'c'
=>
12
,
'd'
=>
13
,
'e'
=>
14
,
'f'
=>
15
,
'g'
=>
16
,
'h'
=>
17
,
'i'
=>
18
,
'j'
=>
19
,
'k'
=>
20
,
'l'
=>
21
,
'm'
=>
22
,
'n'
=>
23
,
'o'
=>
24
,
'p'
=>
25
,
'q'
=>
26
,
'r'
=>
27
,
's'
=>
28
,
't'
=>
29
,
'u'
=>
30
,
'v'
=>
31
,
'w'
=>
32
,
'x'
=>
33
,
'y'
=>
34
,
'z'
=>
35
];
if
(
isset
(
$countries
[
substr
(
$iban
,
0
,
2
)])
&&
strlen
(
$iban
)
==
$countries
[
substr
(
$iban
,
0
,
2
)])
{
$movedChar
=
substr
(
$iban
,
4
)
.
substr
(
$iban
,
0
,
4
);
$movedCharArray
=
str_split
(
$movedChar
);
$newString
=
""
;
foreach
(
$movedCharArray
AS
$key
=>
$value
)
{
if
(
!
is_numeric
(
$movedCharArray
[
$key
]))
{
$movedCharArray
[
$key
]
=
$chars
[
$movedCharArray
[
$key
]];
}
$newString
.=
$movedCharArray
[
$key
];
}
if
(
bcmod
(
$newString
,
'97'
)
==
1
)
{
return
true
;
}
else
{
return
false
;
}
}
else
{
return
false
;
}
}
}
\ No newline at end of file
Model/AdyenGenericConfigProvider.php
View file @
482fd41f
...
...
@@ -51,7 +51,7 @@ class AdyenGenericConfigProvider implements ConfigProviderInterface
\Adyen\Payment\Model\Method\Hpp
::
METHOD_CODE
,
\Adyen\Payment\Model\Method\Oneclick
::
METHOD_CODE
,
\Adyen\Payment\Model\Method\Pos
::
METHOD_CODE
,
\Adyen\Payment\Model\Method\Sepa
::
METHOD_CODE
,
//
\Adyen\Payment\Model\Method\Sepa::METHOD_CODE,
\Adyen\Payment\Model\Method\Boleto
::
METHOD_CODE
];
...
...
Model/Cron.php
View file @
482fd41f
...
...
@@ -200,7 +200,7 @@ class Cron
$dateStart
=
new
\DateTime
();
$dateStart
->
modify
(
'-5 day'
);
$dateEnd
=
new
\DateTime
();
$dateEnd
->
modify
(
'-1 minute'
);
//
$dateEnd->modify('-1 minute');
$dateRange
=
[
'from'
=>
$dateStart
,
'to'
=>
$dateEnd
,
'datetime'
=>
true
];
// create collection
...
...
@@ -761,7 +761,7 @@ class Cron
}
$contractDetail
=
null
;
// get curren
c
t Contract details and get list of all current ones
// get current Contract details and get list of all current ones
$recurringReferencesList
=
[];
if
(
$listRecurringContracts
)
{
...
...
@@ -1067,7 +1067,7 @@ class Cron
$this
->
_paymentMethod
==
"sepadirectdebit"
)
&&
$sepaFlow
!=
"authcap"
))
{
$this
->
_adyenLogger
->
addAdyenNotificationCronjob
(
'This payment method does not allow manual capture.(2) paymentCode:'
.
$_paymentCode
.
' paymentMethod:'
.
$this
->
_paymentMethod
$_paymentCode
.
' paymentMethod:'
.
$this
->
_paymentMethod
.
' sepaFLow:'
.
$sepaFlow
);
return
true
;
}
...
...
Model/Method/Sepa.php
deleted
100644 → 0
View file @
830f0edc
This diff is collapsed.
Click to expand it.
Model/AdyenSepaConfigProvider.php
→
Model/
Ui/
AdyenSepaConfigProvider.php
View file @
482fd41f
...
...
@@ -21,7 +21,7 @@
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Model
;
namespace
Adyen\Payment\Model
\Ui
;
use
Magento\Checkout\Model\ConfigProviderInterface
;
use
Magento\Payment\Helper\Data
as
PaymentHelper
;
...
...
@@ -29,44 +29,48 @@ use Magento\Payment\Helper\Data as PaymentHelper;
class
AdyenSepaConfigProvider
implements
ConfigProviderInterface
{
const
CODE
=
'adyen_sepa'
;
/**
* @var
string[]
* @var
PaymentHelper
*/
protected
$_methodCodes
=
[
'adyen_sepa'
];
protected
$_paymentHelper
;
/**
* @var \
Magento\Payment\Model\Method\AbstractMethod[]
* @var \
Adyen\Payment\Helper\Data
*/
protected
$_
methods
=
[]
;
protected
$_
adyenHelper
;
/**
* @var PaymentHelper
* Request object
*
* @var \Magento\Framework\App\RequestInterface
*/
protected
$_
paymentHelper
;
protected
$_
request
;
/**
* @var \
Adyen\Payment\Helper\Data
* @var \
Magento\Framework\UrlInterface
*/
protected
$_
adyenHelp
er
;
protected
$_
urlBuild
er
;
/**
* AdyenSepaConfigProvider constructor.
*
* @param PaymentHelper $paymentHelper
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\UrlInterface $urlBuilder
*/
public
function
__construct
(
PaymentHelper
$paymentHelper
,
\Adyen\Payment\Helper\Data
$adyenHelper
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Magento\Framework\App\RequestInterface
$request
,
\Magento\Framework\UrlInterface
$urlBuilder
)
{
$this
->
_paymentHelper
=
$paymentHelper
;
$this
->
_adyenHelper
=
$adyenHelper
;
foreach
(
$this
->
_methodCodes
as
$code
)
{
$this
->
_methods
[
$code
]
=
$this
->
_paymentHelper
->
getMethodInstance
(
$code
);
}
$this
->
_request
=
$request
;
$this
->
_urlBuilder
=
$urlBuilder
;
}
/**
...
...
@@ -74,13 +78,30 @@ class AdyenSepaConfigProvider implements ConfigProviderInterface
*/
public
function
getConfig
()
{
// set to active
$config
=
[
'payment'
=>
[
'adyenSepa'
=>
[
'countries'
=>
$this
->
_adyenHelper
->
getSepaCountries
()
self
::
CODE
=>
[
'isActive'
=>
true
,
'redirectUrl'
=>
$this
->
_urlBuilder
->
getUrl
(
'checkout/onepage/success/'
,
[
'_secure'
=>
$this
->
_getRequest
()
->
isSecure
()])
]
]
];
$config
[
'payment'
][
'adyenSepa'
][
'countries'
]
=
$this
->
_adyenHelper
->
getSepaCountries
();
return
$config
;
}
/**
* Retrieve request object
*
* @return \Magento\Framework\App\RequestInterface
*/
protected
function
_getRequest
()
{
return
$this
->
_request
;
}
}
\ No newline at end of file
Observer/AdyenSepaDataAssignObserver.php
0 → 100644
View file @
482fd41f
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Observer
;
use
Magento\Framework\Event\Observer
;
use
Magento\Payment\Observer\AbstractDataAssignObserver
;
use
Magento\Quote\Api\Data\PaymentInterface
;
/**
* Class DataAssignObserver
*/
class
AdyenSepaDataAssignObserver
extends
AbstractDataAssignObserver
{
const
ACCOUNT_NAME
=
'account_name'
;
const
IBAN
=
'iban'
;
const
COUNTRY
=
'country'
;
const
ACCEPTSEPA
=
'accept_sepa'
;
/**
* @var array
*/
protected
$additionalInformationList
=
[
self
::
ACCOUNT_NAME
,
self
::
IBAN
,
self
::
COUNTRY
,
self
::
ACCEPTSEPA
];
/**
* @param Observer $observer
* @return void
*/
public
function
execute
(
Observer
$observer
)
{
$data
=
$this
->
readDataArgument
(
$observer
);
$additionalData
=
$data
->
getData
(
PaymentInterface
::
KEY_ADDITIONAL_DATA
);
if
(
!
is_array
(
$additionalData
))
{
return
;
}
$paymentInfo
=
$this
->
readPaymentModelArgument
(
$observer
);
foreach
(
$this
->
additionalInformationList
as
$additionalInformationKey
)
{
if
(
isset
(
$additionalData
[
$additionalInformationKey
]))
{
$paymentInfo
->
setAdditionalInformation
(
$additionalInformationKey
,
$additionalData
[
$additionalInformationKey
]
);
}
}
}
}
etc/config.xml
View file @
482fd41f
...
...
@@ -77,11 +77,21 @@
</adyen_hpp>
<adyen_sepa>
<active>
0
</active>
<model>
Adyen
\Payment\Model\Method\Sepa
</model>
<model>
Adyen
SepaFacade
</model>
<title>
Sepa Direct Debit
</title>
<allowspecific>
0
</allowspecific>
<sort_order>
4
</sort_order>
<payment_action>
authorize
</payment_action>
<is_gateway>
1
</is_gateway>
<can_use_checkout>
1
</can_use_checkout>
<can_authorize>
1
</can_authorize>
<can_capture>
1
</can_capture>
<can_capture_partial>
1
</can_capture_partial>
<can_use_internal>
1
</can_use_internal>
<can_refund_partial_per_invoice>
1
</can_refund_partial_per_invoice>
<can_refund>
1
</can_refund>
<can_void>
1
</can_void>
<can_cancel>
1
</can_cancel>
<group>
adyen
</group>
</adyen_sepa>
<adyen_pos>
...
...
etc/di.xml
View file @
482fd41f
This diff is collapsed.
Click to expand it.
etc/events.xml
0 → 100644
View file @
482fd41f
<?xml version="1.0"?>
<!--
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
-->
<config
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"urn:magento:framework:Event/etc/events.xsd"
>
<event
name=
"payment_method_assign_data_adyen_sepa"
>
<observer
name=
"adyen_sepa_gateway_data_assign"
instance=
"Adyen\Payment\Observer\AdyenSepaDataAssignObserver"
/>
</event>
</config>
etc/frontend/di.xml
View file @
482fd41f
...
...
@@ -31,7 +31,7 @@
<item
name=
"adyen_cc_config_provider"
xsi:type=
"object"
>
Adyen\Payment\Model\AdyenCcConfigProvider
</item>
<item
name=
"adyen_oneclick_config_provider"
xsi:type=
"object"
>
Adyen\Payment\Model\AdyenOneclickConfigProvider
</item>
<item
name=
"adyen_hpp_config_provider"
xsi:type=
"object"
>
Adyen\Payment\Model\AdyenHppConfigProvider
</item>
<item
name=
"adyen_sepa_config_provider"
xsi:type=
"object"
>
Adyen\Payment\Model\AdyenSepaConfigProvider
</item>
<item
name=
"adyen_sepa_config_provider"
xsi:type=
"object"
>
Adyen\Payment\Model\
Ui\
AdyenSepaConfigProvider
</item>
<item
name=
"adyen_boleto_config_provider"
xsi:type=
"object"
>
Adyen\Payment\Model\AdyenBoletoConfigProvider
</item>
</argument>
</arguments>
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-sepa-method.js
View file @
482fd41f
...
...
@@ -25,17 +25,20 @@ define(
[
'
underscore
'
,
'
jquery
'
,
'
Magento_Checkout/js/model/quote
'
,
'
Magento_Payment/js/view/payment/cc-form
'
,
'
Adyen_Payment/js/action/place-order
'
,
'
mage/translate
'
,
'
Magento_Checkout/js/model/payment/additional-validators
'
],
function
(
_
,
$
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
)
{
function
(
_
,
$
,
quote
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
)
{
'
use strict
'
;
var
billingAddress
=
quote
.
billingAddress
();
return
Component
.
extend
({
self
:
this
,
defaults
:
{
template
:
'
Adyen_Payment/payment/sepa-form
'
template
:
'
Adyen_Payment/payment/sepa-form
'
,
country
:
billingAddress
.
countryId
},
initObservable
:
function
()
{
this
.
_super
()
...
...
@@ -47,6 +50,12 @@ define(
]);
return
this
;
},
/**
* @returns {Boolean}
*/
isShowLegend
:
function
()
{
return
true
;
},
setPlaceOrderHandler
:
function
(
handler
)
{
this
.
placeOrderHandler
=
handler
;
},
...
...
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