Esempio n. 1
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object
            BMGetInventoryRequestType request = new BMGetInventoryRequestType();
            request.HostedButtonID = hostedID.Value;

            // Invoke the API
            BMGetInventoryReq wrapper = new BMGetInventoryReq();
            wrapper.BMGetInventoryRequest = request;
            PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();
            BMGetInventoryResponseType response = service.BMGetInventory(wrapper);

            // Check for API return status
            setKeyResponseObjects(service, response);
        }
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object
            BMGetInventoryRequestType request = new BMGetInventoryRequestType();

            //(Required) The ID of the hosted button whose inventory information you want to obtain.
            request.HostedButtonID = hostedID.Value;

            // Invoke the API
            BMGetInventoryReq wrapper = new BMGetInventoryReq();
            wrapper.BMGetInventoryRequest = 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();

            // Creating service wrapper object to make an API call by loading configuration map.
            PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(configurationMap);
            BMGetInventoryResponseType response = service.BMGetInventory(wrapper);

            // Check for API return status
            setKeyResponseObjects(service, response);
        }
        /// <summary>
        /// 
        /// </summary>
        ///<param name="bMGetInventoryReq"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public BMGetInventoryResponseType BMGetInventory(BMGetInventoryReq bMGetInventoryReq, ICredential credential)
        {
            setStandardParams(bMGetInventoryReq.BMGetInventoryRequest);
            DefaultSOAPAPICallHandler defaultHandler = new DefaultSOAPAPICallHandler(this.config, bMGetInventoryReq.ToXMLString(null, "BMGetInventoryReq"), 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 BMGetInventoryResponseType(
                xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='BMGetInventoryResponse']")
            );
        }
 /// <summary> 
 /// 
 /// </summary>
 ///<param name="bMGetInventoryReq"></param>
 public BMGetInventoryResponseType BMGetInventory(BMGetInventoryReq bMGetInventoryReq)
 {
     return BMGetInventory(bMGetInventoryReq,(string) null);
 }
        /**
          *AUTO_GENERATED
         	  */
        public BMGetInventoryResponseType BMGetInventory(BMGetInventoryReq BMGetInventoryReq, string apiUsername)
        {
            setStandardParams(BMGetInventoryReq.BMGetInventoryRequest);

            string resp = call("BMGetInventory", BMGetInventoryReq.toXMLString(), apiUsername);
            return new BMGetInventoryResponseType(resp);
        }
 /**
   *AUTO_GENERATED
  	  */
 public BMGetInventoryResponseType BMGetInventory(BMGetInventoryReq BMGetInventoryReq)
 {
     return BMGetInventory(BMGetInventoryReq, null);
 }
 /**
   *AUTO_GENERATED
  	  */
 public BMGetInventoryResponseType BMGetInventory(BMGetInventoryReq bMGetInventoryReq, string apiUserName)
 {
     setStandardParams(bMGetInventoryReq.BMGetInventoryRequest);
     string response = Call("BMGetInventory", bMGetInventoryReq.ToXMLString(), apiUserName);
     XmlDocument xmlDocument = new XmlDocument();
     xmlDocument.LoadXml(response);
     XmlNode xmlNode = xmlDocument.SelectSingleNode("*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='BMGetInventoryResponse']");
     return new BMGetInventoryResponseType(xmlNode);
 }