The request object for CancelInvoice.
Beispiel #1
0
        /**
         *
         */
        public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest CancelInvoiceRequest, string apiUsername)
        {
            string resp = call("CancelInvoice", CancelInvoiceRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();
            return new CancelInvoiceResponse(util.parseNVPString(resp), "");
        }
        /// <summary>
        /// 
        /// </summary>
        ///<param name="cancelInvoiceRequest"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest cancelInvoiceRequest, ICredential credential)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, cancelInvoiceRequest.ToNVPString(string.Empty), ServiceName, "CancelInvoice", credential);
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "Invoice";

            NVPUtil util = new NVPUtil();
            return CancelInvoiceResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
 /**
   *AUTO_GENERATED
  	  */
 public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest cancelInvoiceRequest, string apiUserName)
 {
     IAPICallPreHandler apiCallPreHandler = null;
     apiCallPreHandler = new PlatformAPICallPreHandler(cancelInvoiceRequest.ToNVPString(string.Empty), ServiceName, "CancelInvoice", apiUserName, getAccessToken(), getAccessTokenSecret());
        	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
     ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
     string response = Call(apiCallPreHandler);
     NVPUtil util = new NVPUtil();
     return CancelInvoiceResponse.CreateInstance(util.ParseNVPString(response), string.Empty, -1);
 }
Beispiel #4
0
        /// <summary>
        /// API call example for CancelInvoice
        /// </summary>
        /// <param name="context"></param>
        private void CancelInvoice(HttpContext context)
        {
            // Collect input params
            String invoiceId = context.Request.Params["invoiceId"];
            CancelInvoiceRequest request = new CancelInvoiceRequest();
            request.invoiceID = invoiceId;

            // Create service object and make the API call
            InvoiceService service;
            CancelInvoiceResponse response;

            try
            {
                service = getService(context);
                response = service.CancelInvoice(request);
            }
            catch (Exception e)
            {
                context.Response.Write(e.Message);
                return;
            }

            // Display response values.
            Dictionary<string, string> keyResponseParams = new Dictionary<string, string>();
            keyResponseParams.Add("API status", response.responseEnvelope.ack.ToString());
            keyResponseParams.Add("correlationId", response.responseEnvelope.correlationId);
            keyResponseParams.Add("invoiceId", response.invoiceID);
            keyResponseParams.Add("invoiceNumber", response.invoiceNumber);
            keyResponseParams.Add("invoiceUrl", response.invoiceURL);
            displayResponse(context, "CancelInvoice", keyResponseParams, service.getLastRequest(),
                service.getLastResponse(), response.error, null);
        }
 /// <summary> 
 /// 
 /// </summary>
 ///<param name="cancelInvoiceRequest"></param>
 public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest cancelInvoiceRequest)
 {
     return CancelInvoice(cancelInvoiceRequest,(string) null);
 }
Beispiel #6
0
 /**
   *AUTO_GENERATED
  	  */
 public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest CancelInvoiceRequest)
 {
     return CancelInvoice(CancelInvoiceRequest, null);
 }
        /// <summary>
        /// API call example for CancelInvoice
        /// </summary>
        /// <param name="context"></param>
        private void CancelInvoice(HttpContext context)
        {
            // Collect input params
            // (Optional) ID of the invoice.
            string invoiceId = context.Request.Params["invoiceId"];
            InvoiceModelAlias.CancelInvoiceRequest request = new InvoiceModelAlias.CancelInvoiceRequest();
            request.invoiceID = invoiceId;

            // Create service object and make the API call
            InvoiceAlias.InvoiceService service;
            InvoiceModelAlias.CancelInvoiceResponse response;
            SignatureCredential cred = SetThirdPartyAuthorization(context);
            try
            {
                service = GetService(context);
                if (cred != null)
                {
                    response = service.CancelInvoice(request, cred);
                }
                else
                {
                    response = service.CancelInvoice(request);
                }
            }
            catch (Exception e)
            {
                context.Response.Write(e.Message);
                return;
            }

            // Display response values.
            Dictionary<string, string> keyResponseParams = new Dictionary<string, string>();

            //Acknowledgement code. It is one of the following values:
            //Success – The operation completed successfully.
            //Failure – The operation failed.
            //SuccessWithWarning – The operation completed successfully; however, there is a warning message.
            //FailureWithWarning – The operation failed with a warning message.
            keyResponseParams.Add("API status", response.responseEnvelope.ack.ToString());

            // Correlation identifier. It is a 13-character,
            // alphanumeric string (for example, db87c705a910e) that is used
            // only by PayPal Merchant Technical Support.
            // Note: You must log and store this data for every response you receive.
            // PayPal Technical Support uses the information to assist with reported issues.
            keyResponseParams.Add("correlationId", response.responseEnvelope.correlationId);

            // ID of the invoice.
            keyResponseParams.Add("invoiceId", response.invoiceID);

            // Number of the canceled invoice.
            keyResponseParams.Add("invoiceNumber", response.invoiceNumber);

            // URL location where merchants view the invoice details.
            keyResponseParams.Add("invoiceUrl", response.invoiceURL);
            displayResponse(context, "CancelInvoice", keyResponseParams, service.getLastRequest(),
                service.getLastResponse(), response.error, null);
        }
Beispiel #8
0
 /**
   *AUTO_GENERATED
  	  */
 public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest cancelInvoiceRequest, string apiUserName)
 {
     string response = Call("CancelInvoice", cancelInvoiceRequest.ToNVPString(""), apiUserName);
     NVPUtil util = new NVPUtil();
     return CancelInvoiceResponse.CreateInstance(util.ParseNVPString(response), "", -1);
 }
Beispiel #9
0
        /// <summary>
        /// API call example for CancelInvoice
        /// </summary>
        /// <param name="context"></param>
        private void CancelInvoice(HttpContext context)
        {
            // Collect input params
            String invoiceId = context.Request.Params["invoiceId"];
            CancelInvoiceRequest request = new CancelInvoiceRequest();
            request.invoiceID = invoiceId;

            // Create service object and make the API call
            InvoiceService service = getService(context);
            CancelInvoiceResponse response = service.CancelInvoice(request);

            // Process response
            context.Response.Write("<html><body><textarea rows=30 cols=80>");
            ObjectDumper.Write(response, 5, context.Response.Output);
            context.Response.Write("</textarea></body></html>");
        }