Hi,
I have just copied the example code from
~\CMSModules\Ecommerce\Controls\PaymentGateways\AuthorizeNetForm.ascx.cs file. "this" in my example refers to PaymentGatewayProvider.ShoppingCartInfoObj.
I hope that following example code will help you:
// create order, save the order section
// ... OrderInfo oi
// create order, save the order section
ShoppingCart cart = new ShoppingCart();
PaymentOptionInfo paymentOptionInfo = PaymentOptionInfoProvider.GetPaymentOptionInfo("AuthorizeNet", CMS.CMSHelper.CMSContext.CurrentSiteName);
cart.PaymentGatewayProvider = CMSAuthorizeNetProvider.GetPaymentGatewayProvider(paymentOptionInfo.PaymentOptionID);
cart.PaymentGatewayProvider.ShoppingCartInfoObj = ShoppingCartInfoProvider.CreateShoppingCartInfo(CMS.CMSHelper.CMSContext.CurrentSiteID);
CurrencyInfo ci = CurrencyInfoProvider.GetMainCurrency();
cart.PaymentGatewayProvider.ShoppingCartInfoObj.ShoppingCartPaymentOptionID = paymentOptionInfo.PaymentOptionID;
cart.PaymentGatewayProvider.ShoppingCartInfoObj.ShoppingCartCurrencyID = ci.CurrencyID;
cart.PaymentGatewayProvider.ShoppingCartInfoObj.ShoppingCartBillingAddressID = oi.OrderShippingAddressID;
cart.PaymentGatewayProvider.OrderId = oi.OrderId;
cart.ShoppingCartInfoObj.PaymentGatewayCustomData[AuthorizeNetParameters.CARD_NUMBER] = creditcard1.CardNumber;
cart.ShoppingCartInfoObj.PaymentGatewayCustomData[AuthorizeNetParameters.CARD_CCV] = creditcard1.CCV;
cart.ShoppingCartInfoObj.PaymentGatewayCustomData[AuthorizeNetParameters.CARD_EXPIRATION] = new DateTime(creditcard1.ExpirationDate[1], creditcard1.ExpirationDate[0], DateTime.Now.Day);
if (cart.PaymentGatewayProvider.ShoppingCartInfoObj != null && cart.PaymentGatewayProvider.ShoppingCartInfoObj.PaymentGatewayCustomData != null)
{
cart.PaymentGatewayProvider.ProcessPayment();
}
Please note that this is just example code and you need to correct it according your scenario.
Best regards,
Miroslav Remias.