Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-8776][V9][GraphQl] adyenPaymentDetails returns The cart isn't active. with old HPP methods #2478

Closed
dimitriBouteille opened this issue Feb 5, 2024 · 3 comments · Fixed by #2510
Assignees
Labels
Bug report Indicates that issue has been marked as a possible bug

Comments

@dimitriBouteille
Copy link
Contributor

dimitriBouteille commented Feb 5, 2024

When I want to confirm a payment (adyen_twint, adyen_applepay, ...) with the adyenPaymentDetails mutation, I have the following error:

The cart isn't active.

With the V8, all the methods were used here, but today this is no longer the case ... We must find a solution to leave the cart active for all adyen methods!

//TODO: Once we have a config in the magento backoffice, get all the methods directly from this config
if (in_array(
$payment->getMethod(),
['adyen_hpp', 'adyen_cc', 'adyen_oneclick', 'adyen_paypal', 'adyen_ideal'],
true
)) {
/** @var Quote $quote */
$quote = $observer->getEvent()->getQuote();
// Keep cart active until such actions are taken
$quote->setIsActive(true);

To Reproduce

Steps to reproduce the behavior:

  1. Create cart
  2. Use Adyen Twint method (or Apple Pay, Ideal, ...)
  3. Try confirm payment with adyenPaymentDetails mutation
  4. See error The cart isn't active.

Magento version

2.5.6

Plugin version

9.0.6

@dimitriBouteille dimitriBouteille added the Bug report Indicates that issue has been marked as a possible bug label Feb 5, 2024
@dimitriBouteille
Copy link
Contributor Author

Why required Cart ID argument for adyenPaymentDetails ?, maybe just use merchantReference as done in method validatePayloadAndReturnResponse :

$order = $this->getOrder(
!empty($result['merchantReference']) ? $result['merchantReference'] : null
);

@candemiralp
Copy link
Member

Hello @dimitriBouteille,

Thanks for creating this issue. We have validated the issue and created an internal ticket to solve it.

Adding cartId was a decision for adding an extra layer of security. Otherwise, anyone could query payment details and fetch payment action.

Best Regards,
Can

@candemiralp candemiralp self-assigned this Feb 7, 2024
@candemiralp candemiralp changed the title [V9][GraphQl] adyenPaymentDetails returns The cart isn't active. with old HPP methods [ECP-8776][V9][GraphQl] adyenPaymentDetails returns The cart isn't active. with old HPP methods Feb 7, 2024
@dimitriBouteille
Copy link
Contributor Author

To fix the bug while waiting for a fix, I made the following patch :

Index: vendor/adyen/module-payment/Observer/SubmitQuoteObserver.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vendor/adyen/module-payment/Observer/SubmitQuoteObserver.php b/vendor/adyen/module-payment/Observer/SubmitQuoteObserver.php
--- a/vendor/adyen/module-payment/Observer/SubmitQuoteObserver.php	
+++ b/vendor/adyen/module-payment/Observer/SubmitQuoteObserver.php	(date 1707129014897)
@@ -28,7 +28,7 @@
         //TODO: Once we have a config in the magento backoffice, get all the methods directly from this config
         if (in_array(
             $payment->getMethod(),
-            ['adyen_hpp', 'adyen_cc', 'adyen_oneclick', 'adyen_paypal', 'adyen_ideal'],
+            ['adyen_hpp', 'adyen_cc', 'adyen_oneclick', 'adyen_paypal', 'adyen_ideal', 'adyen_twint', 'adyen_applepay', 'adyen_bcmc'],
             true
         )) {
             /** @var Quote $quote */
``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Indicates that issue has been marked as a possible bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants