I believe there's a small issue with the payment module that triggers this error on some payment methods. When I checkout using commerce_no_payment module the error is triggered, and after a quick google it seems that module is not alone:
* #1230666: Creating transactions throws undefined index for payment details
* #1670752: Notice: Undefined index: payment_details in commerce_payment_pane_checkout_form_submit()
* #1646096: Undefined index: payment_details in commerce_payment_order_transaction_add_form_validate()
* #1569386: Notice: Undefined index: payment_details
This code assumes that $pane_values has a 'payment_details' value set, which seems to not be the case always.
if ($callback = commerce_payment_method_callback($payment_method, 'submit_form_submit')) {
// If payment fails, rebuild the checkout form without progressing.
if ($callback($payment_method, $pane_form['payment_details'], $pane_values['payment_details'], $order, $balance) === FALSE) {
$form_state['rebuild'] = TRUE;
}
}
The attached patch simply sets that value as needed. Not sure if it has other implications but it's no longer generating the PHP notice for me and all seems to be working fine with commerce_no_payment.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | commerce_payment_1705862-1.patch | 984 bytes | hadsie |
| #1 | commerce_payment_1705862.patch | 986 bytes | hadsie |
Comments
Comment #1
hadsie commentedComment #2
hadsie commentedSorry, the above patch does nothing... I'd commented out the only line that does anything for testing :). Anyway, this patch should actually do something.
Comment #3
rar commentedWorked for me to get rid of the error message. Nice job.
Comment #4
rszrama commentedGood catch. I've fixed this with a slightly different approach - basically initializing the payment details array in the $pane_values array if it doesn't exist yet:
Commit: http://drupalcode.org/project/commerce.git/commitdiff/a1021f4
Comment #6
rszrama commentedAnd just did the same for the validate callback.
Commit: http://drupalcode.org/project/commerce.git/commitdiff/ce87876