- Status changed to Needs review
almost 2 years ago 11:56am 18 January 2023 - Status changed to Fixed
almost 2 years ago 12:12pm 18 January 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
almost 2 years ago 4:41am 3 February 2023 - 🇦🇺Australia ac Perth
Line 165 of the patch to js/paypal-checkout-custom-card-fields.js in this commit breaks the card field on checkout. It throws a console error and you can not progress through the checkout:
Uncaught TypeError: Cannot read properties of undefined (reading 'split') at HTMLInputElement.<anonymous> (paypal-checkout-custom-card-fields.js?rp1r4m:167:45) at Function.each (jquery.min.js?v=3.6.3:2:3003)
- 🇦🇺Australia thursday_bw
I realise this issue is closed and fixed, but I am seeing this exact issue.
The buttons show for a logged in user, but not anonymous :/
I have the latest release 1.4 from 18th Jan installed.. hmm. - 🇦🇺Australia thursday_bw
Here you can see as a logged in user the relevant JS files are loaded.
Here as an anonymous user, they are not.
- 🇮🇱Israel jsacksick
Do you have console errors to share? Anything? Do you have conditions set on the gateway configuration perhaps?
- 🇦🇺Australia thursday_bw
First thing I did was look for console errors, there was nothing to see there.
I haven't set any conditions on my payment gateway - 🇦🇺Australia thursday_bw
Network log FYI, nothing much to see here either.
I can see that 'once' is loaded.
- 🇮🇱Israel jsacksick
I just tried locally and I'm seeing the smart payment buttons locally as an anonymous user... Not really sure what's specific to your install...
If you're comfortable debugging... You can try following the logic from commerce_paypal_form_commerce_checkout_flow_alter() (the buttons are injected from there).
- 🇦🇺Australia thursday_bw
I have done some debugging.
In this file: commerce_paypal/src/PluginForm/Checkout/PaymentMethodAddForm.php
In the shouldInjectForm() method, `$plugin->getPaymentSolution() ` is returning `smart_payment_buttons` not `custom_card_fields`.Does that give you a clue?
- 🇦🇺Australia thursday_bw
Hmm. I have it working now.. I was brain farting at the end there (it is 2:53 am lol).
I wasn't clicking all the way through to the review page and was looking at order information.
so perhaps my reinstall resolved it. My previous setup was a database that had version 1.0 and had been upgraded to 1.4.. maybe that was it. I don't know.. It is 3am, I am going to be and will revisit this tomorrow and see if it still works.This is all on a stock standard drupal and I need to transfer to the site I am building, I have learned heaps, thanks for you prompt support.