iBO for .NET

Create/Import order to IMIS using IBO.NET or SQL Stored procedure.

Hi, Guys!

We are trying to import order data to IMIS system using IBO for .NET. But totally lost how to complete it. Will can consider using SQL Stored Procedure.

In general we are not using IMIS to process Credit Cards but we need store orders info.

strange error in iBO Gift entry

I'm trying to insert a new donation via iBO in .net and the save function is throwing a "Connection string could not be initialized" error.

Sounds like a strait forward problem but here is the odd thing... From everything i can see, the record is getting inserted just fine!  The batch, activities, trans records, it all looks exactly the same as a record that is entered though the regular iMIS user interface. 

How to start ID TRACKER (XTENDER) as you click the Customers tab.

I am developing a custom web page making use of iBO.net. Ideally I would like to get details of the current contact during the page load event. I would like to know how you can access the current Contact Id obtained in the Customer portfolio.

I thought I would use the ID TRACKER Xtender which writes the contact id to a cookie. However ID TRACKER needs to be manually loaded in order for this to work. Is there a way to automatically load ID TRACKER as the user clicks the Customer tab in iMIS desktop?

Asi.iBO.Errors.CErrors.NewError may throw

Since this doesn't seem to be documented anywhere online (particularly in the API documentation), it is worth noting that CErrors.NewError will throw an exception if the ThrowExceptionOnError property of the associated IiMISUser object is set to true (assuming you are creating an Error and not a Warning).  In this case, it will always throw and never return.  At least that's what I gather from digging around in reflector:

Registrations using CRegistration

I've been trying to create an event registration using the CRegistration class. The registration seems to work, but when looking in the iMIS desktop application the Total Registrants increases but the Attendees count does not. I'm not sure what I'm doing wrong. Also I'm doing this testing on a backup version of the production iMIS system where the credit card processing is not work. When I use a PO, the registration object saves, but the attendee isn't tied to the event. Any Ideas?

paymentGatewayService configuration for a custom PaymentGatewayProvider

With the current configuration:

<configuration>
  <configSections>
    <sectionGroup name="system.web">
      <section name="paymentGatewayService" type="Asi.iBO.Commerce.PaymentGatewayServiceSection, Asi.iBO" allowDefinition="MachineToApplication" restartOnExternalChanges="true" />
    </sectionGroup>
  </configSections>

  <system.web>
    <paymentGatewayService defaultProvider="MockCustomPaymentGatewayProvider">
      <providers>
        <add name="MockCustomPaymentGatewayProvider" type="Crown.Imis.IntegrationTests.MockCustomPaymentGatewayProvider, Crown.Imis.IntegrationTests" authorizationAccounts="AUTHORIZE" />
      </providers>
    </paymentGatewayService>
  </system.web>
...
</configuration>

Unexpected CPayment behavior

This NUnit TestFixture demonstrates some unexpected behavior in CPayments.  Note that you will need to alter or provide some of the values to run on your machine, if you so choose, but I think you can see by reading this some gotchas to look out for:

using System;
using System.Configuration;

using Asi.iBO;
using Asi.iBO.Financials;
using NUnit.Framework;

namespace Crown.Imis.IntegrationTests
{
    [TestFixture, Explicit("demos")]
    public class CPaymentGotchaDemonstrations
    {
        [TestFixtureSetUp]
        public void TestFixtureSetUp()
        {
            iboAdmin.InitializeSystem(ConfigurationManager.ConnectionStrings["DataSource.iMIS.Connection"].ConnectionString);
        }

        [Test]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void Demo_Setting_CreditCardNumber_toVisaTestNumberAfterSetting_CashAccountCode_CausesUnhandledException()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CashAccountCode = "VISA",
                CreditCardNumber = "4007000000027"  // VISA test number, eh?
            };
        }

        [Test]
        [ExpectedException(typeof(Asi.iBO.InvalidCardNumberException))]
        public void Demo_Setting_CreditCardNumber_to011201539123After_CashAccountCode_Causes_InvalidCardNumberException()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CashAccountCode = "VISA",
                CreditCardNumber = "011201539123"   // it's irrelevant how I came up with this number.  No idea yet on what is wrong with it.
            };
        }

        [Test]
        public void Demo_Setting_PaymentType_After_CreditCardNumber_Clears_CreditCardNumber()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CreditCardNumber = "4007000000027", // VISA test number
                PaymentType = EnumPaymentType.Check
            };

            Assert.IsNullOrEmpty(payment.CreditCardNumber);
        }

        [Test]
        public void Demo_SettingCashAccountCodeChangesPaymentTypeToCreditWhenCashAccountIsCreditType()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser());
            payment.PaymentType = EnumPaymentType.Check;
            payment.CashAccountCode = "VISA";

            Assert.AreEqual(EnumPaymentType.CreditCard, payment.PaymentType);
        }
    }
}

getting and inserting cash accounts

For automated tests, I need to get CCashAccounts from the database and insert CCashAccounts into the database.  How can I do this?  Is there some parent object I need to use to obtain or insert CCashAccounts?

CPayment unexpected exceptions and workaround

The following NUnit-driven demos demonstrate that setting CPayment's CashAccountCode before setting the CreditCardNumber will lead to unexpected errors:

    [TestFixture, Explicit("demos")]   
    public class UnexpectedExceptions
    {
        [TestFixtureSetUp]
        public void TestFixtureSetUp()
        {
            iboAdmin.InitializeSystem(ConfigurationManager.ConnectionStrings["DataSource.iMIS.Connection"].ConnectionString);
        }

        [Test]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void Demo_Setting_CreditCardNumber_After_CashAccountCode_CausesUnhandledException_1()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CashAccountCode = cashAccountCode,
                CreditCardNumber = "4007000000027"  // VISA test number, eh?
            };
        }

        [ExpectedException(typeof(Asi.iBO.InvalidCardNumberException))]
        public void Demo_Setting_CreditCardNumber_After_CashAccountCode_CausesUnhandledException_2()
        {
            var payment = new CPayment(CStaffUser.GetDefaultStaffUser())
            {
                CashAccountCode = cashAccountCode,
                CreditCardNumber = "011201539123"   // it's irrelevant how I came up with this number.
            };
        }  
    }