Skip to content

Commit bc9344b

Browse files
Merge pull request #75 from checkout/dev
3DS and T&C validation check
2 parents c18ac19 + 11382e0 commit bc9344b

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

Controller/Payment/PlaceOrder.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,15 @@ public function createOrder($params) {
139139
try {
140140
// Create an order from the quote
141141
$this->validateQuote($params['quote']);
142-
//$this->orderService->execute($params['quote'], $params['cardToken'], $params['agreement']);
143-
// Temporary workaround for a M2 code T&C checkbox issue not sending data
142+
143+
/**
144+
* Temporary workaround for a M2 code T&C checkbox issue not sending data.
145+
* The last parameter should be $params['agreement']
146+
*/
144147
$this->orderService->execute($params['quote'], $params['cardToken'], array(true));
145148

146149
// 3D Secure redirection if needed
147-
if($this->gatewayConfig->isVerify3DSecure()) {
150+
if ($this->gatewayConfig->isVerify3DSecure()) {
148151
$this->place3DSecureRedirectUrl();
149152
exit();
150153
}

Controller/Payment/Verify.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Magento\Customer\Model\Session as CustomerSession;
1616
use Magento\Framework\Exception\LocalizedException;
1717
use CheckoutCom\Magento2\Gateway\Config\Config as GatewayConfig;
18-
use CheckoutCom\Magento2\Model\Service\OrderService;
1918
use CheckoutCom\Magento2\Model\Service\VerifyPaymentService;
2019
use CheckoutCom\Magento2\Model\Service\StoreCardService;
2120
use CheckoutCom\Magento2\Model\Factory\VaultTokenFactory;
@@ -37,11 +36,6 @@ class Verify extends AbstractAction {
3736
*/
3837
protected $verifyPaymentService;
3938

40-
/**
41-
* @var OrderService
42-
*/
43-
protected $orderService;
44-
4539
/**
4640
* @var StoreCardService
4741
*/
@@ -88,7 +82,6 @@ class Verify extends AbstractAction {
8882
* @param Session $session
8983
* @param GatewayConfig $gatewayConfig
9084
* @param VerifyPaymentService $verifyPaymentService
91-
* @param OrderService $orderService
9285
* @param StoreCardService $storeCardService
9386
* @param CustomerSession $customerSession
9487
* @param VaultTokenFactory $vaultTokenFactory
@@ -101,7 +94,6 @@ public function __construct(
10194
Session $session,
10295
GatewayConfig $gatewayConfig,
10396
VerifyPaymentService $verifyPaymentService,
104-
OrderService $orderService,
10597
StoreCardService $storeCardService,
10698
CustomerSession $customerSession,
10799
VaultTokenFactory $vaultTokenFactory,
@@ -116,7 +108,6 @@ public function __construct(
116108
$this->session = $session;
117109
$this->gatewayConfig = $gatewayConfig;
118110
$this->verifyPaymentService = $verifyPaymentService;
119-
$this->orderService = $orderService;
120111
$this->storeCardService = $storeCardService;
121112
$this->customerSession = $customerSession;
122113
$this->vaultTokenFactory = $vaultTokenFactory;

Model/Service/OrderService.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@ public function __construct(
130130
* @throws LocalizedException
131131
*/
132132
public function execute(Quote $quote, $cardToken, array $agreement) {
133-
if (!$this->agreementsValidator->isValid($agreement)) {
134-
throw new LocalizedException(__('Please agree to all the terms and conditions before placing the order.'));
135-
}
133+
/**
134+
* Temporary workaround for a M2 code T&C checkbox issue not sending data.
135+
* The last parameter should be $params['agreement']
136+
*/
137+
//if (!$this->agreementsValidator->isValid($agreement)) {
138+
//throw new LocalizedException(__('Please agree to all the terms and conditions before placing the order.'));
139+
//}
136140

137141
if ($this->getCheckoutMethod($quote) === Onepage::METHOD_GUEST) {
138142
$this->prepareGuestQuote($quote);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"magento/module-vault": "*"
1212
},
1313
"type": "magento2-module",
14-
"version": "1.0.31",
14+
"version": "1.0.32",
1515
"autoload": {
1616
"files": [
1717
"registration.php"

0 commit comments

Comments
 (0)