unable to finish checkout when selecting iDeal

Created on 29 January 2024, 5 months ago
Updated 14 February 2024, 5 months ago

Problem

Unable to finish checkout when selecting iDeal as payment method.
Even though according to Adyen CA , the payment was successful.
Website also received AUTHORIZATION webhook notification from Adyen.

Steps to reproduce

Activate iDeal as a payment method from Adyen CA, in my case using test.
Select iDeal during checkout.
Customer was redirected to iDeal page to finish the payment.
After click on "continue" button (because I use test merchant), customer was redirected back to the website.
Unfortunately in the customer is redirected back to "/checkout/xx/payment" page,
complete with sessionId and redirectResult as query params.

At first I thought is it because if Dropin.php onReturn could not process the redirectResult ?
But in error report logs I notice a new error.
Not sure if this is related to the incorrect redirection ?

The error is as following
Type: commerce_avatax
Location: checkout/xx/order_information
Message:

POST error Authentication failed
api/v2/transactions/create
Request:

array(
  'json' => array(
    'type' => 'SalesOrder',
    'companyCode' => 'DEFAULT',
    'date' => '2024-01-29T11:48:59+01:00',
    'code' => 'DC-d5ed09e0-4d35-4abe-953a-12a1a7b8ef97',
    'currencyCode' => 'EUR',
    'lines' => array(
      array(
        'number' => '2cf3a0bf-d716-49cf-ad75-0aadaad27f07',
        'quantity' => '1.00',
        'amount' => '99.99',
        'itemCode' => 'WoodCo-BBS-001',
        'addresses' => array(
          'shipFrom' => array(
            'line1' => '100 W 33rd St',
            'line2' => '',
            'city' => 'New York',
            'region' => 'NY',
            'country' => 'US',
            'postalCode' => '10001',
          ),
          'shipTo' => array(
            'line1' => 'wimstraat 1',
            'line2' => '',
            'city' => 'rotterdam',
            'region' => '',
            'country' => 'NL',
            'postalCode' => '3016ch',
          ),
        ),
        'taxCode' => NULL,
      ),
    ),
    'customerCode' => 'buyertest@mymail.com',
  ),
)

Response:

array(
  'error' => array(
    'code' => 'AuthenticationException',
    'message' => 'Authentication failed.',
    'details' => array(
      array(
        'code' => 'AuthenticationException',
        'message' => 'Authentication failed.',
        'description' => 'Missing authentication or unable to authenticate the user or the account.',
        'faultCode' => 'Client',
        'helpLink' => 'http://developer.avalara.com/avatax/errors/AuthenticationException',
      ),
    ),
  ),
)
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇩Indonesia winnie80

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @winnie80
  • 🇮🇩Indonesia winnie80

    The error I mention previously is related to Avatax module, which we are not use at this moment.
    So I remove it, no more error coming from Avatax module.

    However the iDeal checkout trouble is still persistant.
    This time no error recorded in drupal report logs.
    So not sure what is wrong with it.

    The same as before, our site got webhook notification from Adyen (this time after 2 minutes)
    And this notification change the order state from "draft" to "completed".

    Payment captured via adyen_dropin_ym for € 10,00.
    Transaction ID: GVBZH389K6ZW8N82.
  • 🇮🇩Indonesia winnie80

    Finally found the main cause of this problem.
    It is in commerce_adyen_drop_in/src/PluginForm/OffsiteRedirect/PaymentOffsiteForm.php line 37 and line 38.
    Because of typo in getting url parameters.
    It should be "sessionId" on line 37 and "redirectResult" on line 38.
    After adjusting those lines, your module works like a charm using iDeal payment.

  • 🇮🇩Indonesia winnie80

    here is a patch

  • 🇮🇩Indonesia winnie80

    Borgan, is it possible to use latest adyen api with this module?
    The latest version is currently v17.
    Perhaps that is why the url parameter naming is incorrect , due to change in version after 13 ?

  • Status changed to Needs review 5 months ago
  • 🇬🇧United Kingdom bdziewierz

    Hi! Thanks for the patch and well spotted. I don't think the issues is due to the SDK version difference. It looks like it was simply a typo. Testing your patch now.

  • 🇬🇧United Kingdom bdziewierz

    This change is now merged to dev. Before I mark as fixed, could you confirm that this fixed the original issue on your side as well?

  • Status changed to Active 5 months ago
  • 🇮🇩Indonesia winnie80

    Yes, Bogdan, on my side the iDeal payment is now working correctly.

  • Status changed to Fixed 5 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024