本文整理匯總了C#中PayPal.PayPalAPIInterfaceService.PayPalAPIInterfaceServiceService.DoNonReferencedCredit方法的典型用法代碼示例。如果您正苦於以下問題:C# PayPalAPIInterfaceServiceService.DoNonReferencedCredit方法的具體用法?C# PayPalAPIInterfaceServiceService.DoNonReferencedCredit怎麽用?C# PayPalAPIInterfaceServiceService.DoNonReferencedCredit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PayPal.PayPalAPIInterfaceService.PayPalAPIInterfaceServiceService
的用法示例。
在下文中一共展示了PayPalAPIInterfaceServiceService.DoNonReferencedCredit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Submit_Click
protected void Submit_Click(object sender, EventArgs e)
{
// Create request object
DoNonReferencedCreditRequestType request = new DoNonReferencedCreditRequestType();
request.DoNonReferencedCreditRequestDetails = new DoNonReferencedCreditRequestDetailsType();
CurrencyCodeType currency = (CurrencyCodeType)
Enum.Parse( typeof(CurrencyCodeType), currencyId.Value);
request.DoNonReferencedCreditRequestDetails.Amount = new BasicAmountType(currency, itemAmount.Value);
CreditCardDetailsType creditCard = new CreditCardDetailsType();
request.DoNonReferencedCreditRequestDetails.CreditCard = creditCard;
creditCard.CreditCardNumber = creditCardNumber.Value;
creditCard.CreditCardType = (CreditCardTypeType)
Enum.Parse(typeof(CreditCardTypeType), creditCardType.SelectedValue);
creditCard.CVV2 = cvv.Value;
string[] cardExpiryDetails = cardExpiryDate.Text.Split(new char[] { '/' });
creditCard.ExpMonth = Int32.Parse(cardExpiryDetails[0]);
creditCard.ExpYear = Int32.Parse(cardExpiryDetails[1]);
if (comment.Value != "")
{
request.DoNonReferencedCreditRequestDetails.Comment = comment.Value;
}
// Invoke the API
DoNonReferencedCreditReq wrapper = new DoNonReferencedCreditReq();
wrapper.DoNonReferencedCreditRequest = request;
PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();
DoNonReferencedCreditResponseType DoNonReferencedCreditResponse = service.DoNonReferencedCredit(wrapper);
// Check for API return status
setKeyResponseObjects(service, DoNonReferencedCreditResponse);
}
示例2: Submit_Click
protected void Submit_Click(object sender, EventArgs e)
{
// Create request object
DoNonReferencedCreditRequestType request = new DoNonReferencedCreditRequestType();
request.DoNonReferencedCreditRequestDetails = new DoNonReferencedCreditRequestDetailsType();
// (Required) Total of order, including shipping, handling, and tax. Amount = NetAmount + ShippingAmount + TaxAmount
// Character length and limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Must have 2 decimal places, decimal separator must be a period (.), and the optional thousands separator must be a comma (,).
CurrencyCodeType currency = (CurrencyCodeType)
Enum.Parse( typeof(CurrencyCodeType), currencyId.Value);
request.DoNonReferencedCreditRequestDetails.Amount = new BasicAmountType(currency, itemAmount.Value);
// (Required) Information about the credit card to be charged.
CreditCardDetailsType creditCard = new CreditCardDetailsType();
request.DoNonReferencedCreditRequestDetails.CreditCard = creditCard;
// (Required) Credit card number.
creditCard.CreditCardNumber = creditCardNumber.Value;
// (Optional) Type of credit card. For UK, only Maestro, MasterCard, Discover, and Visa are allowable. For Canada, only MasterCard and Visa are allowable and Interac debit cards are not supported. It is one of the following values:
// * Visa
// * MasterCard
// * Discover
// * Amex
// * Maestro: See note.
// Note: If the credit card type is Maestro, you must set currencyId to GBP. In addition, you must specify either StartMonth and StartYear or IssueNumber.
creditCard.CreditCardType = (CreditCardTypeType)
Enum.Parse(typeof(CreditCardTypeType), creditCardType.SelectedValue);
// Card Verification Value, version 2. Your Merchant Account settings determine whether this field is required. To comply with credit card processing regulations, you must not store this value after a transaction has been completed.
creditCard.CVV2 = cvv.Value;
string[] cardExpiryDetails = cardExpiryDate.Text.Split(new char[] { '/' });
// (Required) Credit card expiration month.
if (cardExpiryDetails.Length > 0 && !string.IsNullOrEmpty(cardExpiryDetails[0]))
{
int month = 0;
Int32.TryParse(cardExpiryDetails[0], out month);
creditCard.ExpMonth = month;
}
// (Required) Credit card expiration year.
if (cardExpiryDetails.Length > 1 && !string.IsNullOrEmpty(cardExpiryDetails[1]))
{
int year = 0;
Int32.TryParse(cardExpiryDetails[1], out year);
creditCard.ExpYear = year;
}
// (Optional) Field used by merchant to record why this credit was issued to a buyer. It is similar to a "memo" field (freeform text or string field).
if (comment.Value != string.Empty)
{
request.DoNonReferencedCreditRequestDetails.Comment = comment.Value;
}
// Invoke the API
DoNonReferencedCreditReq wrapper = new DoNonReferencedCreditReq();
wrapper.DoNonReferencedCreditRequest = 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 DoNonReferencedCredit method in service wrapper object
DoNonReferencedCreditResponseType DoNonReferencedCreditResponse = service.DoNonReferencedCredit(wrapper);
// Check for API return status
setKeyResponseObjects(service, DoNonReferencedCreditResponse);
}