I'm using Paypal Web Payments Pro, and I'm disappointed to see that it does not post an itemized transaction to the WPP gateway with uc_paypal.

Web Payments Standard (WPS) offers this functionality -- it's exposed through uc_paypal.

How can I go about posting an itemized transaction with WPP?

It's critical that my transactional data be itemized.
Does Authorize (and uc_authorize_net) support this functionality?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave’s picture

Category: support » feature

This is not currently supported, so this becomes a feature request.

Authorize.Net does not support this yet either: #498858: Utilize Itemized Order Information Authorize.net

AaronBauman’s picture

Correct me if I'm wrong, but according to paypal's NVP documentation it looks like adding this feature would be as simple as injecting item data into the DoDirectPayment NVP POST. I will start working on a proof of concept patch based on this understanding.

Any specific features that should be included for this patch to be considered for inclusion?

longwave’s picture

If PayPal WPS uses an identical or similar data format, it would be good to combine the two into a single function rather than duplicating code. Otherwise, go for it - any patches will be gratefully received!

TR's comment about an even more generic function to do this in #498858-9: Utilize Itemized Order Information Authorize.net is also worth considering, but perhaps too much to take on here.

AaronBauman’s picture

Status: Active » Needs review
FileSize
1.62 KB

OK, WPS and WPP formats are different enough that I don't think they could be combined easily into a single function.

Here's a proof of concept patch that i've tested very briefly.

writing this patch raised 3 minor questions:
1. One of the optional fields for each item in the itemized receipt is the item's taxes. But, uc_taxes doesn't appear to offer a quick, clean way of retrieving the taxes for a single item -- only the entire order. So, for now, itemized taxes are omitted. (The function uc_taxes_apply_item_tax() requires an $item arg as well as a $tax arg, which means that any calling function is responsible for marshalling all the applicable taxes... this is out of hand. Ideally uc_taxes should offer a function to either generate taxes for the order and return an itemized listing of the taxes for each item, or a function to retrieve all the taxes for a single item without any args besides the $item itself. (I know this should be its own issue. Just documenting how it applies here.))
2. Another optional field, description. What should go here? implode()d attributes?
3. Should enabling itemization be configurable? I can't think of plausible use case in which someone would NOT want an itemized record of payment in paypal.

longwave’s picture

Thanks for working on this.

1. As you discovered Ubercart taxes are currently calculated on the order level rather than product level, so there isn't much that can be done here. I think the taxes value in PayPal is optional and for display purposes only so this shouldn't matter too much.

2. Attributes could go here (if the module is enabled) but we could also just leave it blank for now.

3. I don't see why this should be configurable; I'd like to reduce the number of checkboxes and options that Ubercart offers rather than increase them, as this only serves to make things more complicated for users.

Leaving at needs review as I am currently unable to test this.

Status: Needs review » Needs work

The last submitted patch, uc_paypal-itemized_WPP_NVP.patch, failed testing.

AaronBauman’s picture

This patch is working ok for me.
I still haven't figured out how to format a patch to appease testbot =[

AaronBauman’s picture

Here's an update the adds any line items to the itemized total.
Untested.

TR’s picture

Status: Needs work » Needs review

Let's see what the testbot thinks ...

Status: Needs review » Needs work

The last submitted patch, uc_paypal-itemized_WPP_NVP-1394348.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review
FileSize
2.2 KB

Fixed patch format.

TR’s picture

Version: 6.x-2.x-dev » 8.x-4.x-dev
Issue summary: View changes
dvtalk’s picture

Could this be easily implemented in Drupal Commerce?