本文整理匯總了C#中PayPal.PayPalAPIInterfaceService.PayPalAPIInterfaceServiceService.BillUser方法的典型用法代碼示例。如果您正苦於以下問題:C# PayPalAPIInterfaceServiceService.BillUser方法的具體用法?C# PayPalAPIInterfaceServiceService.BillUser怎麽用?C# PayPalAPIInterfaceServiceService.BillUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PayPal.PayPalAPIInterfaceService.PayPalAPIInterfaceServiceService
的用法示例。
在下文中一共展示了PayPalAPIInterfaceServiceService.BillUser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: BillUser_Submit
protected void BillUser_Submit(object sender, EventArgs e)
{
// Create request object
BillUserRequestType request = new BillUserRequestType();
request.ReturnFMFDetails = Int32.Parse(returnFMFDetails.SelectedValue);
MerchantPullPaymentType paymentDetails = new MerchantPullPaymentType();
request.MerchantPullPaymentDetails = paymentDetails;
paymentDetails.Amount = new BasicAmountType(
(CurrencyCodeType) Enum.Parse(typeof(CurrencyCodeType), currencyCode.SelectedValue), amount.Value);
paymentDetails.MpID = mpId.Value;
if (paymentType.SelectedIndex != 0)
{
paymentDetails.PaymentType =
(MerchantPullPaymentCodeType)Enum.Parse(typeof(MerchantPullPaymentCodeType), paymentType.SelectedValue);
}
if (memo.Value != "")
{
paymentDetails.Memo = memo.Value;
}
if (emailSubject.Value != "")
{
paymentDetails.EmailSubject = emailSubject.Value;
}
if (tax.Value != "" && taxCurrencyCode.SelectedIndex != 0)
{
paymentDetails.Tax = new BasicAmountType(
(CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), taxCurrencyCode.SelectedValue), tax.Value);
}
if (shipping.Value != "" && shippingCurrencyCode.SelectedIndex != 0)
{
paymentDetails.Shipping = new BasicAmountType(
(CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), shippingCurrencyCode.SelectedValue), shipping.Value);
}
if (handling.Value != "" && handlingCurrencyCode.SelectedIndex != 0)
{
paymentDetails.Handling = new BasicAmountType(
(CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), handlingCurrencyCode.SelectedValue), handling.Value);
}
if (itemName.Value != "")
{
paymentDetails.ItemName = itemName.Value;
}
if (itemNumber.Value != "")
{
paymentDetails.ItemNumber = itemNumber.Value;
}
if (invoiceNumber.Value != "")
{
paymentDetails.Invoice = invoiceNumber.Value;
}
if (custom.Value != "")
{
paymentDetails.Custom = custom.Value;
}
if (buttonSource.Value != "")
{
paymentDetails.ButtonSource = buttonSource.Value;
}
if (softDescriptor.Value != "")
{
paymentDetails.SoftDescriptor = softDescriptor.Value;
}
// Invoke the API
BillUserReq wrapper = new BillUserReq();
wrapper.BillUserRequest = request;
PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();
BillUserResponseType billUserResponse = service.BillUser(wrapper);
// Check for API return status
setKeyResponseObjects(service, billUserResponse);
}
示例2: BillUser_Submit
protected void BillUser_Submit(object sender, EventArgs e)
{
// Create request object
BillUserRequestType request = new BillUserRequestType();
request.ReturnFMFDetails = Convert.ToInt32(returnFMFDetails.SelectedValue);
MerchantPullPaymentType paymentDetails = new MerchantPullPaymentType();
request.MerchantPullPaymentDetails = paymentDetails;
paymentDetails.Amount = new BasicAmountType(
(CurrencyCodeType) Enum.Parse(typeof(CurrencyCodeType), currencyCode.SelectedValue), amount.Value);
paymentDetails.MpID = mpId.Value;
if (paymentType.SelectedIndex != 0)
{
paymentDetails.PaymentType =
(MerchantPullPaymentCodeType)Enum.Parse(typeof(MerchantPullPaymentCodeType), paymentType.SelectedValue);
}
if (memo.Value != string.Empty)
{
paymentDetails.Memo = memo.Value;
}
if (emailSubject.Value != string.Empty)
{
paymentDetails.EmailSubject = emailSubject.Value;
}
if (tax.Value != string.Empty && taxCurrencyCode.SelectedIndex != 0)
{
paymentDetails.Tax = new BasicAmountType(
(CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), taxCurrencyCode.SelectedValue), tax.Value);
}
if (shipping.Value != string.Empty && shippingCurrencyCode.SelectedIndex != 0)
{
paymentDetails.Shipping = new BasicAmountType(
(CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), shippingCurrencyCode.SelectedValue), shipping.Value);
}
if (handling.Value != string.Empty && handlingCurrencyCode.SelectedIndex != 0)
{
paymentDetails.Handling = new BasicAmountType(
(CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), handlingCurrencyCode.SelectedValue), handling.Value);
}
if (itemName.Value != string.Empty)
{
paymentDetails.ItemName = itemName.Value;
}
if (itemNumber.Value != string.Empty)
{
paymentDetails.ItemNumber = itemNumber.Value;
}
if (invoiceNumber.Value != string.Empty)
{
paymentDetails.Invoice = invoiceNumber.Value;
}
if (custom.Value != string.Empty)
{
paymentDetails.Custom = custom.Value;
}
if (buttonSource.Value != string.Empty)
{
paymentDetails.ButtonSource = buttonSource.Value;
}
if (softDescriptor.Value != string.Empty)
{
paymentDetails.SoftDescriptor = softDescriptor.Value;
}
// Invoke the API
BillUserReq wrapper = new BillUserReq();
wrapper.BillUserRequest = request;
// Configuration map containing signature credentials and other required configuration.
// For a full list of configuration parameters refer in wiki page
// [https://github.com/paypal/sdk-core-dotnet/wiki/SDK-Configuration-Parameters]
Dictionary<string, string> configurationMap = Configuration.GetAcctAndConfig();
// Create the PayPalAPIInterfaceServiceService service object to make the API call
PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(configurationMap);
// # API call
// Invoke the BillUser method in service wrapper object
BillUserResponseType billUserResponse = service.BillUser(wrapper);
// Check for API return status
setKeyResponseObjects(service, billUserResponse);
}