🇬🇧United Kingdom @hiraethmarkb

Account created on 11 November 2008, over 15 years ago
#

Recent comments

🇬🇧United Kingdom hiraethmarkb

Seems to me as though there is scope for using both an order state, and the log entities.

While there is nothing stopping anyone from creating a custom workflow featuring a 'Pending' order state, it feels general enough to be useful to have available as a default.

🇬🇧United Kingdom hiraethmarkb

Testing using 'Beta5', and can confirm that the colordepth issue has been resolved.

Have noted a related issue, where when using the gateway in Test mode with test card details, I get an unsupported card error. Appears to be due to the live url being used instead of the sandbox one?

See https://www.drupal.org/project/commerce_opayo_pi/issues/3423018 🐛 Test Mode: OpayoPiOwnForm uses the live url to tokenize card details. Active

🇬🇧United Kingdom hiraethmarkb

With the updated Javascript, I am now able to progress to the 'Review' stage.

However, on clicking 'Pay and complete purchase' I am taken to'Order Information (/checkout/[order_id]/order_information) with the following errors displayed:

Error message

    Warning: Trying to access array offset on value of type int in Drupal\Core\Logger\LogMessageParser->parseMessagePlaceholders() (line 32 of core/lib/Drupal/Core/Logger/LogMessageParser.php).
    Warning: Trying to access array offset on value of type int in Drupal\Core\Logger\LogMessageParser->parseMessagePlaceholders() (line 32 of core/lib/Drupal/Core/Logger/LogMessageParser.php).
    Warning: Trying to access array offset on value of type int in Drupal\Core\Logger\LogMessageParser->parseMessagePlaceholders() (line 32 of core/lib/Drupal/Core/Logger/LogMessageParser.php).
    Warning: Trying to access array offset on value of type int in Drupal\Core\Logger\LogMessageParser->parseMessagePlaceholders() (line 32 of core/lib/Drupal/Core/Logger/LogMessageParser.php).
    Warning: Trying to access array offset on value of type int in Drupal\Core\Logger\LogMessageParser->parseMessagePlaceholders() (line 32 of core/lib/Drupal/Core/Logger/LogMessageParser.php).
    Warning: Trying to access array offset on value of type int in Drupal\Core\Logger\LogMessageParser->parseMessagePlaceholders() (line 32 of core/lib/Drupal/Core/Logger/LogMessageParser.php).
    We encountered an unexpected error processing your payment. Please try again later.
Warning message
Contains invalid characters

And the following is in the file log (potentially sensitive details redacted):

Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoController::MerchantSessionKey requesting new merchant session key
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::requestMerchantSessionKey: Before merchant session key request, mode: test
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::requestMerchantSessionKey: Successful merchant session key response, mode: test
[Fri, 02/16/2024 - 15:10] [Info] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::requestMerchantSessionKey: new merchant session key: [RANDOM_CHARACTERS] (expiry: 2024-02-16T15:16:57.621Z), mode: test
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::getNewMerchantSessionKey: sequence nr: 6 for session key: [RANDOM_CHARACTERS] (expiry: 2024-02-16T15:16:57.621Z) for order 24 (uid: [RANDOM_CHARACTERS]), mode: test
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoController::MerchantSessionKey returned merchant session key settings: @"merchantSessionKey":"[RANDOM_CHARACTERS]","merchantSessionKeyExpirySecs":400,"merchantSessionKeyExpiry":"2024-02-16T15:16:57.621Z","paymentGateway":"opayo_pi","orderId":"24","instruction":"tokenize_and_submit"
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::validateConfigurationForm - payment method bundle: credit_card_opayo, form id: commerce_checkout_flow_opayo_checkout_flow, form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU, form token: RIHfFvfjgVeDdij8gXWzuIIyyJwCzykIyUQYBBbl9RI
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card tokenisation attempted: 1 (form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU)
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card tokenisation result: true (form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU)
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card identifier: [RANDOM_CHARACTERS] (form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU)
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::validateOpayoPiOwnForm - filter errors  (form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU)
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::validateConfigurationForm finished, nr validation errors detected: 0, form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::submitConfigurationForm - payment method bundle: credit_card_opayo, form id: commerce_checkout_flow_opayo_checkout_flow, form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU, form token: RIHfFvfjgVeDdij8gXWzuIIyyJwCzykIyUQYBBbl9RI
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::submitOpayoPiOwnForm called (form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU)
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] PaymentMethodAddForm::submitOpayoPiOwnForm card identifier: [RANDOM_CHARACTERS] returned for merchant session key: [RANDOM_CHARACTERS] (form build id: form-Efk_JEMWYGWVn2ejyYJmI885YZgKLkdRpghLkMlolPU)
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::createPaymentMethod - called
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::createPaymentMethod - updated and saved payment method (id: 6), remote ID: [RANDOM_CHARACTERS]:[RANDOM_CHARACTERS]
[Fri, 02/16/2024 - 15:10] [Info] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::createPaymentMethod: order 24 (uid: 6cc5a30f-853b-4268-ba94-47c65f6406f5), mode: test, saved payment method 6 with remote ID [RANDOM_CHARACTERS]:[RANDOM_CHARACTERS]: merchant session key: [RANDOM_CHARACTERS], card identifier: [RANDOM_CHARACTERS]
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::createPayment called for cart 24
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::submitNewOpayoPiTransaction called for cart 24 using URL: https://pi-test.sagepay.com/api/v1/transactions/
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::submitNewOpayoPiTransaction: cart 24 (uid: 6cc5a30f-853b-4268-ba94-47c65f6406f5), mode: test, create transaction payload: {"transactionType":"Payment","paymentMethod":{"card":{"merchantSessionKey":"[RANDOM_CHARACTERS]","cardIdentifier":"[RANDOM_CHARACTERS]","reusable":"false","save":"false"}},"vendorTxCode":"[VENDOR_TX_CODE]","amount":6092,"currency":"GBP","description":", items: Hoyo De Monterrey Petit Robusto","apply3DSecure":"UseMSPSetting","applyAvsCvcCheck":"UseMSPSetting","customerFirstName":"Mark","customerLastName":"Burns","billingAddress":{"address1":"88","address2":"Inveralmond Industrial Estate","city":"Perth","postalCode":"412","country":"GB","state":null},"entryMethod":"Ecommerce","strongCustomerAuthentication":{"website":"https:\/\/cigarbox.ddev.site:441\/","notificationURL":"https:\/\/cigarbox.ddev.site:441\/commerce_opayo_pi\/3dSecure\/24","browserIP":"[IP_ADDRESS]","browserAcceptHeader":"text\/html, application\/xhtml+xml, image\/avif, image\/webp, application\/xml, *\/*","browserUserAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko\/20100101 Firefox\/123.0","browserJavaEnabled":false,"browserColorDepth":"30","browserScreenHeight":512,"browserScreenWidth":"1274","browserTZ":"0","browserLanguage":"en-GB","browserJavascriptEnabled":"true","challengeWindowSize":"Small"},"customerEmail":"mark.burns+test@whiskyauctioneer.com","customerPhone":"+441738245576"}
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::submitNewOpayoPiTransaction: cart 24, payment transaction request using https://pi-test.sagepay.com/api/v1/transactions/
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::submitNewOpayoPiTransaction: cart 24, payment transaction request completed
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::submitNewOpayoPiTransaction: re-set payment method 6 Remote Id to 'null' to indicate single-use MSK and card identifier have been 'used'.
[Fri, 02/16/2024 - 15:10] [Info] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::submitNewOpayoPiTransaction: cart 24, response payload: {"errors":[{"description":"Contains invalid characters","property":"strongCustomerAuthentication.browserColorDepth","code":1005}]}
[Fri, 02/16/2024 - 15:10] [Warning] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::submitNewOpayoPiTransaction: cart 24, payment transaction failed with response http code 422
[Fri, 02/16/2024 - 15:10] [Warning] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::submitNewOpayoPiTransaction: cart 24, transaction response error 1005, property strongCustomerAuthentication.browserColorDepth, error description: @errorDescr
[Fri, 02/16/2024 - 15:10] [Warning] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] Opayo3DSReview::orderPaymentTransactionFailed: cart 24, unset payment method (ID: 6, remote ID: 
[Fri, 02/16/2024 - 15:10] [Debug] [commerce_opayo_pi] [client: [IP_ADDRESS], markb] OpayoPiPaymentGateway::gatewayFailureResponse, message: Errors in Opayo Pi transaction response, HTTP code: 422, Contains invalid characters 
[Fri, 02/16/2024 - 15:10] [Error] [commerce_payment] [client: [IP_ADDRESS], markb] Technical failure during payment request, details: Errors in Opayo Pi transaction response, HTTP code: 422, Contains invalid characters

I will do some further debugging to try get some more info as to what is happening.

🇬🇧United Kingdom hiraethmarkb

My apologies for the delay in getting back to you with more information, I have been able to do some further testing today and will following up tomorrow after doing some deeper debugging.

I have been able to test using both our custom theme, as well as using Claro (to rule any theme-specific causes) and can provide the log output for review.

Using custom theme:

Browser console log:

Uncaught TypeError: checkoutFormButton is null
    attach https://cigarbox.ddev.site:441/modules/contrib/commerce_opayo_pi/js/opayo-pi-ownform.js?v=1:69
    attach https://cigarbox.ddev.site:441/modules/contrib/commerce_opayo_pi/js/opayo-pi-ownform.js?v=1:20
    attachBehaviors https://cigarbox.ddev.site:441/core/misc/drupal.js?v=10.2.2:166
    attachBehaviors https://cigarbox.ddev.site:441/core/misc/drupal.js?v=10.2.2:162
    insert https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1387
    jQuery 2
    insert https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1385
    commandExecutionQueue https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1046
    promise callback*Drupal.Ajax.prototype.commandExecutionQueue/< https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1039
    commandExecutionQueue https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1036
    success https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1095
    success https://cigarbox.ddev.site:441/themes/contrib/bootstrap/js/misc/ajax.js?s8qqck:137
    success https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:584
    jQuery 8
    eventResponse https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:796
    Ajax https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:646
    jQuery 8
    Ajax https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:635
    ajax https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:267
    loadAjaxBehavior https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:47
    loadAjaxBehavior https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:44
    attach https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:52
    attachBehaviors https://cigarbox.ddev.site:441/core/misc/drupal.js?v=10.2.2:166
    attachBehaviors https://cigarbox.ddev.site:441/core/misc/drupal.js?v=10.2.2:162
    <anonymous> https://cigarbox.ddev.site:441/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:148
    <anonymous> https://cigarbox.ddev.site:441/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:179
opayo-pi-ownform.js:69:9
Navigated to https://cigarbox.ddev.site:441/checkout/20/order_information?check_logged_in=1
Some cookies are misusing the recommended “SameSite“ attribute 6
OpayoPiOwnForm form submit button clicked, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM opayo-pi-ownform.js:357:15
OpayoPiOwnForm request merchant session key using URL: /commerce_opayo_pi/merchantsessionkey/20/tokenize_and_submit, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM opayo-pi-ownform.js:357:15
OpayoPiOwnForm request merchant session key sent (URL: /commerce_opayo_pi/merchantsessionkey/20/tokenize_and_submit), form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM opayo-pi-ownform.js:357:15
OpayoPiOwnForm - Ajax command opayoMerchantSessionKey: returned merchant session key: 82FD0584-DCED-4D08-9DE9-53D196898AD3, expiry: 2024-02-12T11:55:39.632Z, instruction: tokenize_and_submit, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM opayo-pi-ownform.js:357:15
OpayoPiOwnForm.callCardDetailTokenisation: about to call sagepayOwnForm.tokeniseCardDetails with merchant session key: 82FD0584-DCED-4D08-9DE9-53D196898AD3 for card: ************0003, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM opayo-pi-ownform.js:357:15
OpayoPiOwnForm.callCardDetailTokenisation: called sagepayOwnForm.tokeniseCardDetails with merchant session key: 82FD0584-DCED-4D08-9DE9-53D196898AD3, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM opayo-pi-ownform.js:357:15
Navigated to https://cigarbox.ddev.site:441/checkout/20/order_information?check_logged_in=1
OpayoPiOwnForm.cardDetailsTokenised result: true, merchant session key used: 82FD0584-DCED-4D08-9DE9-53D196898AD3, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM opayo-pi-ownform.js:357:15
OpayoPiOwnForm.cardDetailsTokenised set card identifier result to: true opayo-pi-ownform.js:357:15
OpayoPiOwnForm.cardDetailsTokenised success response processed - about to submit form, card identifier: 7BD32E33-A6EB-423B-9395-733505E82E90, merchant session key: 82FD0584-DCED-4D08-9DE9-53D196898AD3 opayo-pi-ownform.js:357:15
OpayoPiOwnForm.cardDetailsTokenised success response processed - form submitted opayo-pi-ownform.js:357:15
Some cookies are misusing the recommended “SameSite“ attribute 4

Output from the Drupal file log:

[Mon, 02/12/2024 - 11:44] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateConfigurationForm finished, nr validation errors detected: 0, form build id: form-4lYJQD_fZN6s3_YvsjJEDQ1GA86x7rXla7wsVHiTUQc
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateConfigurationForm - payment method bundle: credit_card_opayo, form id: commerce_checkout_flow_opayo_checkout_flow, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM, form token: 6MxNsfxcocvVtqkmtXHDPDuPy677BqgdIKMJcqlYWVg
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card tokenisation attempted: 1 (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card tokenisation result:  (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - HTTP error code:  (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - filter errors  (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - no card identifier returned, http error code:  (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - no card identifier returned and no http error code: (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateConfigurationForm finished, nr validation errors detected: 1, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoController::MerchantSessionKey requesting new merchant session key
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoPiPaymentGateway::requestMerchantSessionKey: Before merchant session key request, mode: test
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoPiPaymentGateway::requestMerchantSessionKey: Successful merchant session key response, mode: test
[Mon, 02/12/2024 - 11:48] [Info] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoPiPaymentGateway::requestMerchantSessionKey: new merchant session key: 82FD0584-DCED-4D08-9DE9-53D196898AD3 (expiry: 2024-02-12T11:55:39.632Z), mode: test
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoPiPaymentGateway::getNewMerchantSessionKey: sequence nr: 1 for session key: 82FD0584-DCED-4D08-9DE9-53D196898AD3 (expiry: 2024-02-12T11:55:39.632Z) for order 20 (uid: 6c07d9ab-74f7-4ecd-8198-a628c881beb4), mode: test
[Mon, 02/12/2024 - 11:48] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoController::MerchantSessionKey returned merchant session key settings: @"merchantSessionKey":"82FD0584-DCED-4D08-9DE9-53D196898AD3","merchantSessionKeyExpirySecs":400,"merchantSessionKeyExpiry":"2024-02-12T11:55:39.632Z","paymentGateway":"opayo_pi","orderId":"20","instruction":"tokenize_and_submit"
[Mon, 02/12/2024 - 11:49] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateConfigurationForm - payment method bundle: credit_card_opayo, form id: commerce_checkout_flow_opayo_checkout_flow, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM, form token: 6MxNsfxcocvVtqkmtXHDPDuPy677BqgdIKMJcqlYWVg
[Mon, 02/12/2024 - 11:49] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card tokenisation attempted: 1 (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:49] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card tokenisation result: true (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:49] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card identifier: 7BD32E33-A6EB-423B-9395-733505E82E90 (form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM)
[Mon, 02/12/2024 - 11:49] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateConfigurationForm finished, nr validation errors detected: 0, form build id: form-8r-JYHZqsW2FB7BNH3pwZ4xc2aXl_3t7rSO9geWn7MM

Using Claro.

Browser console log:

Uncaught TypeError: checkoutFormButton is null
    attach https://cigarbox.ddev.site:441/modules/contrib/commerce_opayo_pi/js/opayo-pi-ownform.js?v=1:69
    attach https://cigarbox.ddev.site:441/modules/contrib/commerce_opayo_pi/js/opayo-pi-ownform.js?v=1:20
    attachBehaviors https://cigarbox.ddev.site:441/core/misc/drupal.js?v=10.2.2:166
    attachBehaviors https://cigarbox.ddev.site:441/core/misc/drupal.js?v=10.2.2:162
    insert https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1387
    jQuery 2
    insert https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1385
    commandExecutionQueue https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1046
    promise callback*Drupal.Ajax.prototype.commandExecutionQueue/< https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1039
    commandExecutionQueue https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1036
    success https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:1095
    success https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:584
    jQuery 8
    eventResponse https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:796
    Ajax https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:646
    jQuery 8
    Ajax https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:635
    ajax https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:267
    loadAjaxBehavior https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:47
    loadAjaxBehavior https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:44
    attach https://cigarbox.ddev.site:441/core/misc/ajax.js?v=10.2.2:52
    attachBehaviors https://cigarbox.ddev.site:441/core/misc/drupal.js?v=10.2.2:166
    attachBehaviors https://cigarbox.ddev.site:441/core/misc/drupal.js?v=10.2.2:162
    <anonymous> https://cigarbox.ddev.site:441/core/misc/drupal.init.js?v=10.2.2:32
    listener https://cigarbox.ddev.site:441/core/misc/drupal.init.js?v=10.2.2:20
    domReady https://cigarbox.ddev.site:441/core/misc/drupal.init.js?v=10.2.2:26
    <anonymous> https://cigarbox.ddev.site:441/core/misc/drupal.init.js?v=10.2.2:31
    <anonymous> https://cigarbox.ddev.site:441/core/misc/drupal.init.js?v=10.2.2:34
opayo-pi-ownform.js:69:9
Navigated to https://cigarbox.ddev.site:441/checkout/20/order_information
Some cookies are misusing the recommended “SameSite“ attribute 6
OpayoPiOwnForm form submit button clicked, form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA opayo-pi-ownform.js:357:15
OpayoPiOwnForm request merchant session key using URL: /commerce_opayo_pi/merchantsessionkey/20/tokenize_and_submit, form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA opayo-pi-ownform.js:357:15
OpayoPiOwnForm request merchant session key sent (URL: /commerce_opayo_pi/merchantsessionkey/20/tokenize_and_submit), form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA opayo-pi-ownform.js:357:15
OpayoPiOwnForm - Ajax command opayoMerchantSessionKey: returned merchant session key: 08968DA2-EB4A-4DF3-91DE-87DA1D32B05B, expiry: 2024-02-12T16:26:55.157Z, instruction: tokenize_and_submit, form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA opayo-pi-ownform.js:357:15
OpayoPiOwnForm.callCardDetailTokenisation: about to call sagepayOwnForm.tokeniseCardDetails with merchant session key: 08968DA2-EB4A-4DF3-91DE-87DA1D32B05B for card: *********0006, form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA opayo-pi-ownform.js:357:15
OpayoPiOwnForm.callCardDetailTokenisation: called sagepayOwnForm.tokeniseCardDetails with merchant session key: 08968DA2-EB4A-4DF3-91DE-87DA1D32B05B, form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA opayo-pi-ownform.js:357:15
OpayoPiOwnForm.cardDetailsTokenised result: true, merchant session key used: 08968DA2-EB4A-4DF3-91DE-87DA1D32B05B, form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA opayo-pi-ownform.js:357:15
OpayoPiOwnForm.cardDetailsTokenised set card identifier result to: true opayo-pi-ownform.js:357:15
Navigated to https://cigarbox.ddev.site:441/checkout/20/order_information
OpayoPiOwnForm.cardDetailsTokenised success response processed - about to submit form, card identifier: EEEA87F1-7609-42A4-9207-B71AEEC198DE, merchant session key: 08968DA2-EB4A-4DF3-91DE-87DA1D32B05B opayo-pi-ownform.js:357:15
OpayoPiOwnForm.cardDetailsTokenised success response processed - form submitted opayo-pi-ownform.js:357:15
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. node.js:401:1
Some cookies are misusing the recommended “SameSite“ attribute 4

Output from the Drupal file log:

[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoController::MerchantSessionKey requesting new merchant session key
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoPiPaymentGateway::requestMerchantSessionKey: Before merchant session key request, mode: test
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoPiPaymentGateway::requestMerchantSessionKey: Successful merchant session key response, mode: test
[Mon, 02/12/2024 - 16:20] [Info] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoPiPaymentGateway::requestMerchantSessionKey: new merchant session key: 08968DA2-EB4A-4DF3-91DE-87DA1D32B05B (expiry: 2024-02-12T16:26:55.157Z), mode: test
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoPiPaymentGateway::getNewMerchantSessionKey: sequence nr: 2 for session key: 08968DA2-EB4A-4DF3-91DE-87DA1D32B05B (expiry: 2024-02-12T16:26:55.157Z) for order 20 (uid: 6c07d9ab-74f7-4ecd-8198-a628c881beb4), mode: test
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] OpayoController::MerchantSessionKey returned merchant session key settings: @"merchantSessionKey":"08968DA2-EB4A-4DF3-91DE-87DA1D32B05B","merchantSessionKeyExpirySecs":400,"merchantSessionKeyExpiry":"2024-02-12T16:26:55.157Z","paymentGateway":"opayo_pi","orderId":"20","instruction":"tokenize_and_submit"
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateConfigurationForm - payment method bundle: credit_card_opayo, form id: commerce_checkout_flow_opayo_checkout_flow, form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA, form token: 6MxNsfxcocvVtqkmtXHDPDuPy677BqgdIKMJcqlYWVg
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card tokenisation attempted: 1 (form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA)
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card tokenisation result: true (form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA)
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateOpayoPiOwnForm - card identifier: EEEA87F1-7609-42A4-9207-B71AEEC198DE (form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA)
[Mon, 02/12/2024 - 16:20] [Debug] [commerce_opayo_pi] [client: 172.18.0.6, markb] PaymentMethodAddForm::validateConfigurationForm finished, nr validation errors detected: 0, form build id: form-VjwVMzphbhSvYQ3PFSem-Y6tAvLEDsddIItAmx5TEdA
🇬🇧United Kingdom hiraethmarkb

I have been doing some additional testing at the request of @c_archer, and can provide some additional information.

Running through checkout, following the same steps as @c_archer, the only additional thing to note is the following error being noted in the console:

sagepayOwnForm.tokeniseCardDetails result: false(merchant session key undefined: ....)

This is despite the noted session key matching in both the console log, and the watchdog matching.

I have obfuscated the session key both above and below, in order to avoiding sharing potentially sensitive information.

Watchdog entries:

$ drush watchdog:show --type=commerce_opayo_pi

  ID            Date                Type                          Severity   Message

  238853   19/Jan 16:41   commerce_opayo_pi   Info       Opayo Cron::deleteExpiredCommercePaymentMethods, method IDs queued for deletion:
  238852   19/Jan 16:41   commerce_opayo_pi   Debug      Opayo Cron::deleteExpiredCommercePaymentMethods: cleanup 'nr days' set to -1, delete
                                                         expired entries before 19-01-2024 16:41:17
  238848   19/Jan 16:40   commerce_opayo_pi   Debug      OpayoPiPaymentGateway::getNewMerchantSessionKey: sequence nr: 2 for session key:
                                                         .... (expiry: 2024-01-19T16:46:41.825Z) for order 16
                                                         (uid: 00960914-1542-48
  238847   19/Jan 16:40   commerce_opayo_pi   Info       OpayoPiPaymentGateway::requestMerchantSessionKey: new merchant session key:
                                                         .... (expiry: 2024-01-19T16:46:41.825Z), mode: test
  238846   19/Jan 16:40   commerce_opayo_pi   Debug      OpayoPiPaymentGateway::requestMerchantSessionKey: Successful merchant session key
                                                         response, mode: test
  238845   19/Jan 16:40   commerce_opayo_pi   Debug      OpayoPiPaymentGateway::requestMerchantSessionKey: Before merchant session key request,
                                                         mode: test

I was otherwise seeing the same behaviour as @c_archer, namely:

I enter card details and click Continue to review

On clicking the screen just reloads the same page and I do not get the review pane as expected.

🇬🇧United Kingdom hiraethmarkb

My apologies, the problem is caused by a patch.

For reference if anyone experiences a similar issue, the patch in question is https://www.drupal.org/project/commerce_shipping/issues/3263586#comment-... .

The best thing to do would be to update your composer.json:

  1. Remove the above patch.
  2. Update the line containing:
    "drupal/commerce_shipping": "^2.4",
    to read:
    "drupal/commerce_shipping": "^2.5",
🇬🇧United Kingdom hiraethmarkb

Follow up:

After doing a bit of digging with a colleague, we wonder if this might be composer issue in some way. The repository code has no duplicate, see: https://git.drupalcode.org/project/commerce_shipping/-/blob/8.x-2.5/comm...

Production build 0.69.0 2024