Page 1 of 1

Transaction Comment

Posted: Wed Mar 25, 2009 3:04 pm
by screasey
I'm looking to add some sort of invoice comment to a transaction within the AbleCommerce checkout process. We're currently using PayPal Payflow Pro, but obviously getting this to work for any merchant gateway is best. This field does not need to be stored. It will be handled like a custom field that is added to the billing information at checkout (doesn't really matter, even if it's a static value -- just some way to programmatically set this).

I'm assuming I'm going to implement this by customizing the \Checkout\PaymentForms\CreditCardPaymentForm.ascx.cs file in some way.

Any thoughts? AbleCommerce support directed me here.

Re: Transaction Comment

Posted: Wed Mar 25, 2009 3:27 pm
by nickc
Use an OrderNote - collection is bound to order so can be easily retrieved on the Receipt page. I think public notes might even automatically just show up there.
I use OrderNote to store additional profile data against an order during CheckedOut event (OnePageCheckout.ascx.cs):

Code: Select all

    void CheckedOut(object sender, CheckedOutEventArgs e)
    {
        // log extra info in OrderNote object
        LogOrderStuff(e.OrderId);

...


    protected void LogOrderStuff(int orderId)
    {
        string logOrderinfo = String.Format("STUFF={0},{1},{2},{3}", a,b,c,d);

        OrderNote note = new OrderNote();
        note.OrderId = orderId;
        note.CreatedDate = DateTime.Now;
        note.NoteType = NoteType.Private;
        note.Comment = logOrderinfo;
        note.Save();
    }

Re: Transaction Comment

Posted: Thu Mar 26, 2009 10:00 am
by screasey
Thanks. While helpful, that isn't exactly what I'm looking to do.

I can't speak for all gateways that exist in AbleCommerce (GoogleCheckout, Authorize.Net, etc.), but for Payflow, there are comment fields that can be viewed (after a payment has been made) in the Payflow invoice page (paypal.com). I would like to be able to pass a comment to this process when checking out.

If you look at the API (Guide, Page 48, linked from Here) and SDK available from the PayPal.com site, you can see that there are two comment fields COMMENT1 and COMMENT2 defined as "Merchant-defined value for reporting and auditing purposes" (forum questions on how to normally pass to them).

I would like to fill these fields.

Thanks again!
Spencer

Re: Transaction Comment

Posted: Thu Mar 26, 2009 10:28 am
by nickc
Sorry. Wasn't clear in original post that billing == paypal.
You'd need API code for that (core and payflowpro provider). Looks like there's support for the concept; public class CaptureTransactionRequest : BaseTransactionRequest has member ExtendedProperties, looks like a generic dictionary for passing that type of information over the payment gateway, but has getter only - no setter.