I thought I would make one last attempt in a separate thread so that it isn't lost elsewhere to see if anyone who is using Recurring with PayPal Website Payments Pro successfully might chime in?

I've probably just stared at this too long. The recurring profile gets set up and charges within PayPal. But I'm not getting this to be updated within Ubercart - success or fail. The screen with the recurring orders just keeps showing 0 total charges even if there are successful attempts within PayPal.

I've tried enabling / disabling various sub-modules. My understanding is various settings like the "enable triggered renewals" wouldn't relate to this - but I've tried various combinations. I need - but don't see what else to try - the Ubercart side to show / know successful vs. failed renewals because there is custom code that does various things for the site based on whether the recurring payment is active / successful.

If anyone is successfully using this - will you mention what you did to get it to work?

Thank you!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

univate’s picture

webchick’s picture

Nope; not yet. I documented what I tried at http://drupal.org/node/877778#comment-3453910 if someone wants to point out any obvious mistakes.

developer-x also sent me some code that he says got this working for him (though I haven't had such luck :)). I'm uploading his versions of the code here, since I ran out of time to dig into this this week, and I'm away all next week teaching workshops. (Sorry that I didn't create patches for this; I'm boarding a plane in about 9 minutes.)

webchick’s picture

Ugh!! Note that your website must be on a web-accessible address/domain name so that Paypal can ping it. If you're trying to test from localhost, you are screwed, and you'll always get back the cryptic:

"We were unable to process your credit card payment. Please verify your card details and try again. If the problem persists, contact us to complete your order."

Thanks, Elvis McNeely. :)

rszrama’s picture

Also related to this - PayPal's sandbox for WPP recurring payments has been broken for most of September. I filed a ticket in their support system and was told it will be functioning properly again... on November 2nd. :-/

I may have misread their response, and the scope of the bugs may affect different sandboxes differently, but it could be that it's not processing or not sending out IPNs at all. I'd contact technical support at PayPal to see if there's a problem there affecting you, too.

The alternative is to do your testing with a live account using small recurring fees with limited lifetimes. Not fun, but it should work. If that's what you're already doing... well... crap. : P

webchick’s picture

Are you effing serious?

Is there a way to tell if you're hitting that issue? Some sort of signature in the response from Paypal?

rszrama’s picture

hehe Not sure - I only found out about it after hounding them about the issue. I happened across a thread in their forums that seemed to indicate it was down. That said, I can setup recurring payments all day long, they just weren't recurring properly. I'd still give it a shot, though... if their sandbox stops working without them knowing about it, I'm willing to bet it can start working randomly, too. : P

webchick’s picture

Well, pretend I'm an idiot and don't know the difference between a working Paypal sandbox and a non-working one because it took me an embarrassingly long period of time to even figure out how to get basic communication happening between UC and Paypal. ;)

Will this problem manifest itself by the inability of Paypal to create a recurring profile? Or the inability for the payments to decrement on the schedule they're supposed to? Or..?

rszrama’s picture

For me PayPal created the recurring profile just fine but we lacked the ability to decrement on schedule. Also, there's an undocumented configuration step in that you should set your IPN URL for the PayPal account to /uc_recurring_hosted/paypal/ipn.

trevorwh’s picture

Hi All,

Just so you know - I authored most of this module and have it running in a production environment. If you have issues, drop me a line on my contact form - quicker then you'll get a response here.

Hope you got it working!

trevorwh’s picture

Also, I should add by most of this module, I mean the Paypal WPP portion - wouldn't want to take any credit from univate :) Thanks.

incaic’s picture

Got a recurring buyer profile created in my sandbox PayPal acct using:

ubercart 6.2.4
uc_recurring 6.2.0.ALPHA5

My last problem was that the original code in function uc_recurring_paypal_wpp_process in file uc_recurring_hosted.module assumes a letter "s" is at the end of unit length (i.e. months, days, weeks) and removes it. Eventhough it makes perfect sense to enter "1 Month|Monthly" as a recurring interval option under Recurring Order Settings. Especially since the example in the help section below it says "1 day|Daily".

Attached is the patch.

Index: uc_recurring_hosted.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_recurring/modules/uc_recurring_hosted/Attic/uc_recurring_hosted.module,v
retrieving revision 1.1.2.16
diff -r1.1.2.16 uc_recurring_hosted.module
685c685,690
<   else $unit = ucfirst(substr($unit, 0, -1));
---
>   else {
>     if (substr($unit,-1) == 's') {
>       $unit = substr($unit, 0, -1);
>     }
>     $unit = ucfirst($unit);
>   }
689c694,699
<   else $trial_unit = ucfirst(substr($trial_unit, 0, -1));
---
>   else {
>     if (substr($trial_unit,-1) == 's') {
>       $trial_unit = substr($trial_unit, 0, -1);
>     }
>     $trial_unit = ucfirst($trial_unit);
>   }

Now on to testing out all the Operations that can be performed on the recurring order ...

WebNewCastle’s picture

I should have stopped by sooner - my apologies. I did end up getting it to work. Although, now that feels like a "thousand projects ago" and I don't remember which few things I did. I think Ryan was stating earlier about some issues PayPal was having. I think I've personally found that their Sandbox environment is more picky and temperamental than production. So along the way sometimes issues and performance problems have been more Sandbox woes than "real problems".

One of the things that was a problem for me was a misunderstanding on my part with settings on both the Drupal and PayPal sides. Between different payment processors I had reviewed/used for a particular project, I kept getting confused when the site was going to trigger actions and when the payment processor was going to do so via recurring profiles in their system.

Actually, I believe the above combined with potential PayPal-Sandbox-having-a-bad-day issues was pretty much all of it. Thanks Trevorwh, Univate, and others for the great work.

- Matt

puravida’s picture

We have this working using the following:

Drupal-6.19 (and drupal-6.20)
Ubercart 6.x-2.x-dev (2010-Dec-10)
UC Recurring Payments and Subscriptions 6.x-2.x-dev (2010-Dec-08)

This combination did get WPP working for CC payments for orders with mixed (recurring & non-recurring) items and multiple recurring items in a single order. Each recurring item gets set up with its own profile.

We were significantly delayed because we hired a developer to code WPP and Paypal EC support, which was working but he never submitted a patch for inclusion. So those changes were lost by alpha4 and above. Then, we were further delayed because the security update to alpha4 broke all of our billing options. Nothing worked after that, due to what seems to have been a typo in the module (code looking for uc_recurring_products instead of uc_recurring_product). Then, we were even further delayed because the Paypal sandbox is so utterly flakey and wouldn't properly setup a verified WPP test business account. Once we finally got through all of that, the tests worked and we went live. We had several orders today and all worked flawlessly.

Note: It seems like the upgrade to alpha5 fixed the typo but did NOT fix our billing woes. So we bit the bullet and upgraded to uc_recurring dev and ubercart dev. That seems to have gotten us through and not interjected any noticeable issues for our usage anyway.

Thanks to all who got involved in this thread to make it happen. Big continued thanks to univate for keeping on pushing this project forward. :)

Cheers,

Brandon

pixelsweatshop’s picture

I have now installed
Drupal-6.20
Ubercart 6.x-2.x-dev (2010-Dec-10)
UC Recurring Payments and Subscriptions 6.x-2.x-dev (2010-Dec-08)

And have setup up a test recurring daily payment on a live WPP account. Payments are being processed, however, there are a couple of things.

1. Even though the payment is processed, the order is still showing as "Pending", not "Completed" (*The payment has cleared on the Visa, and shows in the WPP account)
2. The recurring payment said, "Next Charge: Dec 28 2010 - 8:06pm", but the payment was processed at 9:00am this morning
3. Now the recurring payment says, "Next Charge: Dec 30 2010 - 8:06pm", but it should say, "Dec 29 2010 - 8:06pm" as today is Dec 28 and it is supposed to happen daily.
4. Recurring payments do not appear as new orders.
5. Notifications to customer when a renewal has occurred is also not happening.

Any thoughts?

puravida’s picture

Hello Nigel,

[quote]1. Even though the payment is processed, the order is still showing as "Pending", not "Completed" (*The payment has cleared on the Visa, and shows in the WPP account)
2. The recurring payment said, "Next Charge: Dec 28 2010 - 8:06pm", but the payment was processed at 9:00am this morning
3. Now the recurring payment says, "Next Charge: Dec 30 2010 - 8:06pm", but it should say, "Dec 29 2010 - 8:06pm" as today is Dec 28 and it is supposed to happen daily.[/quote]

First thought is: "what are your recurring attribute settings for the product(s) you created?

[quote]4. Recurring payments do not appear as new orders.[/quote]

Not sure that I would want them to show as new orders. They are not new orders but rather the same order continuing. In our case, new orders would keep adding to a user's account and that would suck for us.

[quote]5. Notifications to customer when a renewal has occurred is also not happening.[/quote]

IF this were implemented, it should be an option. I would imagine that the design is such that you should be setting up a predicate on renewal to send a notification. Most companies would not want a notification (I won't go into why). Additionally, in our case, Paypal sends a notification on our behalf.

pixelsweatshop’s picture

Recurring Attribute Settings:
Applicable SKU: Any
Set the recurring fee amount to the same as selling price of the product at the time of purchase.: Yes
Recurring fee amount: $1.00
Initial charge: 0 Day(s)
Regular interval: 1 day(s)
Number of billing periods: Unlimited

I thought that each recurring fee could be considered a new order for users to receive an invoice/receipt automatically each month through ubercart. This is my fault on the assumption and maybe I will add it as a new feature request. My Clients need an invoice for accounting purposes every recurring payment made. Unless I could do it easily through existing features in conditional actions?

puravida’s picture

@nigel
Hmm.. I don't see anything wrong with your settings. Aside from the values and the SKU (mine is set), only my values on the item differ.

As for the invoice each time, I do agree with you on this point. We also have a lot of foreign customers who ask this of us and it may become an issue in the future. However, I'm not sure the best way to handle this. I believe you could send an email containing an invoice using tokens, but that would not "store" the invoice in the system for printing or retrieval if the original notice/invoice was deleted.

I second the motion for some sort of invoice report on each renewal but we would not want it placed as a new, separate order (i.e. cannot kick off conditional actions again and wouldn't want it counted in order totals, etc).

pixelsweatshop’s picture

Thanks for your response @puravida . I think my lack of understanding, or rather my misconceived notions about how this module works, might be the problem. I might be trying to apply it in a way that wasn't intended, or at least the direction where it is headed in the future. Either way it is an awesome module and I look forward to using it.

pixelsweatshop’s picture

I realized where my misconception comes from. The project description page for this module states, "...Ability to treat a recurring fee as a new order - so it gets access to everything a new order gets at the time of renewal e.g separate invoices, apply roles etc..."

So does this only pertain to recurring subscriptions or?

arski’s picture

sub

arski’s picture

Hey there,

I can't for the life of me see how uc_recurring can work with WPP.

I'm running the latest 2.x dev version and here's the list of issues that I'm seemingly encountering:

1. #777668: Paypal website payment pro not being recognized as a valid recurring payment method - caused by the "fee handler" of the credit "payment method" not being 'credit' as well, but rather 'paypal_wpp'

2. having fixed that, the initial charge works, but the recurring fees don't. I tried to debug some by using the order view form and checking the "process recurring fee" at the bottom. the first issue is the call in line 396 of uc_recurring_product.module:

if (uc_recurring_invoke($fee->fee_handler, 'process callback', array($order, &$fee))) {

uc_recurring_invoke tries to find load the payment method info based on the first argument - however in this case that will be set to "paypal_wpp" again and not "credit" and so no payment method will be found.

3. Having found a workaround for that, the next issue is the callback function of the "credit" payment method - uc_recurring_uc_credit - which is being called in (uc_recurring.module)

function uc_recurring_invoke($handler, $op, $params = array()) {
  $info = uc_recurring_get_recurring_info($handler);
  $function = $info[$op];
  if (function_exists($function)) {
    // Add the op argument to the params, in case the handler will need to use
    // it to identify the operation it is in.
    $params[] = $op;
    return call_user_func_array($function, $params);
  }
}

Calling uc_recurring_uc_credit will just result in uc_recurring_invoke being re-called again.. so that's pretty useless (cf. includes/uc_recurring.uc_credit.inc)

so if I could even start trying to fix this - what function should be processing the recurring payments for a credit card payment method with paypal wpp?

PS. If somebody really has got this working.. you sure you're using the latest -dev and not some previous version? Maybe you could attach the module code here :)

PPS. I would be willing to provide a bounty to the maintainers of this module (or anyone) to get this sorted rather sooner than later, please contact me if you think you can fix this :)

Cheers

puravida’s picture

@arski,

I am extremely busy right now with some major projects but I took some time to reply here publicly, in case it might help you and others. For reference of others, you emailed about how our setup is working (in light of your post that it is not working for you).

I was using the latest 6.x-2.x-dev and just recently upgraded to the latest as of 04/23/2011.
I also recently updated uc_recurring to 6.x-2.x-dev (2011-Apr-03)

I can only imagine that you are having a setup issue of some sort. I saw in another thread that you have "Website Payments Pro (Credit card (paypal_wpp))" as your payment method. I'm not sure that's the complete picture, so here's my settings:

PAYMENT SETTINGS
1. I have Credit Card selected under "Payment methods" (Default Gateway: Paypal WPP)

2. I filled out the credit card settings completely at one point and left those in place

3. I also completed the "PayPal Website Payments Standard settings" at one point*

4. Of course I have the "Payment gateways" (PayPal Website Payment Pro settings) configured

5. For "Recurring payments", I selected "Credit card (paypal_wpp)", checked "Attempt to process recurring fees during checkout"

CART SETTINGS
6. I have "Cart panes" -> checked "Default cart form" and "Recurring order" (perhaps this applies to http://drupal.org/node/793354 ?)

RECURRING SETTINGS
7. "Checkout panes" -> "Recurring Order" is NOT checked

PRODUCTS
8. I setup the attributes for each of our recurring products

*However, I won't be much help for much longer because ShrinkTheWeb is migrating away from Ubercart due to:
http://drupal.org/node/766210
http://drupal.org/node/1012318
http://drupal.org/node/779820 *
http://drupal.org/node/764888 *
http://drupal.org/node/701686 *
http://drupal.org/node/426466
...among a host of other subscription related issues I didn't bother to post.

*these issues, in particular, show that this module is FAR from providing a usuable solution for medium-to-large companies that want to use Ubercart for recurring payments and subscriptions. Since the maintainers do not care about Paypal support and also do not care much about recurring support, we have been forced to support two carts (Ubercart for CC and homegrown for Paypal) for many months. Despite funding thousands of dollars in developing Ubercart and uc_recurring, it is clear that these are just not ready for primetime in anything other than a very simple storefront (98% of stores online today).

Therefore, we have decided to invest heavily in a new cart solution that will address all of our needs and come with the level of support and response necessary to get it done. In the coming years, I hope to see Ubercart evolve into something usable for the next generation of online businesses (i.e. subscription-based models). Until then, I have to bid UC farewell.

univate’s picture

@puravida firstly when posting links to other issues can use use the issue numbers - (ex. [#12345]), as at least one of the issues you linked to was close two years ago, so not sure if that link is a mistake? or you just didn't notice it was closed already?

To respond to your specific question about Paypal support, you are 100% I do not care about Paypal. What I care about is handling recurring payments and this module is not really designed for medium-large to companies (those doing 10,000+ transactions a month, for that I would recommend investing in a custom solution that meets there exact needs).

For small to medium companies (those doing few hundred to a few thousand transactions a month) this module I think is a suitable solution but I would suggest investing in a real payment gateway. Paypal takes control of the recurring intervals and is always going to present problems - so for that reason I do not personally recommend using it to any clients with real businesses (may be ok for those small at home operations that just want to throw a subscription button on their site and not care about the end user experience).

An example of what I consider is a good payment gateway for recurring payments is Authorize.net CIM as that provides the ability to store card details for you and uc_recurring can trigger payments as and when required. Although personally my active projects are not using Authorize.net so I can't provided much support for that either. I am using an Australian gateway uc_securepayau, but the functionality in that gateway is exactly the same

Where specific projects require custom workflows I have coded up custom modules to provide that functionality. But some of the issue you have posted to do not have easy solutions to solve them in generic ways. Lets take the issue with merging multiple recurring payments together, the problem requires to take into account that some recurring payments will have different intervals and other recurring payments will have different start days. Merging payments like this together require some knowledge of the application, e.g it becomes easier if you know all payments are monthly or all start on the same day every month.

Ubercart also has known issues with dealing with hosted payment gateways. I have myself posted issues to re-factoring Paypal code in ubercart event though I don't use the gateway to try and fix some of these issues to help others (#781720: Refactor the Paypal WPS IPN code), but this particular patch has mostly gone unnoticed. What would be great is if people could review my patch and then the ubercart maintainers will be able to commit the patch and we can all get thing moving forward for this gateway.

puravida’s picture

@univate

If I put up a "closed" issue, it was because the resolution did not satisfactorily address our use case.

A few years back, I would have agreed that Paypal was not ready for primetime (case in point, I chose another merchant for the first years of our business) but that is not the case now. Paypal works just fine as a processor and we have had relatively few issues, even though we are a good sized business now and growing quickly. The main consideration is that we need a company that is not going anywhere, so small merchants are out. And the new billing solution we chose (Zuora) just handles the recurring part outside of Paypal, so it doesn't rely on them for that (which is good b/c Paypal isn't the greatest at this yet; though acceptable).

I had several bad experiences with Authorize.net and refuse to use their services again. I considered nearly a dozen payment processors but none of them were sufficient for one reason or another.

I was hoping that this (Ubercart+UC_Recurring) would be an interim solution for us until we grew to the point of affording a custom solution or something like Zuora or Vindicia. But even though we are nowhere near the huge revenues that most of their customers are at, we are planning on success and biting the bullet. I'm just disappointed that more consideration wasn't given to Paypal. Everyone hates Paypal (as do I --in my top 3 all time hated companies) but I've had much worse experiences from other merchants over the years. Paypal is a necessary evil in our case.

And the problem with most custom solutions is that it often creates new problems. The money we invested to help things along with UC + Recurring ended up causing us more headaches than solutions and we are still dealing with the fallout. So we evaluated a 100% separate custom solution and decided that we don't want to become cart developers or even managers of cart developers. We just need something that works and works well. We are growing at a pace where we need 100% of our resources working on custom projects, implementations, etc and just cannot keep dealing with billing headaches.

As for the update you posted, I see where you were going with that. If most of my rant was related to issues you moderated, it wasn't intended as an attack against you or your efforts. In fact, I think the Ubercart developers are dropping the ball in a lot of ways when it comes to supporting a small-to-mid sized subscription-based business. In the end, I appreciated all of the efforts by all maintainers in UC_recurring and UC itself. These modules helped us get through a difficult time in our billing struggles and I applaud the hard work that you all have put in to it.

Best regards,

Brandon

univate’s picture

In the interest of actually understanding the issues effecting @puravida I have posted the issues below:
#766210: Merging multiple orders under a single recurring fee
#1012318: Separate recurring revenue on revenue report
#779820: Solutions for using WPS and multiple subscription products. *
#764888: UC Recurring Payments and Subscriptions 6.x-2.0-alpha6 installation *
#701686: PayPal WPS fails to accept multiple recurring fee products in one order *
#426466: Treat recurring fees as new orders

The closed issue above is an issue I opened before taking over maintainance of uc_recurring and I closed it since it was resolved to a level I was happy with, I thought other issues would be better addressed by opening specific issues. If any issue is closed that has not addressed the op issue then feel free to re-open, although for an issue that old its usually better to open a new clean issue with your specific problem.

This thread here is related to people wanting support for Paypal WPP (I don't use this gateway so I'm sorry I can't really help anyone with this gateway). The issues that have been stared are all related to Paypal Website Payment Standard (WPP and WPS are different, WPS is the service that allows you to add payment buttons on your site through code paypal provides you - due to the very nature of the service it is very inflexible).

The issues that are postponed are ones where the issue is because Paypal WPS doesn't support the functionality - so in those cases all I can say is you will need to use another gateway that offers those features.

In the interest of keeping this thread on issue, so people using Paypal WPP can attempt to help each other work with Paypal can other issues be posted in a separate issue

puravida’s picture

@univate
I appreciate your efforts to move this forward. We have already committed to Zuora for the next three years but I am very interested in seeing UC+recurring eventually replace even their cutting-edge solution. I believe that all businesses should have the opportunity of a reasonably priced (or free) solution to accept payments. Small businesses should be more concerned with making people want to buy than "how in the world can I take your money."

I will check back from time to time and will chime in whenever I think I may have something helpful to add.

So in the interest of clarification:

#764888: Paypal WPS - Order with multiple recurring fee products only sends paypal one recuring fee
#701686: PayPal WPS fails to accept multiple recurring fee products in one order

Those two are related to #779820 but basically just highlight that Paypal is to blame for the lack of functionality. Your explanation was clear. However, we needed a way to block users from creating order headaches for themselves and for us. We resorted to using our legacy cart for Paypal and UC for credit cards but that really just doubled our cart code maintenance while frustrating our customers during the order process (every companies' worst nightmare)

Here's the "deal-breaker" reasons we "had" to move on:

1. #779820: Solutions for using WPS and multiple subscription products.
First and foremost was the inability to use WPS (for paypal payments) due to the multiple subscriptions issue. I fully understand that the limitation is Paypal imposed (shame on them!) but the fact that we had no way to stop users from ordering more than 1 recurring per order was a nightmare in having to cancel, refund, then get them to sign up again. You can imagine that this made us look VERY bad to our customers; like we definitely do not have our act together. Of the suggestions I made to make this "workable" for us (and avoid having to maintain an in-house cart for Paypal) was to block users from checking out with WPS (Paypal payments) whenever they had more than 1 recurring item. A custom message should explain why and that they should update their cart or pay with CC). That is still not an ideal solution, but it is up to Paypal to fix their side in order to make it ideal (i.e. not have to deal with this issue at all and allow multiple recurring per order)

2. #426466: Treat recurring fees as new orders
Not treating recurring fees as new orders was unacceptable for our foreign customers, because many countries mandate that they receive and maintain invoices/receipts on all payments to companies like ours. So they have been running into legal issues, because of our lack of recurring invoice support. We have a lot of international customers and this is a quickly growing problem for us.

3. [ I never took time to post this issue, due to the others ]
There also did not seem to be any tie-in with the IPN for recurring orders (very possible that I missed a setting somewhere), so there has been no way to automatically know that an order was renewed/paid vs canceled, etc. So we just "wing it" and have to watch for Paypal notifications of downgrades and then MANUALLY make a note on the expiration date and then MANUALLY go out and downgrade the account and notify the user. This part just makes me want to kill myself now that we have a lot of customers. :(

4. #1012318: Separate recurring revenue on revenue report
Not having a recurring total is troublesome but writing a query based on my suggestion was sufficient to get us by. At least it gave us an idea of what we were making each month --kind of a necessity to know if we are going broke or not. ;)

5. #766210: Merging multiple orders under a single recurring fee
Merging the orders and handling upgrades, downgrades, prorates, and refunds is a MONUMENTAL task, I know. However, it is a huge bonus because we are spending an increasing amount of time dealing with single orders that almost immediately want to upgrade to ALL PRO, in which case, we have to prorate a refund, cancel, downgrade the order, and have them resubscribe. It's a pain for us and the customer. This sucks for the mere fact that I actually dread upgrades, which should be our #1 goal... ;)

Best regards,

Brandon

arski’s picture

oh my, is it me or is this getting really off topic :o I'm not that disinterested in the WPS side of things in fact, as long as you also provide some thoughts on WPP :)

mjvesper’s picture

@arski Very, and I agree.

@puravida As Univate and Arski are saying this thread is for PayPay WPP and NOT WPS. WPS has limitations, right or wrong, but this isn't a thread to debate why that processor wasn't working for you or why another did. It's specifically about PayPal's other product, WPP, and if and how people got that working or issues they had. There are interesting points, but they belong in another thread.

For the rest...

I have things working with WPP via Express Checkout but I have noticed a small issue that I noted in #1125666: WPP and Pending Transactions which may be related to #21 or #1120944: uc_recurring incorrectly says Error: and "New recurring fee failed on order #" using WPP / Subscriptions. Though I'm not sure if the issue in #21 could be the cause or unrelated. I'd love to help troubleshoot or contribute more, but I'm not intimately familiar with the module code. If @Univate or anyone else has suggestions, I'm open.

mjvesper’s picture

puravida’s picture

@arski, @mjvesper
Thanks for the lecture. * rolls eyes *

I know it may be better off in another thread but this is all related. If you don't want essential feedback to make UC+recurring top-notch, then that's fine but others may want that feedback. Do what you will with the info I provided, as this is not going to be my problem any longer. I funded enough development and provided what feedback I was able.

prodosh’s picture

Issue tags: +payment, +recurring

We were able to get a subscription solution working for a project using Paypal WPP (Paypal Website Payments Pro).
Unfortunately we found out that WPP is not available for companies based in most European countries. WPP is only available in the USA, UK and I believe one other country. What a bummer.
You may want to include this in the documentation and save others who try this a lot of time. Wish Paypal would document simple stuff like this themselves.
In case you are wondering we were able to test the functionality using Paypal sandbox seller accounts (WPP and WPS versions): the WPP sandbox seller account worked in the shop, the other one didn't.

arski’s picture

pardon me, but how?? As I mentioned in #777668: Paypal website payment pro not being recognized as a valid recurring payment method and up here at http://drupal.org/node/911664#comment-4407800 the "payment method" appears to be wrong and there is no handler to process recurring wpp payments anywhere in the code?? I'm really failing to understand how this could even remotely work :(

And what do you mean by "wpp seller accounts" - the recurring payments should be setup for a buyer who purchases something on your site.. umm..

mjvesper’s picture

@arski Actually, I was able to get recurring payments to process using WPP... I just had an issue with each re-bill or retry in case of an error showing up as a new order number. Though my setup involved a product with the recurring payment added as a feature rather than using the Subscription Manager portion nor the Recurring Order module to duplicate an entire order (or have the checkbox in the cart).

What's your setup btw?

Oh, and the sandboxes are the way that PayPal gives sellers to test their applications and transaction processing without actually exchanging money.

asb’s picture

sub

justclint’s picture

Well, I finally got around to playing with this and as of today 6/20/2011 Im using the lastest Drupal, UC and UC Recurring and it seems to be working.

Did a live transaction and 2 order items showed up in WPP. One was for the 1st payment and showed the status of "Completed." The 2nd was a line item with no totals with status of "Created." When clicking on the details of this 2nd transaction it shows that a Recurring Billing Profile was created for the customer.

So from what I can see, it all seems peachy!

By the way I did use the Subscription Manager to create the subscription products. I also used the role assignment feature and that worked as well.

Great Module Guys! We've been needing this for some time.

eric.chenchao’s picture

subscribe

icvjames’s picture

Priority: Normal » Critical
Issue tags: +paypal, +wpp

We really need some help here on this issue.
Can MJvesper or Justclint please tell me(us) more details on how they arranged things in Drupal / Ubercart using WPP?
We currently have both WPS and Credit Card chosen in the Payment Methods.. as there is no WPP option. Is this needed? Or is it messing things up?
I too will reward anyone that can help us get this configured asap.....

Thanks
James

subscribe

justclint’s picture

Hey James, we are using Website Payments Pro which you would need to subscribe to through Paypal. Sign up here: https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content&con...

I have not tried setting this up with Website Payments Standard but I noticed on the uc_recurring project page it states that its not currently working with WPS.

Once you have your WPP account with PayPal you will need to enable both credit card and paypal under the ubercart module.

Then when you go to admin/store/settings/payment/edit/methods you should see a checkbox for credit card. In that line item to the right you will have a drop down menu. Here is where you select WPP.

Then go to admin/store/settings/payment/edit/gateways and this is where you will put in your WPP credentials.

Hope this helps.

vedariy’s picture

Hey Justclint!
Can you tell - what version of Drupal are you using? Where Ubercart+Recurring Subscription works fine.
Thanks

justclint’s picture

Hey vedariy, we are on 6.22. We actually using pressflow 6.22 but that shouldn't make a difference.

Freemantus’s picture

I have same problem with WPP and Recurring payments. I was configured IPNs to url http://www.mysite/com/uc_recurring_hosted/paypal/ipn/ and in watchdog i can see now what PayPal sends IPNs with original order ID "Order created as a recurring fee for order 320". But this order have a ID 363 and in result folowing message in Watchdog: "Failed to capture recurring fee of 1500.000 for product xxx-xxxx on order 320". Paypal don't know what ID must be in IPN.
Maybe there is other way to configure recurring payments, for example through Recurring orders module. Now I have them configured via Recurring Product module.

RachelNY’s picture

@justclint (and anyone else who has this working with WPP) - can you confirm that you are using the dev version and not the alpha version? I am about to take a crack at setting this up with Drupal 6.22.

Thanks!
Rachel

Freemantus’s picture

Working! After enabling Recurring Order module.
drupal 6.22,
Ubercart 6.x-2.4,
UC recurring 6.x-2.x-dev.

deggertsen’s picture

Check out the patches on this post and review. I'm hoping that they fix a number of problems with WPP integration.

http://drupal.org/node/1229454#comment-5010088

AaronBauman’s picture

uc_recurring (+ uc_recurring_product + uc_recurring_hosted + WPP) is working to do the following:

  • capture and record the recurring fee (in Drupal)
  • create the recurring payment profile (in Paypal)

To me these are the critical points: I'm capturing user info and I'm capturing recurring monies.

The major outstanding issues where uc_recurring is failing are:

I did not need to use any of the patches in this thread, or any of the patches in any referenced threads.

EthanT’s picture

#44 Patches didn't work for me - wish I could be of some help on this - great module, but a shame it doesn't support the most widely used payment gateway.

swarad07’s picture

Hey Guys,

I really need some help here. I have been trying to work with ubercart + paypal wpp + uc_recurring to have recurring payments working for me. But I am still not able to get it work.

I have Installed all the modules under Ubercart - recurring package, have enabled Credit Card and Paypal module too. I have enabled the Credit Card payment method with WPP gateway, In Payment Gateways I have enabled Paypal WPP and filled in the API credentials and lastly have checked Credit card (paypal_wpp) in Recurring tab and also have the Enable triggered renewals, Attempt to process recurring fees during checkout options ON.

The issue is, when I try to checkout a product the checkout happens, but I am not able to simulate the recurring charge.

I am familiar with Authorize.net, and here to simulate recurring we click on the charge link. For my particular order (using paypal) I can see the next charge date correctly set to according to my recurring interval, but instead of the charge link there is a Create Profile link, and when I try to create one it gives me the following error.

Unknown column 'billing_assigned' in 'field list' query: UPDATE uc_recurring_users SET billing_assigned = 1 WHERE rfid = 1 in /var/www/uc_test/sites/all/modules/contrib/uc_recurring/modules/uc_recurring_hosted/uc_recurring_hosted.module on line 1331.

I tried to check the DB there is no such column there, in fact there is no reference of any column named "billing_assigned" in entire ubercart.

can someone pls point me in the right direction ?

Thanks,
Swarad

swarad07’s picture

Ok now I have it working, I think I had issues on both Drupal and Paypal sides. I can see in my Paypal Sandbox account's recurring logs that Paypal has charged the credit card on a interval of 1 day. I think I will have to setup IPN to let my website know of these transactions, is that right ?

I have still had no luck with the database column though, and cant find it anywhere else in the code. Any pointer regarding this will be hugely appreciated.

Thanks!
Swarad

rcharamella’s picture

Can you give us some idea of what you did to get rid of the error message you had been receiving? I'm trying to get this running for Drupal 7 & Ubercart 3. I'm getting some error messages similar to yours with the same settings. Maybe your setup will work for my site too. Thanks.

swarad07’s picture

I still have no luck with the error. :(
When I say its working, I mean on Paypal I can see in my account history that recurring payments are happening daily (my recurring interval is 1 day). The orders on the website are not getting updated or anything. I have to check in the dblogs everytime for the IPNs, which is bad as I dont want them on my live site.

Anyways, can you post the error that would give us some idea as to whats wrong.

deggertsen’s picture

I have again posted a couple patches on this issue #1229454: Paypal WPP Trial period submitted as part of recurring payment. They should be an improvement over my previous attempt, but are in no way ready for a production site. I simply hope that they may be a springboard for others to improve upon in order for us to get this working properly. The patches cover much more than just the title of the issue.

swarad07’s picture

I think the problem posted by srahul07 http://drupal.org/node/1229454#comment-6136694 is certainly valid. and we definatly need to something like that happens in authorize.net module which sets trial periods after checking for a flag.

Anyways, I will try to keep up with this thread, I have got it working for a client website, The problem is and this is after lots and lots of debugging and writing tickets to Paypal support.

1. We need to set the IPN callback in the merchant account.

I contacted Paypal with a very specific question asking if my request response are fine wrt to setting up the recurring payment, the reply from paypal was,

Your integration is handling the IPN URL by Code directly for the Direct Payment API, that's true and its working fine. However, our CreaterecurringPayments API is currently not supporting the Parameter NOTIFYURL. For that reason your store is not and cna't submit it directly for Recurring Payments.

To receive recurring Payment IPN's, you will need to setup a IPN URL in your PayPal account.

I confirmed this after seeing the API documentation for the API, so as paypal advised i setup the IPN callback as given in the uc_paypal module.

2. Handling of IPN

Well the good news was after this I started receiving IPN, but thats it I was receiving them else nothing happened. Again I got into debugging mode and took a look at the IPN callback. Its first line itself checks if the IPN contains a a invoice id which is ubercart's order id

if (!isset($_POST['invoice'])) {

    watchdog('uc_paypal', 'IPN attempted with invalid order ID.', array(), WATCHDOG_ERROR);
    
    return;
  
  }

Which is all good and jolly for the first IPN which is recieved when you setup the order but, when the IPN is received when recurring takes place it will not work because in this case the order id is in the key 'rp_invoice_id' (which I think stands for recurring profile invoice id, just a guess)

so the code should be something like this,

if (!isset($_POST['invoice']) || !isset($_POST['rp_invoice_id'])) {
    watchdog('uc_paypal', 'IPN attempted with invalid order ID.', array(), WATCHDOG_ERROR);
    return;
  }
if(isset($_POST['rp_invoice_id'])){
      $order_id = intval($_POST['rp_invoice_id']);
    }
    else{
      $order_id = intval($_POST['invoice']);
    }

After doing this the rest of the callback will need to be tweaked for rest of the housekeeping stuff. I don't entirely see this as a problem with uc_recurring mainly because the IPN callback falls under ubercart's domain, the middle road might be for ubercart to create a process IPN hook so that uc_recurring can implement its own logic in the callback and not entirely rely on ubercart.

Hope this helps guys this issue has been going on for a while.

Cheers,
Swarad

pjindent’s picture

Version: 6.x-2.x-dev » 7.x-2.0-alpha2

We are using Ubercart - recurring payment and subscription module 7.x-2.0-alpha2
In /admin/store/settings/payment/method/creditCredit I have set Card settings->Default gateway=Paypal Website Payment Pro
I am unable to setup recurring payment with Paypal Sandbox; my sandbox business account is of type WPP.

  1. Start with Create Recurring Subscription with /node/add/uc-recurring-subscription
  2. Add feature "recurring fee"
  3. Add product to cart
  4. Go through checkout
  5. Upon payment submission, get error message: "Your order cannot be completed, because we could not process your recurring payment. Please review your payment details and contact us to complete your order if the problem persists."
  6. Order email is sent out
  7. Order is processed, it shows up on user profile with status=completed & Balance=0
  8. In the recurring tab, /admin/store/orders/65/recurring, there are no line items

In /admin/store/settings/payment/method/creditCredit Card settings->Default gateway=Test Gateway

  1. Get no error message
  2. CRON keep adding a pending order on each run

I see a lot of discussion around this, but cannot determine if this issue with WPP has been fixed. Any help on how to get recurring subscription to work appreciated.

pjindent’s picture

We decided to take an alternate route. Instead of "recurring subscription" product with feature recurring, chose recurring order. Even this does not work. Steps:

  1. Created "recurring subscription" product with no recurring features
  2. Defined recurring order using /admin/store/settings/orders/edit/recurring, with options:
  3.   0 months|Non-recurring
      1 minute|1-min
      1 month|Monthly
      6 months|6-Monthly
      1 year|Yearly
  4. Non-recurring order are processed with no errors
  5. For recurring orders, the first order is processed with status="complete", IPN post happens with no errors. But on the order completion screen we get: "Your order cannot be completed, because we could not process your recurring payment. Please review your payment details and contact us to complete your order if the problem persists."
  6. For one-minute orders, no new orders are created

So no luck with recurring products and no luck with recurring orders. Any help appreciated.

dafeder’s picture

Not working for me with WPP. My recurring profile gets created but site errors out when trying to write data to db, and watchdog is full of errors for each transaction. Will be posting into other issues.

UPDATE See #1845694: Paypal WPP recurring payment - site errors out upon completion of transaction

DamienMcKenna’s picture

@swarad07: If you have recurring billing working correctly would you mind uploading either patches or updated files so we can examine them with a home to fixing the module? Any further help you could provide would be *greatly* appreciated. Thanks.

swarad07’s picture

The patch would pretty much contain the same thing that I posted above. So that is a good start.

1. The way IPN handling is done is somewhat wrong, I think Paypal single transaction IPN structure and recurring transactions IPN structure is not same, hence the issue. Refer to Paypal's IPN documentation for all possible use cases that need to be considered.

2. Also one important thing to note is, the API CreaterecurringPayments used doesnot support the param NOTIFYURL, which means you have to explicitly set it up on your paypal merchant. In all the documents I have seen it was never mentioned, after lots of trail and error and talking to paypal this was identified.

3. Test this without recurring, so we can be sure we did not break ubercart :-)

So anyone loooking to fix it should start by looking into the above points, although as I pointed out above, some of this might fall under ubercart's domain, specifically ubercart - paypal's.

I still did not manage to fix the entire flow,somehow it was not conflicting with the business requirement I had. But few issues that are open are, the order doesn't get updated, the code should Ideally add a order comment to the order with the amount that was charged, but somehow this behavior is not consistent.

I will see if I can manage it this weekend, I am neck deep in stuff right now and on top of that will need to setup a public dummy instance again for testing :-/

Cheers,
Swarad

swarad07’s picture

Ok I searched through my old notes to see if I had something jotted down and I found few things,

  1. Transactions working on Paypal end, but IPNs not working
  2. IPN URL needs to be added in Paypal merchant, after that IPN should be received, can be checked by adding a watchdog in uc_paypal IPN callback
  3. The code for checking invoice ID in IPN needs a OR with rp_invoice_id
  4. The invoice updating, order_comment_save, reporting, etc other housekeeping needs to be checked for end to end working.
  5. The problem might be related to UC & UC- Paypal's IPN callback
  6. A hook for IPN handling might be good, invoked by uc_paypal
  7. uc_recurring can use this hook to do housekeeping etc on its end
  8. Not sure if we need to expose entire IPN via hook, some important stuff should be fine, security and other modules interference should be considered.

Hope this helps,

Cheers

matthensley’s picture

I'm in the process of getting this set up, and I believe I have it running at least for my use case. Out of the box, it threw up errors on order submit, which I was able to rectify with the patch in #1845694: Paypal WPP recurring payment - site errors out upon completion of transaction. I agree that it probably isn't the solution for everyone, but it at least got things to process and I've yet to see negative consequences.

I had a couple of other errors pop up on attempts to modify a recurring subscription from the site, and I've resolved them as follows:

  • in uc_recurring.module, the uc_recurring_fee_user_load() function was being passed $rfid as an array, which caused an issue on the db_query(). My post in #1310330: WPP with Recurring product causes errors shows what I did to fix it, but again, it's not a systemic fix, just something I did to get it working for me. This could be a consequence of a change from the aformentioned patch which modified uc_recurring_hosted_subscription_load().
  • once that was resolved, I got errors saying that uc_payment_method_credit_form wasn't receiving the correct number of arguments when being called from the uc_recurring_hosted_paypal_wpp_update_form. It was missing the &$form_state argument which maybe is new in the Drupal 7 form api and never got updated? I'm now passing a NULL value for that argument, which has ended my fatal error but now adds a "Theme key "uc_payment_method_credit_form" not found" warning.
  • After that, I got another fatal error on attempts to call uc_country_select() from uc_recurring_hosted_paypal_wpp_profile_creation_form() in uc_recurring_hosted.module as well. This appears to have been removed from ubercart, and I'm not sure what replaced it but I did comment out the line requesting it for now.

These aren't systemic fixes, but they do highlight a couple of fairly serious issues with wpp. Curious to hear from maintainers about better solutions to the latter two issues especially, since they point to some possible missed updates from 6 to 7, or at least to latest versions of ubercart.

Thanks, hope that wasn't too rambling!

phazer’s picture

I've been working on this for a few days and I have it pretty much working. I had to apply all the patches above to get WPP to work with UC recurring. I have a couple of small issues remaining.

1. I have Express Checkout alsto turned on so people can pay via Paypal since WPP does not have Paypal as an option. I modifed the IPN so the transcation are working and reporting, but as of right now Express does not support recurring orders. So as a quick fix, how can I had the Paypal Express button when there is no recurring orders? Right now it lets them pick it and it places an intial order, but does not setup any Recurring.

2. I have read on some post that people do have PP Express working with UC Recurring. Does anyone have code for this for Drupal 7, the only code patches I found for Express Recurring was for D6.

3. As a note to someone that has trouble getting this to work, when you order Paypal Payment Pro you have to order Recurring Payments with DPRP and not the standard Recurring Billing. They will give you the $10 recurring option as a defautl with your $30 WPP, but this wont work with this module. You need to order the $$30 recurring payments solution (Total $60 a month). In paypal terms you need to order Pro 3.0 with DPRP instead of Pro 2.0.

4. Do I need to set the IPN path at Paypal. I have it set and everything is working, but I read above that you should turn on IPN but not set a URL.

Thanks for all the tips in this thread, it's been a life saver.

JamesRobertson’s picture

@Swarad

I am hoping you can help with point 2. in your post of December 13, 2012

This would be a typical ipn for WPS
http://example.com/uc_recurring_hosted/paypal/ipn/27713

How much of this url should I include in my PayPal Notification URL?

James

dunx’s picture

Issue summary: View changes

Okay, probably late to the party and the horse has bolted, but seeing as I'm still on D6...

I have WPP recurring payments working fine. To correctly cover one scenario, I had to set up the IPN listener on PayPal.

  1. Log on to PayPal.
  2. Click on Profile on the My Account tab.
  3. In the Selling Preferences column Click Instant Payment Notification Preferences.
  4. Click Choose IPN Settings to specify your listener's URL and activate the listener.
  5. Specify the URL for your listener in the Notification URL field (https://www.example.com/uc_recurring_hosted/paypal/ipn)
  6. Click Receive IPN messages (Enabled) to enable your listener.
  7. Click Save.

I only needed to do this when cancelling a WPP recurring payment from PayPal's website, e.g. if a user asked me to cancel a recurring payment on their behalf, where you log in to PayPal and cancel the recurring payment there. This process did generate a watchdog ERROR that it shouldn't have - "Failed to cancel recurring #".

A fix for that can be found here https://www.drupal.org/node/2499871

I'm also allowing users to cancel their own WPP payments and update their card details via my site. That already worked fine.

joshuautley’s picture

Well, for me and after some testing I found that the 2014-Mar-13 dev version of uc_recurring solved my problem. I had alpha3 with a few patches. https://www.drupal.org/project/uc_recurring

Additionally, I found success by falling the directions here to a tee. https://www.drupal.org/node/1311198
I enabled the IPN and turned on auto redirect in "My selling tools" on my PayPal "Profile and settings"

gravit’s picture

Since the project's home page asks for input on this issue, I thought I'd chime in - the Latest versions of d7 ubercart and dev uc_recurring are not working together.

Generally:
There is the issue with the function function uc_country_select being removed from ubercart.

Specifically with paypal:
The recurring fee profile is created ok, and paypal successfully charges on intervals into eternity—however, subsequent ubercart renewal orders remain pending and just show errors that the recurring fee failed.

This is BAD because paypal is actually running charges against the original order ID, and ubercart shows renewals are failing.

My experience with uc recurring in d6 was with auth.net - where its framework pings auth.net and auth.net runs the charge. I think with paypal, paypal is charging on its own schedule and sending back IPN info - so I have no idea how to proceed in debugging this.

gravit’s picture

A little more debugging led me to a question:
Can anyone confirm if you set your IPN url to 'uc_recurring_hosted/paypal/ipn' — does it work as a url proxy for orders that are not recurring?

I don't see code for this currently in the module, and not everything in our store is renewal products. One of the first validation checks is the function "_uc_recurring_hosted_paypal_ipn_order", Which appears to do a lookup on the order to determine if it is a recurring order.

*EDIT* After a test, it appears that ubercart is telling paypal to use the basic ipn during checkout ok.