Hi @Anjali Agarwal,
I noticed that your problem has been solved on other platforms.
I have another method here, I hope it will be useful to you. Use List<LineItemParam>.
var parameters = new PayParam();
List<LineItemParam> items = new List<LineItemParam>();
MailingInfo IdData = scData.FindData();
string[] desc = { "Test1", "Test2", "Test3" };
double[] value = { 12.00, 13.00, 18.00 };
for (int i = 0; i < desc.Length; i++)
{
items.Add(new LineItemParam
{
Sku = GetSKU(),
Description = desc[i],
UnitPrice = 12.00,
Quantity = 1
});
}
parameters = new PayParam
{
Phone = IdData.PhoneNumber,
Email = IdData.Email.ToUpper(),
CustomerId = "1234",
CompanyName = "TEST NAME",
LineItems = items,
};
public class PayParam
{
public List<LineItemParam> LineItems { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string CustomerId { get; set; }
public string CompanyName { get; set; }
}
public class LineItemParam
{
public string Sku { get; set; }
public string Description { get; set; }
public double UnitPrice { get; set; }
public int Quantity { get; set; }
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread