com.drastikbydesign.stripe
com.drastikbydesign.stripe copied to clipboard
Problem switching from credit card to pay later (4.4.3/1.7)
When switching from pay by credit card to pay later option, Stripe processor incorrectly continues to try to validate the credit card fields (which have been removed). This appears to be a jQuery.validate error message, raised in response to the above, on pressing Continue:
Error: The 'exp_month' parameter should be an integer (instead, is undefined).
This is a critical show stopper. My client will not accept my work with this issue open for obvious reasons.
I want to note that this is an issue that I'm having.
In my installation, the hidden_processor field doesn't disappear when "Pay Later" is selected, which means that the code still tries to send the charge to Stripe for processing.
Patches welcome!
I'm looking into using Civi's new JS namespace object to inject JS rather than from .tpl file. In the meantime, if you have a fix for it to notice the pay later option and 'back off', please send it along.
I guess the problem is that right now I don't, and I'm looking for assistance.
I'm mostly playing with this code:
// Handle multiple payment options and Stripe not being chosen. if (cj(this).find(".crm-section.payment_processor-section").length > 0) { if (!(cj(this).find('input[name="hidden_processor"]').length > 0)) { return true; }
}
The first if in there is always true when Pay Later is an option - the payment options div containing the radio buttons is always there.
However, the next if - if hidden_processor does not have a length of greater than 0 (remembering from the last time around this happened that this was merely checking to see if it existed), then it's supposed to return true and cancel the pass-off to Stripe.
Sadly, hidden_processor doesn't disappear when I choose "pay later," so this isn't evaluating correctly.
Trying JS code that checks to see if the radio button for "Pay Later" is selected seems to cause other problems like card numbers not being transmitted or the Stripe Token not being passed, and for the life of me I can't see a way out of this wormhole at the moment.
I will note that a similar problem occurred on previous versions (I'm Kevin from your blog) but I can't see the same fix working.
@incipe So, I'm kind of thinking about this blindly, but I think we should put Stripe's form submit event into a bind function, and bind/unbind when changing payment options.
The trick is a constant, reliable indication of which payment method is being selected (Stripe or not). If memory serves, there wasn't a way to distinguish, they just get random id's.
This is still an issue - using CiviCRM 4.4.5 | v2 Stripe API | 4.4-1.8 - I receive the Error: The 'exp_month' parameter should be an integer (instead, is undefined).
I tried adjusting the payment method check as suggested previously here https://github.com/CEDC/civicrm_stripe/compare/drastik:4.2-1.6...4.2-1.6
I have tried a variety of things but still seem to consistently get that same error
On testing the dev branch the patch by Andy seemed to have fixed this - any reason not to fork a release off dev branch? (I was testing on 4.5)
@eileenmcnaughton Yes, everything is smooth in Drupal, but Wordpress is still broken in a couple ways.