Skip to content

Commit 35f0554

Browse files
committed
Merge branch 'release/v6.4.3' into 'master'
release/v6.4.3 into master See merge request agence-dnd/marketplace/magento-2/external/module-checkout-magento2-plugin!257
2 parents bb24578 + 3f7e16e commit 35f0554

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Observer/Backend/MotoPaymentRequest.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function execute(Observer $observer): MotoPaymentRequest
183183
$api = $this->apiHandler->init($storeCode, ScopeInterface::SCOPE_STORE);
184184

185185
// Set the source
186-
$source = $this->getSource($order, $params);
186+
$source = $this->getSource($order, $storeCode, $params);
187187

188188
// Set the payment
189189
if ($this->apiHandler->isPreviousMode()) {
@@ -239,13 +239,12 @@ public function execute(Observer $observer): MotoPaymentRequest
239239

240240
// Send the charge request
241241
try {
242+
$this->logger->display($request);
242243
$response = $api->getCheckoutApi()->getPaymentsClient()->requestPayment($request);
244+
$this->logger->display($response);
243245
} catch (CheckoutApiException $e) {
244-
$this->logger->write($e->error_details);
246+
$this->logger->write($e->getMessage());
245247
} finally {
246-
// Logging
247-
$this->logger->display($response);
248-
249248
// Add the response to the order
250249
if (is_array($response) && $api->isValidResponse($response)) {
251250
$this->utilities->setPaymentData($order, $response);
@@ -299,11 +298,11 @@ protected function needsMotoProcessing(string $methodId, array $params): bool
299298
* @throws CheckoutArgumentException
300299
* @throws LocalizedException
301300
*/
302-
protected function getSource(Order $order, array $params)
301+
protected function getSource(Order $order, string $storeCode, array $params)
303302
{
304303
if ($this->isCardToken($params)) {
305304
// Initialize the API handler
306-
$api = $this->apiHandler->init();
305+
$api = $this->apiHandler->init($storeCode, ScopeInterface::SCOPE_STORE);
307306

308307
// Create the token source
309308
if ($this->apiHandler->isPreviousMode()) {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"magento/framework": ">=100.0.1"
88
},
99
"type": "magento2-module",
10-
"version": "6.4.2",
10+
"version": "6.4.3",
1111
"autoload": {
1212
"files": [
1313
"registration.php"

0 commit comments

Comments
 (0)