The request object for MarkInvoiceAsUnpaid.
Esempio n. 1
0
        /// <summary>
        /// API call example for MarkInvoiceAsUnpaid
        /// </summary>
        /// <param name="context"></param>
        private void MarkInvoiceAsUnpaid(HttpContext context)
        {
            // Collect input params
            String invoiceId = context.Request.Params["invoiceId"];
            MarkInvoiceAsUnpaidRequest request =
                new MarkInvoiceAsUnpaidRequest(new RequestEnvelope(ERROR_LANGUAGE), invoiceId);

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

            try {
                service = getService(context);
                response = service.MarkInvoiceAsUnpaid(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, "MarkInvoiceAsUnpaid", keyResponseParams, service.getLastRequest(),
                service.getLastResponse(), response.error, null);
        }
 /// <summary> 
 /// 
 /// </summary>
 ///<param name="markInvoiceAsUnpaidRequest"></param>
 public MarkInvoiceAsUnpaidResponse MarkInvoiceAsUnpaid(MarkInvoiceAsUnpaidRequest markInvoiceAsUnpaidRequest)
 {
     return MarkInvoiceAsUnpaid(markInvoiceAsUnpaidRequest,(string) null);
 }
        /// <summary>
        /// 
        /// </summary>
        ///<param name="markInvoiceAsUnpaidRequest"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public MarkInvoiceAsUnpaidResponse MarkInvoiceAsUnpaid(MarkInvoiceAsUnpaidRequest markInvoiceAsUnpaidRequest, ICredential credential)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, markInvoiceAsUnpaidRequest.ToNVPString(string.Empty), ServiceName, "MarkInvoiceAsUnpaid", credential);
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "Invoice";

            NVPUtil util = new NVPUtil();
            return MarkInvoiceAsUnpaidResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
Esempio n. 4
0
 /**
   *AUTO_GENERATED
  	  */
 public MarkInvoiceAsUnpaidResponse MarkInvoiceAsUnpaid(MarkInvoiceAsUnpaidRequest MarkInvoiceAsUnpaidRequest)
 {
     return MarkInvoiceAsUnpaid(MarkInvoiceAsUnpaidRequest, null);
 }
Esempio n. 5
0
 /**
   *AUTO_GENERATED
  	  */
 public MarkInvoiceAsUnpaidResponse MarkInvoiceAsUnpaid(MarkInvoiceAsUnpaidRequest MarkInvoiceAsUnpaidRequest, string apiUsername)
 {
     string resp = call("MarkInvoiceAsUnpaid", MarkInvoiceAsUnpaidRequest.toNVPString(""), apiUsername);
     NVPUtil util = new NVPUtil();
     return new MarkInvoiceAsUnpaidResponse(util.parseNVPString(resp), "");
 }
        /// <summary>
        /// API call example for MarkInvoiceAsUnpaid
        /// </summary>
        /// <param name="context"></param>
        private void MarkInvoiceAsUnpaid(HttpContext context)
        {
            // Collect input params
            // (Required) ID of the invoice to mark as unpaid.
            string invoiceId = context.Request.Params["invoiceId"];
            InvoiceModelAlias.RequestEnvelope env = new InvoiceModelAlias.RequestEnvelope();

            // (Required) RFC 3066 language in which error messages are returned;
            // by default it is en_US, which is the only language currently supported.
            env.errorLanguage = ERROR_LANGUAGE;
            InvoiceModelAlias.MarkInvoiceAsUnpaidRequest request =
                new InvoiceModelAlias.MarkInvoiceAsUnpaidRequest(env, invoiceId);

            // Create service object and make the API call
            InvoiceAlias.InvoiceService service;
            InvoiceModelAlias.MarkInvoiceAsUnpaidResponse response;
            SignatureCredential cred = SetThirdPartyAuthorization(context);
            try
            {
                service = GetService(context);
                if (cred != null)
                {
                    response = service.MarkInvoiceAsUnpaid(request, cred);
                }
                else
                {
                    response = service.MarkInvoiceAsUnpaid(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 marked as unpaid.
            keyResponseParams.Add("invoiceId", response.invoiceID);

            // Number of the invoice marked as unpaid.
            keyResponseParams.Add("invoiceNumber", response.invoiceNumber);

            // URL location where merchants view the invoice details.
            keyResponseParams.Add("invoiceUrl", response.invoiceURL);
            displayResponse(context, "MarkInvoiceAsUnpaid", keyResponseParams, service.getLastRequest(),
                service.getLastResponse(), response.error, null);
        }
Esempio n. 7
0
 /**
   *AUTO_GENERATED
  	  */
 public MarkInvoiceAsUnpaidResponse MarkInvoiceAsUnpaid(MarkInvoiceAsUnpaidRequest markInvoiceAsUnpaidRequest, string apiUserName)
 {
     string response = Call("MarkInvoiceAsUnpaid", markInvoiceAsUnpaidRequest.ToNVPString(""), apiUserName);
     NVPUtil util = new NVPUtil();
     return MarkInvoiceAsUnpaidResponse.CreateInstance(util.ParseNVPString(response), "", -1);
 }
 /**
   *AUTO_GENERATED
  	  */
 public MarkInvoiceAsUnpaidResponse MarkInvoiceAsUnpaid(MarkInvoiceAsUnpaidRequest markInvoiceAsUnpaidRequest, string apiUserName)
 {
     IAPICallPreHandler apiCallPreHandler = null;
     apiCallPreHandler = new PlatformAPICallPreHandler(markInvoiceAsUnpaidRequest.ToNVPString(string.Empty), ServiceName, "MarkInvoiceAsUnpaid", apiUserName, getAccessToken(), getAccessTokenSecret());
        	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
     ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
     string response = Call(apiCallPreHandler);
     NVPUtil util = new NVPUtil();
     return MarkInvoiceAsUnpaidResponse.CreateInstance(util.ParseNVPString(response), string.Empty, -1);
 }