本文整理汇总了C#中Purchase.SetCustInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Purchase.SetCustInfo方法的具体用法?C# Purchase.SetCustInfo怎么用?C# Purchase.SetCustInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Purchase
的用法示例。
在下文中一共展示了Purchase.SetCustInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//.........这里部分代码省略.........
b.Add("phone", phone);
b.Add("fax", fax);
b.Add("tax1",tax1); //federal tax
b.Add("tax2",tax2); //prov tax
b.Add("tax3",tax3); //luxury tax
b.Add("shipping_cost", shipping_cost); //shipping cost
customer2.SetBilling(b);
/****************************** Shipping Hashtable ***************************/
Hashtable s = new Hashtable(); //shipping hashtable
s.Add("first_name",first_name);
s.Add("last_name", last_name);
s.Add("company_name", company_name);
s.Add("address", address);
s.Add("city", city);
s.Add("province", province);
s.Add("postal_code",postal_code);
s.Add("country", country);
s.Add("phone", phone);
s.Add("fax", fax);
s.Add("tax1", tax1); //federal tax
s.Add("tax2", tax2); //prov tax
s.Add("tax3", tax3); //luxury tax
s.Add("shipping_cost", shipping_cost); //shipping cost
customer2.SetShipping(s);
/************************* Order Line Item1 Hashtable ************************/
Hashtable i1 = new Hashtable(); //item hashtable #1
i1.Add("name", item_description[0]);
i1.Add("quantity", item_quantity[0]);
i1.Add("product_code", item_product_code[0]);
i1.Add("extended_amount", item_extended_amount[0]);
customer2.SetItem(i1);
/************************* Order Line Item2 Hashtable **************************/
Hashtable i2 = new Hashtable(); //item hashtable #2
i2.Add("name","item2's name");
i2.Add("quantity","7");
i2.Add("product_code","item2's product code");
i2.Add("extended_amount","5.01");
customer2.SetItem(i2);
/*************** Miscellaneous Customer Information Methods *******************/
customer.SetEmail("[email protected]");
customer.SetInstructions("Make it fast!");
/********************** Transactional Request Object **************************/
Purchase purchase = new Purchase(order_id, amount, pan, expdate, crypt);
/************************ Set Customer Information ***************************/
purchase.SetCustInfo (customer);
/**************************** Https Post Request ***************************/
HttpsPostRequest mpgReq =
new HttpsPostRequest(host, store_id, api_token, purchase);
/******************************* Receipt ***********************************/
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
}
catch (Exception e)
{
Console.WriteLine(e);
}
}