Ejemplo n.º 1
0
        /**
         *
         */
        public DoNonReferencedCreditResponseType DoNonReferencedCredit(DoNonReferencedCreditReq DoNonReferencedCreditReq, string apiUsername)
        {
            setStandardParams(DoNonReferencedCreditReq.DoNonReferencedCreditRequest);
            string resp = call("DoNonReferencedCredit", DoNonReferencedCreditReq.toXMLString(), apiUsername);

            return(new DoNonReferencedCreditResponseType(resp));
        }
        /**
         * AUTO_GENERATED
         */
        public DoNonReferencedCreditResponseType DoNonReferencedCredit(DoNonReferencedCreditReq doNonReferencedCreditReq, string apiUserName)
        {
            setStandardParams(doNonReferencedCreditReq.DoNonReferencedCreditRequest);
            string      response    = Call("DoNonReferencedCredit", doNonReferencedCreditReq.ToXMLString(), apiUserName);
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(response);
            XmlNode xmlNode = xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='DoNonReferencedCreditResponse']");

            return(new DoNonReferencedCreditResponseType(xmlNode));
        }
Ejemplo n.º 3
0
        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);
        }
        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);
        }
Ejemplo n.º 5
0
 /// <remarks/>
 public void DoNonReferencedCreditAsync(DoNonReferencedCreditReq DoNonReferencedCreditReq, object userState) {
     if ((this.DoNonReferencedCreditOperationCompleted == null)) {
         this.DoNonReferencedCreditOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDoNonReferencedCreditOperationCompleted);
     }
     this.InvokeAsync("DoNonReferencedCredit", new object[] {
                 DoNonReferencedCreditReq}, this.DoNonReferencedCreditOperationCompleted, userState);
 }
Ejemplo n.º 6
0
 /// <remarks/>
 public void DoNonReferencedCreditAsync(DoNonReferencedCreditReq DoNonReferencedCreditReq) {
     this.DoNonReferencedCreditAsync(DoNonReferencedCreditReq, null);
 }
Ejemplo n.º 7
0
 public DoNonReferencedCreditResponseType DoNonReferencedCredit(DoNonReferencedCreditReq DoNonReferencedCreditReq)
 {
     return(DoNonReferencedCredit(DoNonReferencedCreditReq, null));
 }