ToNVPString() public method

public ToNVPString ( string prefix ) : string
prefix string
return string
Example #1
0
        public void createInvoiceRequestSerialization()
        {
            CreateInvoiceRequest cir = new CreateInvoiceRequest();
            cir.invoice = this.invoice;
            cir.requestEnvelope = new RequestEnvelope("en_US");

            string expectedNVPString = "requestEnvelope.errorLanguage=en_US&invoice.merchantEmail=jb-us-seller1%40paypal.com&invoice.payerEmail=jbui-us-personal1%40paypal.com&invoice.number=FD-123-5421&"
                + "invoice.currencyCode=USD&invoice.invoiceDate=2011-10-04T00%3a00%3a00&invoice.dueDate=2011-11-04T00%3a00%3a00&invoice.paymentTerms=Net45&invoice.discountPercent=5&"
                + "invoice.discountAmount=10.0&invoice.terms=Payment+terms&invoice.note=Note+about+invoice&invoice.merchantMemo=memo&"
                + "invoice.billingInfo.firstName=Bonzop&invoice.billingInfo.lastName=Zaius&invoice.billingInfo.businessName=Bonzop+Inc&invoice.billingInfo.phone=5126914160&invoice.billingInfo.fax=5126914161&invoice.billingInfo.website=www.bonzop-inc.com&invoice.billingInfo.customValue=Business+mumbo+jumbo+%c2%a9&"
                + "invoice.shippingAmount=2.1&invoice.shippingTaxName=Bonzop+Inc&invoice.shippingTaxRate=1.2&";
            Assert.AreEqual(expectedNVPString, cir.ToNVPString(""));

            cir = new CreateInvoiceRequest(new RequestEnvelope("en_US"), invoice);
            Assert.AreEqual(expectedNVPString, cir.ToNVPString(""));
        }
Example #2
0
 /**
   *AUTO_GENERATED
  	  */
 public CreateInvoiceResponse CreateInvoice(CreateInvoiceRequest createInvoiceRequest, string apiUserName)
 {
     string response = Call("CreateInvoice", createInvoiceRequest.ToNVPString(""), apiUserName);
     NVPUtil util = new NVPUtil();
     return CreateInvoiceResponse.CreateInstance(util.ParseNVPString(response), "", -1);
 }
        /// <summary>
        /// 
        /// </summary>
        ///<param name="createInvoiceRequest"></param>
        ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> 
        public CreateInvoiceResponse CreateInvoice(CreateInvoiceRequest createInvoiceRequest, ICredential credential)
        {
            IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, createInvoiceRequest.ToNVPString(string.Empty), ServiceName, "CreateInvoice", credential);
               	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
            ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
            ((PlatformAPICallPreHandler) apiCallPreHandler).PortName = "Invoice";

            NVPUtil util = new NVPUtil();
            return CreateInvoiceResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1);
        }
 /**
   *AUTO_GENERATED
  	  */
 public CreateInvoiceResponse CreateInvoice(CreateInvoiceRequest createInvoiceRequest, string apiUserName)
 {
     IAPICallPreHandler apiCallPreHandler = null;
     apiCallPreHandler = new PlatformAPICallPreHandler(createInvoiceRequest.ToNVPString(string.Empty), ServiceName, "CreateInvoice", apiUserName, getAccessToken(), getAccessTokenSecret());
        	 	((PlatformAPICallPreHandler) apiCallPreHandler).SDKName = SDKName;
     ((PlatformAPICallPreHandler) apiCallPreHandler).SDKVersion = SDKVersion;
     string response = Call(apiCallPreHandler);
     NVPUtil util = new NVPUtil();
     return CreateInvoiceResponse.CreateInstance(util.ParseNVPString(response), string.Empty, -1);
 }