Exemplo n.º 1
0
        /**
         *
         */
        public CreateAndSendInvoiceResponse CreateAndSendInvoice(CreateAndSendInvoiceRequest CreateAndSendInvoiceRequest, string apiUsername)
        {
            string resp = call("CreateAndSendInvoice", CreateAndSendInvoiceRequest.toNVPString(""), apiUsername);

            NVPUtil util = new NVPUtil();

            return(new CreateAndSendInvoiceResponse(util.parseNVPString(resp), ""));
        }
Exemplo n.º 2
0
        public void createAndSendInvoiceRequestSerialization()
        {
            CreateAndSendInvoiceRequest cir = new CreateAndSendInvoiceRequest();

            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 CreateAndSendInvoiceRequest(new RequestEnvelope("en_US"), invoice);
            Assert.AreEqual(expectedNVPString, cir.toNVPString(""));
        }