This is a follow-up issue to #959138: Doesn't work with multipage webforms, which added the ability for Webform Pay to (mostly) work on multi-page web forms. The missing functionality from that patch is the ability to place a pay component on an earlier page in the form, not just the last page. This presents several challenges:

- Pay module only has one method to add both the payment form and the submit handlers to a form. We'd need to display the payment form on one page and only fire the submit handlers on the last page.
- Pay module does not allow default values, so going to a previous page would empty out the payment information and they would need to be re-entered before going forward again.

CommentFileSizeAuthor
#4 webform_pay_any_page.patch306 bytesquicksketch

Comments

kevinquillen’s picture

I am using latest Webform Pay alpha3 from Dec 29 2010, but now when I reach the last page, the payment component is not displaying. My form is only two pages. The component fieldset is output, but the form fields are not.

kevinquillen’s picture

In webform_pay.module:


   // Initialize the form for the selected payment method.
   if ($element && $pay_form = pay_form_load($component['extra']['pfid'])) {
      $form['#pre_render'][] = 'webform_pay_prerender';
      $form['#validate'][] = 'webform_pay_validate';
      $pay_form->form($form, $form_state, 'webform');
      $form['#after_build'][] = 'webform_pay_after_build';
   }

If I put an exit in the if, the page exits. It seems like pay_form->form is not adding the fields. Still digging as to why.

kevinquillen’s picture

This solution did it for me:

http://drupal.org/node/1014550#comment-3929558

Putting that into webform_pay.inc made the fields show up.

quicksketch’s picture

Status: Active » Needs work
StatusFileSize
new306 bytes

Following the suggestion above, I tried out the attached patch which *does* indeed make the fields show up if you put the Pay component on some other page besides the last one. Unfortunately it doesn't seem to actually get submitted to the payment gateway. I'm not sure if this is a limitation or problem with Pay module or Webform Pay.

jpamental’s picture

I'm not sure if this is connected but I'm seeing an issue where I have a 3 page form and the Pay component on the last page - but nothing is submitted to the gateway (so nothing shows under Payment Reports either). When the pay component is added to a one-page form it works perfectly. Does anyone have it working properly with Paypal API on a multi-page form?

Thanks! (for the module and for the help - use it loads)

Jason

jpamental’s picture

Version: 6.x-1.0-beta1 » 6.x-1.0-beta2

Curiously I have gotten a sample form to work with the payment component on the second page (collect name, address on first page and then amount and payment info on second) - this processes through the PayPal API no problem. But on the application form (school site) that uses several pages and also webform_conditional even though we're certain we're passing the required info (name, address, etc) - all the data goes into the submitted form but nothing ever gets to PayPal or is recorded in the Payments Report section. Also - not seeing anything in the Recent Log Entries report either.

If anyone has any ideas where to look I'd certainly appreciate it.

Jason