本文整理汇总了C#中PaymentMethod.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PaymentMethod.ToString方法的具体用法?C# PaymentMethod.ToString怎么用?C# PaymentMethod.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaymentMethod
的用法示例。
在下文中一共展示了PaymentMethod.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePayment
public Payment CreatePayment(string email, PaymentMethod payMethod, string orderAmount, string orderDescription, string returnUrl, string cancelUrl)
{
Payment pay = null;
Details amountDetails = new Details();
amountDetails.shipping = "2";
amountDetails.tax = "1";
amountDetails.subtotal = orderAmount;
Amount amount = new Amount();
amount.currency = "USD";
int total = Convert.ToInt32(amountDetails.tax) + Convert.ToInt32(amountDetails.shipping) + Convert.ToInt32(orderAmount);
amount.total = total.ToString();
amount.details = amountDetails;
RedirectUrls redirectUrls = new RedirectUrls();
redirectUrls.return_url = returnUrl;
redirectUrls.cancel_url = cancelUrl;
Transaction transaction = new Transaction();
transaction.amount = amount;
transaction.description = orderDescription;
List<Transaction> transactions = new List<Transaction>();
transactions.Add(transaction);
Payer payr = new Payer();
payr.payment_method = payMethod.ToString();
Payment paymnt = new Payment();
paymnt.intent = "sale";
paymnt.payer = payr;
paymnt.transactions = transactions;
paymnt.redirect_urls = redirectUrls;
pay = paymnt.Create(Api);
return pay;
}
示例2: CreatePayment
public Payment CreatePayment(string email, PaymentMethod paymntMethod, string orderAmount, string orderDescription)
{
Payment pay = null;
Amount amount = new Amount();
amount.currency = "USD";
amount.total = orderAmount;
Transaction transaction = new Transaction();
transaction.amount = amount;
transaction.description = orderDescription;
List<Transaction> transactions = new List<Transaction>();
transactions.Add(transaction);
FundingInstrument fundingInstrument = new FundingInstrument();
CreditCardToken creditCardToken = new CreditCardToken();
creditCardToken.credit_card_id = GetSignedInUserCreditCardID(email);
fundingInstrument.credit_card_token = creditCardToken;
List<FundingInstrument> fundingInstrumentList = new List<FundingInstrument>();
fundingInstrumentList.Add(fundingInstrument);
Payer payer = new Payer();
payer.funding_instruments = fundingInstrumentList;
payer.payment_method = paymntMethod.ToString();
Payment pyment = new Payment();
pyment.intent = "sale";
pyment.payer = payer;
pyment.transactions = transactions;
pay = pyment.Create(Api);
return pay;
}
示例3: SelectPaymentMethod
public void SelectPaymentMethod(PaymentMethod method)
{
string methodLabel = method.ToString();
switch (method)
{
case PaymentMethod.CreditCard:
methodLabel = "Credit Card";
break;
case PaymentMethod.PurchaseOrder:
methodLabel = "Purchase Order";
break;
case PaymentMethod.PayAtTheEvent:
methodLabel = "Will Call (At The Event)";
break;
case PaymentMethod.CostCenter:
methodLabel = "Cost Center";
break;
case PaymentMethod.WireTransfer:
methodLabel = "Wire Transfer";
break;
}
SelectPaymentMethod(methodLabel);
}
示例4: CalculatePremium
public CalculatePremium_Result CalculatePremium(string partnerUsername, string partnerPassword, string planCode, PaymentMethod paymentMethod, string age, Gender gender, string amount, string channel, string occupationGroup)
{
/*
Call WS_SQM_CalculateService.CalculatePremium(Channel (int), SelectedPlanCode (string), PaymentMethod (int), CustomerAge (int), CustomerGender (char), MainInsured (decimal), CustomerOccupationGroup (strimg));
ระบุ Channel เป็นรหัสช่องทางที่กำหนด เช่น 6,
ระบุ PaymentMethod เป็น 12/06/03/01
ระบุ CustomerGender เป็น F/M ,
ระบุ CustomerOccupationGroup เป็น 001
*/
CalculatePremium_Result obj = new CalculatePremium_Result();
RefRunningTBBLL runningobj = new RefRunningTBBLL();
this.refnum = runningobj.AddRefRunningTBAndReturn();
WSLogBLL logobj = new WSLogBLL();
string methodName = "CalculatePremium";
int vChannel = 0;
int vPaymentMethod = 0;
int vAge = 0;
char vGender = 'F';
decimal vMainInsured = 0;
string vOccupationGroup = "";
try
{
if (partnerUsername == "" || partnerPassword == "" || planCode == "" || paymentMethod.ToString() == "" || age == "" || gender.ToString() == "" || amount == "")
{
this.partnerName = partnerUsername;
// LogRequest: Insert Log Request
logobj.AddWSLog(this.partnerName, this.ipaddress, "Request", this.webserviceName, methodName, partnerUsername + "|" + planCode + "|" + gender.ToString() + "|" + age + "|" + amount + "|" + paymentMethod.ToString() + "|" + channel + "|" + occupationGroup, this.refnum);
obj.Result = "notcomplete_กรุณาระบุข้อมูลให้ครบถ้วน";
}
else
{
// พิสูจน์ตัวตนของพันธมิตรก่อนที่จะให้ใช้งานจริง
NETWS_ForPartnerAuthenticationChecking.CheckPartnerAuthentication_Result pacobj = CheckPartnerAuthenticationReturnDetail(partnerUsername, partnerPassword, this.ipaddress);
if (pacobj.Result.Trim().ToLower() == "passed")
{
//vChannel = 32;
// 20150325: แก้ให้ระบุช่องทางมาเลย ไม่ fix ให้
vChannel = Convert.ToInt32(channel);
//vPaymentMethod = Convert.ToInt32(paymentMethod);
vPaymentMethod = this.PaymentMethodValues[Convert.ToInt32(paymentMethod.ToString("D"))];
vAge = Convert.ToInt32(age);
//vGender = gender.ToString().ToUpper() == "FEMALE" ? 'F' : 'M';
vGender = this.GenderValues[Convert.ToInt32(gender.ToString("D"))];
vMainInsured = Convert.ToDecimal(amount);
//vOccupationGroup = "001";
// 20150325: แก้ให้ระบุช่องทางมาเลย ไม่ fix ให้
vOccupationGroup = occupationGroup;
this.partnerName = pacobj.PartnerName;
// LogRequest: Insert Log Request
logobj.AddWSLog(this.partnerName, this.ipaddress, "Request", this.webserviceName, methodName, partnerUsername + "|" + planCode + "|" + vGender.ToString() + "|" + vAge + "|" + vMainInsured + "|" + vPaymentMethod + "|" + vChannel + "|" + vOccupationGroup, this.refnum);
try
{
MTL.NETWS_ForSmartProposal.WS_SQM_CalculateService wsobj = new MTL.NETWS_ForSmartProposal.WS_SQM_CalculateService();
//string result = wsobj.CalculatePremium(vChannel, planCode, vPaymentMethod, vAge, vGender, vMainInsured, vOccupationGroup);
string result = wsobj.CompletePremium(vChannel, planCode, vPaymentMethod, vAge, vGender, vMainInsured, vOccupationGroup);
if (Convert.ToDecimal(result) >= 0)
{
// ช่องทาง 32 (For Online Sales) แบบประกัน EON08C ขาย + ส่วนควบ WP
if (channel.Trim() == "32" && planCode == "EON08C")
{
string resultWPRider = this.CalculateRiderWP(planCode, vPaymentMethod.ToString(), vAge.ToString(), gender.ToString() == "MALE" ? "M" : "F", vMainInsured.ToString(), result);
result = (Convert.ToDecimal(result) + Convert.ToDecimal(resultWPRider)).ToString("N2");
obj.Result = "completed";
obj.Premium = result;
}
else
{
obj.Result = "completed";
obj.Premium = result;
}
}
else
{
if (result.Trim().Contains("ไม่พบข้อมูลเบี้ยประกัน (Premium)"))
{
obj.Result = "notcomplete_ไม่สามารถคำนวณเบี้ยประกันภัยได้ เนื่องจากอายุ หรือเพศ หรือจำนวนเงินเอาประกันภัยที่ท่านระบุไม่อยู่ในเงื่อนไขการรับประกัน";
}
else if (result.Trim().Contains("ไม่พบแบบประกัน"))
{
obj.Result = "notcomplete_ไม่สามารถคำนวณเบี้ยประกันภัยได้ เนื่องจากไม่พบข้อมูลของแบบประกันที่ท่านระบุในระบบ";
}
else
{
obj.Result = "notcomplete_" + result;
}
}
}
catch (Exception ex)
{
if (ex.Message.ToString().Trim().Contains("ไม่พบข้อมูลเบี้ยประกัน (Premium)"))
{
obj.Result = "notcomplete_ไม่สามารถคำนวณเบี้ยประกันภัยได้ เนื่องจากอายุ หรือเพศ หรือจำนวนเงินเอาประกันภัยที่ท่านระบุไม่อยู่ในเงื่อนไขการรับประกัน";
//.........这里部分代码省略.........