Just updated to latest version 6.x-1.0-alpha3.
I am getting the following message repeated 10 times when loading my form.
warning: Invalid argument supplied for foreach() in /opt/bitnami/apps/drupal/htdocs/sites/all/modules/webform_pay/webform_pay.module on line 159.

Result can be seen at http://www.democouncil.co.uk/content/sample-form

Comments

mgoblue21’s picture

I am getting the exact same problem. I've installed Webform, Pay, PayPal (for payflow pro), and Webform Pay modules. I create a payment type (payflow pro), create a webform with a price textfield and the payment information field and I just get this error and it never loads a form.

Can someone maybe give me a quick tutorial on how to actually get the payment form to somehow show up? I am constantly just getting a empty fieldset and I'm confused as to why.

In the Configuration>Payment Settings>Node Settings I don't have any available Node Payment forms, and have no idea how to get a form to show up in the Payment Form Component I add to the Webform I create. The Webform Content Type settings say I have to enable at least one payment type and one form type, but shouldn't these modules give me a default form to use? I don't get any checkboxes of forms to select.

I'd appreciate the input, I'm sure I'm missing something somewhat simple, but there's no documentation at all so running out of ideas. I'm sure a lot of other people would appreciate a step by step post giving us guidance when starting.

quicksketch’s picture

It looks like both of you are having the same problem in that you haven't yet set up a Payment Gateway in Pay module at admin/settings/pay. Note that you need to install payment gateways separately now:

After setting up a payment gateway, edit your Webform and make sure that the gateway is selected when you configure the webform_pay component.

In the Configuration>Payment Settings>Node Settings I don't have any available Node Payment forms

Webform Pay doesn't have anything to do with Node Payment forms. I'd recommend disabling Node Payments module unless you're specifically using it for some other purpose.

but there's no documentation at all so running out of ideas.

The README.txt gives step-by-step instructions as far as Webform Pay is concerned. I can't really provide support on how to set up your gateway (Step 3 in the README) though, since that varies depending on which gateway module you're using.

mgoblue21’s picture

Here's my steps, and I just retried this after uninstalling all the modules on a drupal install:

Install Pay module.
Install Payflopro module you linked to.
Add the payment gateway through /admin/settings/pay, and enter the information required.
It saves, and gives that as my gateway.
From there, I installed Webform Pay.
Created a new webform, added a "Price" field, added the payment information field, selected the Payflowpro gateway, and saved the component.

When I click "View" to see the node I get the "Invalid Argument" error the original poster mentioned....I just have no idea where I could be going wrong...

I tried creating a Authorize.Net payment gateway and I get the same exact error...Do I have to do anything else special to create the payment gateway besides doing it through the admin?

torgormack’s picture

My webform was working fine with the previous version of this module.
I had the authorize.net payment gateway setup and working fine.
I just updated the webform pay module to the latest version and thats' what prompted the errors.

jacerider’s picture

This is a problem for me as well. Looking into the code right now. I'll see what I can find. (I know I have the payment setup correctly via Pay module.)

**UPDATE**
Downgrading to Alpha 2 resolved the issue. I'm looking to see what changed to cause the error.

**UPDATE 2**
Found it. Add:

 $form[$group]['pay_method'] = $this->pay_method_form($form_state); 

below

 $form[$group]['total'] = array(
      '#type' => 'textfield',
      '#access' => FALSE,
    ); 

in webform_pay.inc

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)

**UPDATE**
Downgrading to Alpha 2 resolved the issue. I'm looking to see what changed to cause the error.

**UPDATE 2**
Found it. Add:

This means that you're not running the latest version of Pay module. You should upgrade Pay module to Alpha 6 or later when using Webform Pay Alpha 3 or later. The change you've suggested would actually throw a different error when using the latest version of Pay. See #986694: Pay module API change causes "missing argument 2 for pay::form()".

Perhaps that's the issue with everyone here? Please update to the latest version of both Pay and Webform Pay and test again. That would explain why I can't reproduce the problem (since it's already fixed if you're using the latest versions).

jacerider’s picture

Status: Postponed (maintainer needs more info) » Active

Interesting. I am running both the alpha 6 of Pay and alpha 3 of Webform Pay. I wish the answer was as simple as just updating. Such is life. The search continues.

**UPDATE**

Took a closer look at the Pay module and at the pay_method_form function in my version of the files. Even though it is alpha 6, pay_method_form accepts only the $form_state argument. This is the pay 6.x-1.0-alpha6 version available from http://drupal.org/node/101770/release.

Am I going crazy?

I can see that in the HEAD version the function has changed to two variables:

http://drupalcode.org/viewvc/drupal/contributions/modules/pay/includes/h...

How come your version of Alpha 6 has the correct function and mine doesn't? Strange.

quicksketch’s picture

Looks like I'm incorrect. I'm not using the Alpha 6 version of Pay I'm just using straight-up HEAD. This change was made 6 weeks ago to Pay module:

http://drupalcode.org/viewvc/drupal/contributions/modules/pay/includes/h...

So for the time being, you'll either need to upgrade Pay module to HEAD or downgrade Webform Pay to alpha 2. My suggestion would be the latter, as it's what both maintainers of the modules are likely using.

mipaca’s picture

I was receiving the error message described on my installation trying to run Pay Alpha 6 version and Webform Pay Alpha 3 version. Downgrading Webform Pay to Alpha 2 fixed this issue and my Webform is ready to take payments.

Thanks for this module!

quicksketch’s picture

Category: bug » support
Status: Active » Closed (fixed)

The new releases of Pay (now at 1.1) work with the latest version of Webform Pay now.