When I use the v11 API to add order comments on a contribution line-item, it only seems to be working if the contribution was made as a "fund" type. When I try it on an On-Account contribution, I get the following error:
System.Data.SqlClient.SqlException: Invalid Contribution Ref_No
at Tessitura.WebAPI.AddOrderCommentCommand.Execute()
at Tessitura.WebAPI.Tessitura.AddOrderCommentsEx(String SessionKey, String Comment, Int32 LineItemID, Char LineItemType)
Has anyone seen (or resolved) this behavior?
If ISNULL(@ref_no, 0) <> 0
and not exists (Select * from [dbo].t_web_contribution where ref_no = @ref_no and order_no = @order_no and fund_no is not null)
Begin
select @errmsg = 'Invalid Contribution Ref_No'
RAISERROR(@errmsg, 11, 2) WITH SETERROR
return -101
End
If you look in WP_UPDATE_ORDER_COMMENTS that is the code that drives the error. What is happening here it seems that the API is stripping the fund_no of 0 and actually processing the WP_MAINTAIN_CART_CONTRIBUTION with a null fund_no.
Either way it looks as if this is by way of design; during the checkout procedure contributions with funds are processed as contributions and on account contributions are processed as negative payments.
There is nothing there to suggest that the amounts get zeroed and the design would suggest that wasn't even a thought as t_contribution is updated prior to the on account funds being processed.
In effect the on account contribution method acts more like a way to place money on account via the API (IIRC this is NOT possible via any other method). I also suppose since there is no contribution created there would be no where for a notes field to go (right?). If you need to add notes you're probably best doing it on the order level because of this functionality
-Chris
Thanks for the quick reply. This makes total sense, but I was stuck because calling the GetOrder API method shows it as a contribution. We use on-account in this case (combined with a set of CSIs) for auto-renewing (auto pay) memberships, and was hoping to add something at the line-item level to make changes to the confirmation email template within Tessitura have an easier time determining the reason for the contribution.
I haven't had any experience with on-account donations on the web but I would believe that because the confirmation email templates are usually set up to run from the committed database orders (lowest common denominator) that they would in the most show up as reverse payments with an order total of $0 (total payments; in and out)
Not sure exactly what you are seeing/working with on your end though.
If you need a custom solution you could connect to Tessitura and run a local procedure to pull the payments for the order or you could create a local table for this functionality. You can reference page 51 here for a quick intro to pulling data into the template.