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>
Calling myCPayment.ProcessPayment(myBillingAddress) should _always_ call ProcessPayment on a MockCustomPaymentGatewayProvider or throw an exception, correct?
What it does on my machine is call MockCustomPaymentGatewayProvider's constructor and Initialize method the first time I call CPayment's ProcessPayment method, but it does _not_ call MockCustomPaymentGatewayProvider's ProcessPayment method. It _does_ return a successful PaymentGatewayResponse, which is scary because I don't know what gateway it could possibly be using.
Is there something I'm missing?
EDIT: Per Balaji's suggestion, I configured MockCustomPaymentGatewayProvider to be used specifically with the AUTHORIZE authorization account (probably need a new name for that, huh?); the change made is in bold.
I also added this test:
[Test]
public void Test_ConfiguredCreditCardCashAccount_isAssociatedWith_AuthorizeDotNet_PaymentAuthorizationAccount()
{
var code = ConfigurationManager.AppSettings["CreditCardCashAccountCode"];
var cashAccount = iboAdmin.ReferenceData.GetCashAccount(code);
var authAccountCode = cashAccount.AuthorizationAccountCode;
Assert.AreEqual("AUTHORIZE", authAccountCode);
}
which passes, showing that the configured CreditCardCashAccountCode is associated with the AUTHORIZE auth account.
The test that fails is a little much to show here, but it creates a valid credit card CPayment associated with the configured CreditCardCashAccountCode then calls ProcessPayment. It then asserts that a MockPaymentGatewayProvider is contstructed, and that ProcessPayment is called on it. The latter assertion fails.
Hi Process payment
Hi
Process payment method invoked based on your selected cash account from CPayment object
- Make sure selected Cash account set as credit/debit card type
- Cash account must have Custom CCAuth account code defiend,
Thanks