Handling payment of orders w/shipping and non-shipping goods
Posted: 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:
Observations and Issues
Here are some notes I made while investigating and thinking through my options:
My plan so far has been to hook the code in a few places.
Wrap-Up
So ultimately my questions are:
Dave Parker
Certified Authorize.net Developer
http://www.itdevworks.com
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>
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.
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.
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?
Dave Parker
Certified Authorize.net Developer
http://www.itdevworks.com