Handling payment of orders w/shipping and non-shipping goods

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
rayrad
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Fri Dec 19, 2008 9:09 am
Location: Kirkland, WA
Contact:

Handling payment of orders w/shipping and non-shipping goods

Post by rayrad » Fri Dec 19, 2008 11:30 am

I apologize if this has been addressed before. I have searched the forums, looked through the "Good Reference Posts", and generally tried to do due diligence before posting, but could only find topics related to, but not precisely addressing my issue. It seems many people would have encountered this issue, but either this is not so or my forum searching skills are severely lacking.

Situation
I am working on an AbleCommerce installation for a client that primarily sells downloadable videos but will also have some shippable goods. We therefore must configure the gateway (Authorize.net) to Authorize-only so payments are not captured until the shippable items have shipped. For the videos, though, they are configured to "Activate on Full Payment" (to prevent fraud) so the cost must be captured immediately to allow for immediate download.

In the case of a Basket with all shipping goods, then no special processing is necessary. When a Basket has all non-shipping goods I can just post-process the Order and Capture all Payments. It is the mixed case where the problems arise.

Configuration
The App_Data/VersionInfo.xml for the site says:

Code: Select all

<VersionInfo>
	<Platform>ASP.NET</Platform>
	<Version>7.0</Version>
	<BuildNumber>10863</BuildNumber>
	<BuildDate>11/12/2008</BuildDate>
</VersionInfo>
Observations and Issues
Here are some notes I made while investigating and thinking through my options:
  • Authorize.net does not support partial capture. This means I cannot just capture the non-shipping portion of the payment and let the system capture the remainder when the product is shipped.
  • I could not find any way to associate BasketItems with Payments, so creating a separate Payment in the same Basket does not seem to offer a solution.
  • Products marked as non-shippable are not placed in any Shipment. There are methods to obtain the list of non-shippable items in a Basket, but no built-in grouping that I could process separately.
  • When splitting off the non-shippable items, you have to consider all of the coupons, gift certificates, discounts, etc. Some credits apply to all items in the Basket, some do not.
  • If the non-shippable items are removed from the Basket for separate billing, they will not show up on the reciept page, nor (I believe) on any email reciept they may receive.
  • I am trying to avoid having to make changes to all of the XXPaymentForm.ascx.cs files.
Tried So Far
My plan so far has been to hook the code in a few places.
  • In ConLib/OnePageCheckout.ascx.cs, I added code to RecalculateBasket(bool rebindPaymentForms) to split off the non-shippable items in to a separate Basket, then I cache that Basket for later recall. Note that this splitting off code happens before the call to basket.Recalculate(). Also, this work needs to happen in RecalculateBasket (rather than the CheckingOut() callback) because the first thing that any of the XXPaymentForm modules do on Submit is to GetPayment(), which calculates the total. By this time the non-shipping items must be either removed from the cart or otherwise marked to prevent them from being included in the total that is Authorized for payment.
  • Also in ConLib/OnePageCheckout.ascx.cs I added code to retrieve the Basket of non-shipping items cached in the first step above, and then call Basket.Checkout(payment) to process the payment. From there I capture the payment to complete the processing.
Using this method the non-shipping items are not part of the final Order generated. I believe a separate Order will be created (I have not completed the coding on this so I have not tested all the pieces yet. I wanted to see if this was a problem already solved before devoting a lot more time to it), but it will not be part of the reciept displayed or emailed.

Wrap-Up
So ultimately my questions are:
  • Has this been done before? If so, can someone point me to some clues to the solution?
  • Is my approach basically sound or am I doing it all wrong? Is there perhaps a way to accomplish this without hooking the code (i.e. through settings/configuration)?
  • Should I just ditch all of this together and somehow restrict shopping to only allow shipping or non-shipping items in a Basket, but not both? Hopefully not. I hate dumping technology problems on to the customer.
  • Is there any plan for AbleCommerce to support this scenario out of the box? I am entirely willing to admit that perhaps it does already and I just can't figure it out. If so, please point me in the right direction.
  • Any other suggestions?
Thanks for any feedback,
Dave Parker
Certified Authorize.net Developer
http://www.itdevworks.com

rayrad
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Fri Dec 19, 2008 9:09 am
Location: Kirkland, WA
Contact:

Re: Handling payment of orders w/shipping and non-shipping goods

Post by rayrad » Fri Dec 26, 2008 6:15 pm

So is this just not possible or is there something I am missing or what? Does anyone have any ideas?

Thanks for any help.

Dave Parker

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Handling payment of orders w/shipping and non-shipping goods

Post by jmestep » Sat Dec 27, 2008 8:09 am

You could just capture the payment once after the digital items are approved for download and the shippable items have shipped. As long as you have the authorization, the money is guaranteed to you, from what I understand- there might be a time limit.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Handling payment of orders w/shipping and non-shipping goods

Post by AbleMods » Sat Dec 27, 2008 11:54 pm

rayrad wrote:Authorize.net does not support partial capture. This means I cannot just capture the non-shipping portion of the payment and let the system capture the remainder when the product is shipped.
True and false. Authorize.net does support partial capture. However it is not fully implemented in the included AC7 gateway. You can partial-capture only 1 time in AC7 for each given payment. I know - that makes no sense. Don't shoot me, I'm just the messenger :)
I could not find any way to associate BasketItems with Payments, so creating a separate Payment in the same Basket does not seem to offer a solution.
That's because payments do not apply to line items. Payments only apply to order total. If you are going down the road of separate payments for shippable/nonshippable items so you can capture one and not the other, that's the way to go. But it will require some modification to the checkout so that multiple payment authorizations can be obtained for differing amounts on the same single order. Not a simple task.
Products marked as non-shippable are not placed in any Shipment. There are methods to obtain the list of non-shippable items in a Basket, but no built-in grouping that I could process separately.
That is correct and expected given the design. Nonshippable items having a shipping address would be confusing from both a development and order management perspective.
When splitting off the non-shippable items, you have to consider all of the coupons, gift certificates, discounts, etc. Some credits apply to all items in the Basket, some do not.
Indeed. This is why you don't want to split line items across shipments unless you know precisely what will be impacted and can maintain a consistent result. Pricing and discounts can sometimes be affected.
If the non-shippable items are removed from the Basket for separate billing, they will not show up on the reciept page, nor (I believe) on any email reciept they may receive.
Obviously. Removing anything from the basket prevents it from being purchased and thus the removed items will never show up on the order that is saved. Anything you want "purchased" must be contained in the basket for it to be correctly processed throughout all the other design considerations of the storefront.
I am trying to avoid having to make changes to all of the XXPaymentForm.ascx.cs files.
Unavoidable. You're needs dictate a functionally different checkout process than what is included in AC7. You have yet to even consider multiple payments for the same order. What if the customer wants to pay for the nonshippables with a gift certificate but use a Visa on the shippable items?

If you create separate baskets and do separate _Basket.Checkout(), you will get multiple orders.

Suggestion
From what you've described, the only real change you need is a way for two authorizations to be obtained for each order. One for the shippable items total and another for the non-shippable items total. Go down this route and then you can modify receipt.aspx to auto-capture the nonshippable authorization while leaving the shippable authorization for later capture. Then the lack of a shipment record for the nonshippables in no longer an issue.

Or, mark everything as shippable. Then setup two warehouses, one for nonshippables and the other for shippables.
Then you can test for the warehouse in the receipt.aspx page, immediately determine the payment to capture for the nonshippable by matching the authorization amount to the shipment amount and capture the nonshippable payment. The activate-upon-capture should automatically take place regardless of whether the item is actually marked as nonshippable in the catalog.

None of this is possible in AC7 out-of-box. You're going to have to customize all of this functionality to achieve what you want.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

rayrad
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Fri Dec 19, 2008 9:09 am
Location: Kirkland, WA
Contact:

Re: Handling payment of orders w/shipping and non-shipping goods

Post by rayrad » Sun Dec 28, 2008 1:07 am

Thanks for the detailed response. Much of what you said is as I expected. There is however, one comment with which I must take exception. You said that Authorize.net supports partial capture (by which I meant you could submit more than one capture for a single Authorization). While I am not an expert with AbleCommerce, I am fairly well versed in Authorize.net (being a certified Authorize.net developer) and I do know they only support a single capture for a given authorization. You can see it in the documentation here:

http://developer.authorize.net/guides/A ... .htm#Prior

Of course, if by "partial capture" you meant that you can capture less than the full amount, albeit only once, then disregard this.

For what it is worth, we have decided to bail on trying to handle the split shipping/non-shipping orders in any fancy way. For orders with only downloadable content, we will immediately capture, but for everything else it will not capture until it is shipped. This does open up a potential hole where someone could submit an order with a pile of downloadable content and one shippable item (even better if it is back-ordered), then download everything and stop-payment on the card or something. However, the videos cost at most about $20.00 each the primary clientèle on the site is ministers looking for videos to play during sermons. There just probably isn't a huge black market for these, and hopefully most, perhaps even all, of the users won't be the malicious type.

Thanks again.

Dave Parker
IT DevWorks
http://www.itdevworks.com

Post Reply