This is what happens at the moment when adding a recurring payment to a product if you have taxes, using Website Payments Standard:

(Testproduct was 1,00$ with tax 19%
recurring fee set to 1,19$)

- recurring payment is made correctly: 1,19$
- order is created with tax added again, on top of that amount: 1.42$
- order keeps status "pending" with a balance of 0.23$, because only 1,19$ were transfered
- at next renewal, same thing happens again

this way recurring payments always fail, because line items are added on top of the recurring amount when the order is created.

Or am I missing something? Is there another way to do this?
(I cannot switch to WPP because Paypal doesn' have it in my country..)

Comments

ju.ri’s picture

Title: Make Paypal Website Payments Standard work with Taxes » Make Paypal Website Payments Standard work, with Taxes

There is actually another issue with Paypal WPS:
When transferring the payment data to Paypal, the first recurring payment date is set one day (recurring period) later than expected. When I set the product recurring fee to "charged first after 1 days and every 1 days after that", paypal sets the first recurring payment to the day after tomorrow, thus skipping one day.
Ubercart expects the payment on the next day, so the user's balance becomes negative.

To sum up this thread:
- uc_recurring doesn't transfer the taxes/line items to paypal when using Website Payments Standard. It still expects the payment of those line items in the recurring order, leading to different amounts in recurring payments and the order created.
- uc_recurring "skips" one period when transferring the first recurring fee date to Paypal WPS

ju.ri’s picture

I just tested this again with current CVS:
- The issue of skipping a billing period when using Paypal WPS is solved. Great!
- The issue of taxes getting added twice to the renewed order is still there.
Maybe this
http://drupal.org/node/878058 (Copy attributes on renewal by redefining "Set recurring fee same as product price" to mean "Repurchase product")
would help with this problem also?

univate’s picture

The problem with Paypal WPS is that it handles everything offsite and you can't change the order. In uc_recurring_products you add recurring fees to products, but the taxes are added to the order. So if you specify a recurring fee of $10 then that is what is setup as the recurring amount and sent to paypal (as it should be). But when ubercart generates the renewal it will create an order for $10 as expected and then add taxes (say 10%), so the order will end up being $11. But paypal WPS is only setup to charge $10 on the renew (and you can't change this).

The only way of supporting taxes or any other line items in Paypal WPS on renewals is hacking the payment gateway module to make it aware of these items when checkout is occurring.

So this is a Paypal specific problem and changing how uc_recurring works will not help since as you have pointed out above uc_recurring is generating the orders correctly with taxes applied. Other real payment gateways like Authorize.net CIM or securepay do not have this problem as they allow us to generate an order at renewal and process that order with the gateway like any normal transaction. Where as Paypal (WPS or WPP) wants to take over control of your payments which is why I avoid to use these gateways for anything serious like managing recurring payments myself.

ju.ri’s picture

Title: Make Paypal Website Payments Standard work, with Taxes » Make Paypal Website Payments Standard aware of line items on checkout

Thanks for clarification.
I changed the issue title accordingly.
The Problem is that there is no "real" payment gateway available in Europe. I simply cannot set up a subscription site with Ubercart and correct tax handling at this time.
The Ubercart Paypal module seems to pass line items to paypal, but my feeling is that recurring fees have to be summed up before being sent to Paypal.
So my feature request is in fact:
- if "Set recurring fee same as product price" is checked, take the total amount after checkout as the recurring WPS fee
Does that make sense?

univate’s picture

The only way I can see this working is that you create the checkout order and then you create a renewal order at the same, then you can use that information to determine what the checkout price should be and what the renewal amount needs to go to paypal. Then you probably will want to save all this this against the recurring payment in ubercart, so any changes in ubercart wont effect future recurring orders.

There are plenty of payment gateways around the world that offer tokenized payments, where they will store the credit cards and give you a token to charge future payments. I do see the advantages to Paypal for quick setup and small volumes, but for long term business involving recurring payments I really don't understand why you wound use them (just my opinion).

puravida’s picture

[quote]I do see the advantages to Paypal for quick setup and small volumes, but for long term business involving recurring payments I really don't understand why you wound use them (just my opinion).[/quote]

We have a LOT of recurring subscriptions going through Paypal. When our previous merchant provider pulled the plug without notice, we switched over our entire customer base within a month. That went "fairly smoothly". Their WPP product is quite nice and full-featured, except that they currently have a bug with respect to collecting past due amounts.

At any rate, we have used Auth.net in the past and were very unhappy with their customer service and lack of support. There is a lot of support here in ubercart and uc_recurring for their service but that's not enough to sway us from investing in the paypal modules. Unfortunately, our investment so far has been wasted because the freelancer disappeared before submitting patches and the code was subsequently rendered useless.

Just my 2cents ;)

univate’s picture

I think my comment above was more directed at WPS then WPP. As I understand it, WPP is meant to be a real gateway like Auth.net attached to a merchant account(?). Although I still believe that features like Auth.net CIM where the payment gateway just stores the credit card details and does not get in your way of processing what you want, when you want is a allow more complex features in your application (like upgrading) that you could never support then if you used a recurring features provided by the gateway which is how paypal WPP seems to work.

WPP is also only available in the US, so when talking about Paypal a lot of people around the world are stuck with WPS and associate that with Paypal.

puravida’s picture

@univate
That's a good point on US accounts (though they do support WPP for some international zones, I was told by our Paypal account rep).

And yes, you are correct that WPP is like a gateway where you hand off the data and let paypal manage the billing afterwards. It does pose an issue for upgrades/downgrades and we've been running into that lately. We are hoping to overcome that limitation with some crafty coding (http://drupal.org/node/766210).