12 replies [Last post]
hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Was this information Helpful?

I need to implement this for a client. The idea is to authenticate a card against the bank or CC provider (if the gateway allows it) and then, when the items are shipped, actually charge the credit card by authorizing the previous authenticated transaction.

The gateway I am planning to use is protx (VPS Direct module contributed here: http://www.ubercart.org/forum/development/2149/protx_payment_gateway_has...) but I think that finding a way to do this would apply to any gateway.

My question is what hooks or schemes should I use for doing this kind of things. I don't the uc_payment support this with the API hooks currently available so I am thinking about the workflow-ng module.

So this is my idea, please let me know what you think and if you can think of a different/better way of doing this:

1. On checkout, have the actual uc_payment with the gateway authenticate the card.
2. Have the contributed module exports some actions and default rules (conditions and events might be needed as well) that would be in charge of authorizing (eventually cancelling) the transaction
3. configure new status on the order status configuration screen or use the ones there. (new status could be: payment authenticated, payment authorized, and shipped for instance), I have to think properly the order status part.
4. Define rules in a way that when the order of the status changed, the transaction is authorized against the gateway and, depending on the result from the gateway, update the stauts or do something else.

Now, what do you think? Does this make sense?. I will definitely need to code the workflow into the gateway module.

Can you think of any other better way of doing this?

Thanks a lot!
It's been an interesting time setting up/developing for ubercart.
a.=

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: authenticate(on checkout)/authorize(when shipped) credit car

Hmm... yeah, I wish this were a little easier to do with at least one of our core payment modules. I hope to beef up our Auth.Net support in the coming days, so we'll see.

Anyways, my only thought is that something as sensitive as capturing authorized funds might be better done as a specific action someone chooses to do. In other words, instead of having someone update the order status and it automatically capturing the funds, have them capture the funds and let that automatically update the order status. There's already a process card button on order view pages, so maybe your module can hook into this form if the card has already been authorized and change it to a capture button. Puzzled

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Re: authenticate(on checkout)/authorize(when shipped) credit

I am about to try and work out your idea of replacing that button. However, can you point me to some, if any, documentation regarding the functionality of that button. I mean something technical such as what flow or functions are called when that button is clicked, and also in which case that's currently being used. I can get the idea of the button but yet not sure how it plugs to the API or the logic of ubercart. I would think that to do this I really won't need to know all of this, but as I am getting to know more and more ubercart I though this worths asking.

Thanks,
a.=

poppers's picture
Offline
Joined: 08/12/2008
Juice: 45
Re: Re: Re: authenticate(on checkout)/authorize(when shipped) cr

I'll be writing up my problems to work out a nearly identical solution using the Auth.net CIM module. Chadcrew has been helping a lot.

My Usage Scenario:
1. Order is placed
2. Card is Authorized status changed to 'completed checkout'
3. Order file is exported locally and status is changed to 'pending shipment' using Ryan's EDI module
4. All pending shipment orders are mashed and uploaded to fulfillment house via a separate cron job
5. Fulfillment house processes incoming orders and ship products
6. Fulfillment house places an order status file on their ftp server
7. Orders status files are pulled down from fulfillment house ftp and saved localy via the separate cron job
8. Elations store processes status files reading tracking info on orders using EDI module afain
9. Order status is marked as 'Completed' and tracking info is attached to order ticket for customer
10. When status reaches completed all outstanding authorizations for that order are capture

The only change to the orginal uc_cim module is that cards are only authorized initially and then captured when the status reaches completed.

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Re: Re: Re: authenticate(on checkout)/authorize(when shipped

So far I am taking the approach Ryan suggested.

I am creating and order pane, similar to the process card button available by the uc_credit module that's an authorize button. Thus giving the store owner the possibility to authorize the card when he wants. I haven't played much with the status yet. And I am also just authorizing the whole lot so far. Eventually, it would be good to give the store owner the option to authorize some or part of it by using a form similar to the one you get if you use the uc_credit process card button.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Re: authenticate(on checkout)/authorize(when shi

I had this bookmarked and should've posted sooner! This code was sponsored in core by Chapter Three, LLC. I'll be posting about it shortly, but the gist of it is as of UC 1.6 the core credit card API will support authorization only, prior authorization capture, immediate capture, and reference transactions. I'll probably make a news announcement about the change or at least a fancy forum post. Eye-wink

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Re: Re: Re: Re: Re: authenticate(on checkout)/authorize(when

Great, please let me know the post or the announcement. I did work something similar to what you suggested in http://drupal.org/project/uc_protx_vsp_direct (dev version).

cedub's picture
Offline
Joined: 03/04/2009
Juice: 33
Docs on transaction types?

Is there documentation regarding how to handle the different transaction types?

All I've really found is this: http://www.ubercart.org/docs/api/hook_payment_gateway

That tells me I can return them from my implementation of the hook_payment_gateway() method, but I don't know where to stick the logic for handling a preauth/capture with my actual gateway. Can you direct me to the right place? thanks.

kevcol's picture
Offline
Joined: 09/01/2009
Juice: 10
Different processes for different products

Hi there,

With this new code, could you use different workflows in the same store depending on the product?

For example:

  • a shipped product (or a membership that requires approval) would "authorize only" until shipped (or approved), at which time there would be a "prior authorization capture"
  • a digital product (or donation or membership not requiring approval) could be set to "immediate capture"

That would be awesome.

Thanks!
Kevin

kevcol's picture
Offline
Joined: 09/01/2009
Juice: 10
Nevermind

Nevermind, I see that Ubercart does all this and more.

Especially with CIM integration: http://www.authorize.net/solutions/merchantsolutions/merchantservices/cim/

vicorock's picture
Offline
Joined: 09/21/2010
Juice: 10
Doing this with conditional actions in Ubercart 2.x/Drupal 6

Hi,

>> different workflows in the same store depending on the product?

>> For example:

>> * a shipped product (or a membership that requires approval) would "authorize only" until shipped (or approved), at which time there would be a "prior authorization capture"
>> * a digital product (or donation or membership not requiring approval) could be set to "immediate capture"

Can someone explain how to set this up through Conditional Actions? Have a client who needs this exact thing done. They use Authorize.net. Given they may have both hard and soft goods in their order during checkout, would like to set it to either 1) "immediate capture" just the soft good amounts, or 2) if that's not possible, then "immediate capture" full amount for any orders that have only soft goods (e.g., donations, membership fees) with "authorize only" being used for the rest of the orders (that have at least one shippable product in them).

Any guidance would be terrific.

Thanks,
Daniel

sandys's picture
Offline
Joined: 09/17/2010
Juice: 10
Re: Doing this with conditional actions in Ubercart 2.x/Drupal 6

I'd appreciate it as well, if there is any way to do this using conditional actions.

From the research I have done, it looks to me as if I need to implement hook_ca_predicate, hook_ca_actions and hook_ca_conditions.

Please help !

imrubio's picture
Offline
Joined: 01/28/2011
Juice: 44
Subscribe +1

I'm interested as well. I was thinking of using the Action to run a PHP script which calls the uc_payment_process function found in uc_payment.module. Your able to pass order information with this action so I hope it will provide all the data that the uc_payment_process function needs. I will report back if this works.