예제 #1
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);
        }
예제 #2
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));
        }
예제 #3
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), ""));
        }
예제 #4
0
        /// <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));
        }
예제 #5
0
        /// <summary>
        ///
        /// </summary>
        ///<param name="cancelInvoiceRequest"></param>

        public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest cancelInvoiceRequest)
        {
            return(CancelInvoice(cancelInvoiceRequest, (string)null));
        }
예제 #6
0
 public CancelInvoiceResponse CancelInvoice(CancelInvoiceRequest CancelInvoiceRequest)
 {
     return(CancelInvoice(CancelInvoiceRequest, null));
 }