Needs work
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Payment
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Apr 2014 at 20:11 UTC
Updated:
15 Dec 2015 at 17:41 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
nvahalik commentedAdding check for empty $form_state['values']['payment_details'].
Comment #2
nvahalik commentedComment #3
joshmillerReviewing this patch
Comment #4
joshmillerOk, to reproduce the "bug" you have to straight up unset the payment details like this:
And you will then get this error:
Though, interestingly, using this with Authorize.net terminal OR the example payment terminal, it also ruins the transaction completely and the payment will not continue. With the patch and the "unsetting" of the array in the same function, this patch trades one error:
For another error (with patch and reproduction code):
or with Authorize.net (with patch and reproduction code):
So ... needs work :/ We need a way to faithfully reproduce the error to confirm this notice is really the fault of core commerce.
EDIT: Adding error from Authorize.net to prove it's not just a weird example payment error.
Comment #5
torgospizzaYeah to me this sounds like the custom payment gateway is not implementing the payment method callbacks correctly. If someone could post the code for that it would help us figure this one out :)
Comment #6
nvahalik commentedI have to agree with @torgosPizza. This sounds like a funky module and not a problem with payments. Reporter is free to open the issue again if a link to the code which can reproduce this is posted.
Comment #7
nvahalik commentedI just had this pop up on me again and I will say that it is a problem with a payment gateway that doesn't present a payment form. This isn't a bug in Commerce but rather a module that doesn't implement the terminal properly.
Comment #8
nvahalik commentedtl;dr: If your module specifies a payment terminal validation function without specifying a payment terminal form, you'll get this message. To fix it, just create a payment terminal form and return a form with a single value in it. It will then populate the values and not give you this error message.
Okay, re-opening.
When a payment terminal doesn't specify a form, it gets set to a blank array:
When this array is blank, there are no values associated with it. Ergo, when it comes time to do form validation, if there is a validation function, it passes in the
$form_state['values']['payment_details']without checking to see if it actually exists.Since there is nothing to disallow this, I suggest we simply check to see if the value exists and if it doesn't, then just set it to an empty array.
Comment #9
nvahalik commentedAttaching a different patch that appears to work for me.
Comment #10
mglamanWe do this in commerce_payment_pane_checkout_form_validate()
Looks good, except
Update comment based on checkout pane comment.