I'm trying to use commerce subscription to make recurring payments on paypal via drupal commerce. Payment goes through to paypal, but it is one-time, not recurring. I'm using Drupal 7.7 with the latest dev.
I've created a subscription product via Add a product >> Create subscription, and set the default subscription fields as I wish them to be presented to paypal.
I have also added the Subscription period, period unit, subscription recurs and subscription recur limit fields to the order fields and subsequently as hidden fields in the shopping cart view (is this something that I'm supposed to do?)
When making a test order, on the payment redirect page, I can't see any fields on the form that goes to paypal that include recurring payment info. Should there be hidden fields in this form like on paypal subscription buttons (a3, p3, t3, etc.)?
I'm able to make recurring payments on the sandbox from my site with paypal subscription buttons. Any advice to how I can connect drupal commerce to paypal and make a recurring payment would be immensely appreciated.
Thanks in advance for any help!
Comments
Comment #1
rupertj commentedSorry - my bad! The code that adds those fields to the form was totally missing. (We're in the process of teasing commerce_subscription into a working standalone module out of the rest of our platoform, and that bit got missed).
If you grab the -dev module again tomorrow after the packaging script's run, or get it from git now, you should find there's a new function commerce_subscription_form_commerce_paypal_wps_redirect_form_alter() which adds the fields.
Comment #3
duntuk commentedI'm having the same exact problem. Using the latest version of all modules--it doesn't pass any subscription data, only regular single order data.
There really should be documentation for this module, especially if you have to take extra steps to get this to work.
Comment #4
rupertj commentedduntuk - It's more likely that you've found a bug than there's some documentation missing. (Although we do need documentation.)
So, have a look in the function I mentioned above - commerce_subscription_form_commerce_paypal_wps_redirect_form_alter(). If you can figure out from that why the fields aren't being added to the form in your setup, that'd be really useful. I'd guess it'll be due to the properties of the product somehow. A dump of the fields you've got set on your product would be helpful for figuring this out too.
Comment #5
duntuk commentedOk... I found the problem. The checkbox "This subscription recurs" doesn't stayed checked (i.e. after you hit save).
changing the if statement for this so it validates as true (changed the '0' to something else) sends over the data properly as a subscription.
And thanks for the quick reply
Comment #6
duntuk commentedHmmm. Seems like my little hack only fixes this partially. Doing the above turns the item in a trial subscription, but it doesn't recur. So there must be other triggers that the checkbox must setting. So bottom line, this checkbox has to work.
Any ideas on why it's not staying checked?
Comment #7
duntuk commentedAnother solved issue solved this: http://drupal.org/node/1272066. Thanks.
Comment #8
duntuk commentedFound another issue. Under the paypal "description" field this module passes the "site name" instead of the product name.
Comment #9
mrconnerton commentedI can confirm that this is now fixed with latest code. I'm not sure if it is because of http://drupal.org/node/1272066 or not.
@dantuk - you should open a new issue for the description/site name issue