Hi Xano,
I'm trying to get my head around this module, as I will be using it extensively in an application I'm developing. To start with, I am creating a contrib module to allow for donations. (On a side note, it will also allow for admins to add new payments, and relate them to users by selecting a uid.) Donations require a payment form where the user can fill in their own amount, description, payment method, and click "Pay".
Currently, my form is never getting to its submission function because the payment_method field is setting $form_state['rebuild'] to TRUE. I'm not so familiar with multistep forms, but shouldn't it revert to FALSE when its done, so the form can execute like normal?
I believe @chaby had a similar problem here: http://drupal.org/node/1370118#comment-6220222.
Appreciate any insight you can give.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | payment_arbitrary.zip | 2.09 KB | Chris Gillis |
Comments
Comment #1
xanoIt should only rebuild when you choose a different payment method than the one that is currently being used, so the form can be rebuilt and the new payment method-specific elements can be displayed to the user.
If that does not get you on the right track, please provide step-by-step instructions on how to reproduce the problem.
Comment #2
Chris Gillis commentedHere, this is what my form looks like:
So the form displays as expected, I can choose a payment method, fill in the details, and then, when I click the Pay button, nothing happens. payment_arbitrary_form_submit() is never called...
Comment #3
xanoI have little time, so please provide me with a ready-to-go module that I can enable and test directly, without even having to configure anything.
Comment #4
Chris Gillis commentedSure. Very simple module attached. Ignore all the commented code. Enable it and then go to 'payment/new'.
Thanks for your time.
Comment #5
Chris Gillis commentedWell, I gave up using
'#type' => 'payment_method'and just got the options myself using the following method.The arbitrary module is now working. You can see it here: http://drupal.org/sandbox/ChrisGillis/2000394
Comment #6
xanoIt's better to use Payment::availablePaymentMethods(), so you don't get to see any methods that are not able to process the payment at all.