tradefurniturecompany / site

tradefurniturecompany.co.uk (Magento 2)
https://upwork.com/fl/mage2pro
2 stars 0 forks source link

[Global Payments / Realex] The «Place order» button is not working sometimes: «Cannot read properties of undefined (reading 'forEach') at Object.isValidStreet» #239

Closed dmitrii-fediuk closed 1 year ago

dmitrii-fediuk commented 1 year ago
Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
    at Object.isValidStreet (validation.js:107:24)
    at Object.isValidAddress (validation.js:64:27)
    at Object.validate (validation.js:42:34)
    at additional-validators.js:48:26
    at Array.forEach (<anonymous>)
    at Object.validate (additional-validators.js:47:24)
    at UiClass.placeOrder (placeOrder.js:98:42)
    at HTMLButtonElement.<anonymous> (knockout.js:4255:62)
    at HTMLButtonElement.dispatch (jquery.js:5226:27)
    at elemData.handle (jquery.js:4878:29)

01

dmitrii-fediuk commented 1 year ago

The failure point: vendor/realexpayments/hpp/view/frontend/web/js/model/validation.js:107

street.forEach(function (item) {
dmitrii-fediuk commented 1 year ago

quote.shippingAddress().street is not updated when the customer enters a new street.

dmitrii-fediuk commented 1 year ago

How to reproduce: 1) Checkout as a guest. 2) Do not fill the «Street Address» field. 3) Correctly fill all other fields. 4) Select the «Credit/Debit Card» payment method. 5) Click the «Place Order» button. 6) The system does nothing because the required «Street Address» field is empty (the system does not warn the customer, it is bad). 7) Fill the «Street Address» field. 8) The «Place Order» button became broken (because the system does not correctly handle the changed value of the «Street Address» field).

upwork.com/ab/messages/rooms/room_8e141f0c39ea3e5091cd334db37aaef0/story_6c37f0dc6ac6d7a2ec52a8d8e05922e3?companyReference=711981728333447169&atTimestamp=1669345258879&sidebar=true