I am trying to pass lineItems to the transactionRequest, but I am not doing something right. I added a snapshot of the portion of code and was hoping someone can point me in the right direction.
Thanks in advance.
//standard api call to retrieve response var paymentType = new paymentType { Item = creditCard }; var orderDetails = new orderType { invoiceNumber = "Inv 01234", description = "Test" }; var items = new lineItemType { itemId = "TESTER", description = "Dec", name="Name", quantity = 1, taxable = false, taxableSpecified = false, unitPrice = 0.10m }; var transactionRequest = new transactionRequestType { transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // charge the card //amount = 133.45m, amount = Amount, payment = paymentType, order = orderDetails, lineItems = items };
12-17-2015 09:37 AM
lineItems is looking for an arrays of lineItemType
12-17-2015 11:21 AM
Thanks for the reply.
I wish the online example on how to submit LineItems while using the ChargeCreditCard.cs example. If anyone has something I can reference, it would be really helpful.
Thanks in advance.
12-19-2015 11:38 AM
I could also use a c# sample for adding line items. The code below causes causes controller.GetApiResponse(); to return null.
var litem = new AuthorizeNet.Api.Contracts.V1.lineItemType
{
description = "DrIsOnline Encounter",
name = cboPaymentAmount.SelectedValue,
quantity = 1m,
unitPrice = amt
};
List<AuthorizeNet.Api.Contracts.V1.lineItemType> mItems = new List<AuthorizeNet.Api.Contracts.V1.lineItemType>();
mItems.Add(litem);
var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
amount = amt,
payment = paymentType,
billTo = billto,
customer = cust,
order = m_order,
lineItems = mItems.ToArray(),
shipTo = mShipTo,
};
12-24-2015 05:44 AM
itemId is a required field
12-28-2015 05:50 PM