Could this module be extended to allow the choice of a specific credit card gateway? I have a product class that needs to be purchased using PayPal Express/Pro, while all other products need to go through Authorize.net.
Thanks in advance!
Could this module be extended to allow the choice of a specific credit card gateway? I have a product class that needs to be purchased using PayPal Express/Pro, while all other products need to go through Authorize.net.
Thanks in advance!
Comments
Comment #1
longwaveI think this should be possible, but what if the customer added both types of product to their cart at once?
Comment #2
theamoeba commentedcould you not use conditional actions to group the products by class and then transact them by group?
Comment #3
longwaveUbercart doesn't easily handle split transactions like this, and it would add further issues that need to be dealt with, such as partial failure - what should happen to the order if the PayPal payment succeeded and the Authorize.net payment failed?
Comment #4
Poieo commentedRegardless of split transactions, did someone figure out how to choose a gateway by product class?
By gateway, I mean Authorize.net vs. Linkpoint vs. PayPal, etc...not payment type (credit card, check, etc...)
Comment #5
longwaveI guess there could be a CA trigger added to this module for "select credit card gateway" and an action for "set credit card gateway", then you could use whatever conditions you like to select a single gateway for an order. Need to find a suitable hook to invoke the trigger from, and also find the time to implement this!
Comment #6
Poieo commented@longwave
I need this asap for a client, so we're probably going to write some code to accomplish it. Any direction you want to give so you don't have to do a complete re-write would be great.
A little background in case you're wondering "Why?". This client has a registration for a tour, and a donation to support that tour. The donations are tax deductible, the registrations are not. So, they need the donations to be processed by their non-profit gateway, and the registrations to be handled by their for-profit gateway. I'm sure there are other uses as well.
Comment #7
theamoeba commentedI have got payment methods/gateways working per product class if you still need help with that Poieo.
Comment #8
longwave@Poieo: Yeah, your use case sounds fine, and I'd expect similar cases too - but right now the only ideas for this I have are to implement a new CA trigger and action as I suggested, use the action to temporarily override the credit card gateway variable in global $conf, and find a suitable hook to ensure the trigger is pulled before the credit card payment is processed - perhaps hook_order op 'submit' would do for this.
@theamoeba: Why not share your implementation in this issue so others can use it, and perhaps I can incorporate it straight into the module?
Comment #9
Poieo commented@theamoeba: Yes. Please post your solution as soon as possible. We definitely don't want to re-create this wheel if we don't have to.
Comment #10
theamoeba commentedHi there, I apologise for the massive delay in posting this. I have been working on a hectic project for the past couple of weeks and completely forgot about this issue.
Basically my solution is not exactly complete yet because I still have not found good way to do what needs to be done. At the moment I can split payment gateways by product class but if i have both of the classes in my cart they all go through a single gateway.
Lets explain the system a bit more. I have built an app that works using Userpoints (I used userpoints.module and the UC tie up module). So the splitting of payment types happen when users want to buy points (using a credit card) and when they want to buy items on the site (using points).
I can split the payments using UC conditional actions as I said before using the trigger 'Allow payment methods' and setting a condition on which product class. That is easy.
The problem happens when the user tries to purchase something and he doesn't have enough points or has both points and items in his cart at the same time. The idea to fix this is to check the cart when the user clicks checkout and to then put the items into a temporary cart table and either send the user through the process to buy the points and then come back to automatically send the items through once the points have been purchased or if they don't have enough points to throw a message telling them to buy points and go through the process i mentioned earlier.
This is my dilemma :D. I am busy working on it today if anyone has any suggestions / code that would be great. I will be happy to commit this back to the community if I can get it to work.
Comment #11
theamoeba commentedRight, I have made the splitting of the cart working if two types of classes are added to the cart at the same time it will take one out, in my case it takes points out first as these are needed to buy items. But I dont suppose that it really matters too much depending on what you are doing.
This code is very rough, but it works as far as I can see.
You need to clone the uc_cart_products table and name it wap_temp_cart_products for the below to work.
Comment #12
theamoeba commentedbump.