/// <summary>
        /// 
        /// </summary>
        ///<param name="billUserReq"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public BillUserResponseType BillUser(BillUserReq billUserReq, ICredential credential)
        {
            setStandardParams(billUserReq.BillUserRequest);
            DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, billUserReq.ToXMLString(null, "BillUserReq"), null, null);
            IAPICallPreHandler apiCallPreHandler = new MerchantAPICallPreHandler(this.config, defaultHandler, credential);
            ((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((MerchantAPICallPreHandler) apiCallPreHandler).PortName = "PayPalAPI";

            XmlDocument xmlDocument = new XmlDocument();
            xmlDocument.LoadXml(Call(apiCallPreHandler));
            return new BillUserResponseType(
                xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='BillUserResponse']")
            );
        }
 /**
   *AUTO_GENERATED
  	  */
 public BillUserResponseType BillUser(BillUserReq billUserReq, string apiUserName)
 {
     IAPICallPreHandler apiCallPreHandler = null;
      		string portName = "PayPalAPI";
     setStandardParams(billUserReq.BillUserRequest);
     DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(billUserReq.ToXMLString(null, "BillUserReq"), null, null);
     apiCallPreHandler = new MerchantAPICallPreHandler(defaultHandler, apiUserName, getAccessToken(), getAccessTokenSecret());
     ((MerchantAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
     ((MerchantAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
     ((MerchantAPICallPreHandler) apiCallPreHandler).PortName = portName;
     string response = Call(apiCallPreHandler);
     XmlDocument xmlDocument = new XmlDocument();
     xmlDocument.LoadXml(response);
     XmlNode xmlNode = xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='BillUserResponse']");
     return new BillUserResponseType(xmlNode);
 }
 /// <summary> 
 /// 
 /// </summary>
 ///<param name="billUserReq"></param>
 public BillUserResponseType BillUser(BillUserReq billUserReq)
 {
     return BillUser(billUserReq,(string) null);
 }
 /**
   *AUTO_GENERATED
  	  */
 public BillUserResponseType BillUser(BillUserReq billUserReq, string apiUserName)
 {
     setStandardParams(billUserReq.BillUserRequest);
     string response = Call("BillUser", billUserReq.ToXMLString(), apiUserName);
     XmlDocument xmlDocument = new XmlDocument();
     xmlDocument.LoadXml(response);
     XmlNode xmlNode = xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='BillUserResponse']");
     return new BillUserResponseType(xmlNode);
 }
 public BillUserResponseType BillUser(BillUserReq BillUserReq)
 {
     return BillUser(BillUserReq, null);
 }
        /**
         *
         */
        public BillUserResponseType BillUser(BillUserReq BillUserReq, string apiUsername)
        {
            setStandardParams(BillUserReq.BillUserRequest);
            string resp = call("BillUser", BillUserReq.toXMLString(), apiUsername);

            return new BillUserResponseType(resp);
        }
示例#7
0
        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);
        }
        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);
        }