コード例 #1
0
ファイル: BMGetInventory.aspx.cs プロジェクト: kashyapkk/SDKs
        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);
        }
コード例 #2
0
        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);
 }
コード例 #5
0
        /**
          *AUTO_GENERATED
         	  */
        public BMGetInventoryResponseType BMGetInventory(BMGetInventoryReq BMGetInventoryReq, string apiUsername)
        {
            setStandardParams(BMGetInventoryReq.BMGetInventoryRequest);

            string resp = call("BMGetInventory", BMGetInventoryReq.toXMLString(), apiUsername);
            return new BMGetInventoryResponseType(resp);
        }
コード例 #6
0
 /**
   *AUTO_GENERATED
  	  */
 public BMGetInventoryResponseType BMGetInventory(BMGetInventoryReq BMGetInventoryReq)
 {
     return BMGetInventory(BMGetInventoryReq, null);
 }
コード例 #7
0
 /**
   *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);
 }