// # Creating Business Account
    public CreateAccountRequest CreateBusinessAccount()
    {
        // Create the CreateAccountRequest object
        CreateAccountRequest createAccountRequest = CreateAccount();

        // Set the account type as Business
        createAccountRequest.accountType = "Business";

        // The Address of the business for which the PayPal account is created:
        //
        // * Street1
        // * countrycode
        // * city
        // * state
        // * postalcode
        AddressType businessAddress = new AddressType("Ape Way", "US");

        businessAddress.city       = "Austin";
        businessAddress.state      = "TX";
        businessAddress.postalCode = "78750";

        // Business Account mandatory arguments:
        //
        // * Business Name
        // * Business Address
        // * Contact Phone Number
        BusinessInfoType businessInfo = new BusinessInfoType("Toy shop", businessAddress, "5126914161");

        // The type of the business for which the PayPal account is created
        // Allowable values:
        //
        // * CORPORATION
        // * GOVERNMENT
        // * INDIVIDUAL
        // * NONPROFIT
        // * PARTNERSHIP
        // * PROPRIETORSHIP
        businessInfo.businessType = BusinessType.INDIVIDUAL;

        // The average monthly transaction volume of the business
        // Required for all countries except Japan and Australia
        businessInfo.averageMonthlyVolume = Convert.ToDecimal("400");

        // The average price per transaction
        // Required for all countries except Japan and Australia
        businessInfo.averagePrice = Convert.ToDecimal("30");

        // The email address of customer service department of the business
        businessInfo.customerServiceEmail = "*****@*****.**";

        // Required for US accounts
        businessInfo.customerServicePhone = "5126914162";

        // The category code for the business
        // Required unless you specify both category and subcategory
        // PayPal uses the industry standard Merchant Category Codes
        businessInfo.merchantCategoryCode = Convert.ToInt32("1520");

        // The date of establishment for the business
        // Optional for France
        // For Business Accounts in the following countries:
        //
        // * United States
        // * United Kingdom
        // * Canada
        // * Germany
        // * Spain
        // * Italy
        // * Netherlands
        // * Czech Republic
        // * Sweden
        // * Denmark
        // Format needs to be YYYY-MM-DD
        businessInfo.dateOfEstablishment = "2011-12-21";

        // The percentage of online sales for the business from 0 through 100
        // Required for business accounts in the following countries:
        //
        // * United States
        // * Canada
        // * United Kingdom
        // * France
        // * Czech Republic
        // * New Zealand
        // * Switzerland
        // * Israel
        businessInfo.percentageRevenueFromOnline = Convert.ToInt32("70");

        // The venue type for sales. Required for business accounts in all countries except Czech Republic and Australia
        // Allowable values:
        //
        // * WEB
        // * EBAY
        // * OTHER_MARKETPLACE
        // * OTHER
        List <SalesVenueType?> salesVenueList = new List <SalesVenueType?>();

        salesVenueList.Add(SalesVenueType.OTHER);
        businessInfo.salesVenue = salesVenueList;

        // A description of the sales venue
        // Required if salesVenue is OTHER for all countries except Czech Republic and Australia
        businessInfo.salesVenueDesc = "Other sales venue type";

        createAccountRequest.businessInfo = businessInfo;
        CreateAccountAPIOperations(createAccountRequest);

        return(createAccountRequest);
    }
示例#2
0
        public void Init()
        {
            errorResponse = new Dictionary <string, string>();

            errorResponse.Add("responseEnvelope.timestamp", "2011-05-11T22%3A05%3A33.962-07%3A00");
            errorResponse.Add("responseEnvelope.ack", "Failure");
            errorResponse.Add("responseEnvelope.correlationId", "b1985a21862fe");
            errorResponse.Add("responseEnvelope.build", "1877082");
            errorResponse.Add("error(0).errorId", "580022");
            errorResponse.Add("error(0).domain", "PLATFORM");
            errorResponse.Add("error(0).subdomain", "Application");
            errorResponse.Add("error(0).severity", "Error");
            errorResponse.Add("error(0).category", "Application");
            errorResponse.Add("error(0).message", "Invalid+request+parameter%3A+shippingTaxName+cannot+be+null");
            errorResponse.Add("error(0).parameter(0).name", "shippingTaxName");
            errorResponse.Add("error(0).parameter(1).name", "null");
            errorResponse.Add("error(1).errorId", "580022");
            errorResponse.Add("error(1).domain", "PLATFORM");
            errorResponse.Add("error(1).subdomain", "Application");
            errorResponse.Add("error(1).severity", "Error");
            errorResponse.Add("error(1).category", "Application");
            errorResponse.Add("error(1).message", "Invalid+request+parameter%3A+taxName+cannot+be+null");
            errorResponse.Add("error(1).parameter(0).name", "taxName");
            errorResponse.Add("error(1).parameter(1).name", "null");

            validCreateInvoiceResponse = new Dictionary <string, string>();
            validCreateInvoiceResponse.Add("responseEnvelope.timestamp", "2011-05-30T03:31:18.988-07:00");
            validCreateInvoiceResponse.Add("responseEnvelope.ack", "Success");
            validCreateInvoiceResponse.Add("responseEnvelope.correlationId", "9b3bb0a44d852");
            validCreateInvoiceResponse.Add("responseEnvelope.build", "1917403");
            validCreateInvoiceResponse.Add("invoiceID", "INV2-PCWG-P78G-7EYV-94QY");
            validCreateInvoiceResponse.Add("invoiceNumber", "0056");
            validCreateInvoiceResponse.Add("invoiceURL", "https://www.stage2sc5376.qa.paypal.com/us/cgi-bin/?cmd=_inv-details&id=INV2-PCWG-P78G-7EYV-94QY");

            validSendInvoiceResponse = new Dictionary <string, string>();
            validSendInvoiceResponse.Add("responseEnvelope.timestamp", "2011-05-30T03:31:18.988-07:00");
            validSendInvoiceResponse.Add("responseEnvelope.ack", "Success");
            validSendInvoiceResponse.Add("responseEnvelope.correlationId", "9b3bb0a44d852");
            validSendInvoiceResponse.Add("responseEnvelope.build", "1917403");
            validSendInvoiceResponse.Add("invoiceID", "INV2-PCWG-P78G-7EYV-94QY");
            validSendInvoiceResponse.Add("invoiceURL", "https://www.stage2sc5376.qa.paypal.com/us/cgi-bin/?cmd=_inv-details&id=INV2-PCWG-P78G-7EYV-94QY");


            this.addr        = new BaseAddress();
            addr.city        = "Austin";
            addr.countryCode = "US";
            addr.line1       = "1968 Ape Way";
            addr.line2       = "Apt 123";
            addr.postalCode  = "78750";
            addr.state       = "TX";

            bizInfo              = new BusinessInfoType();
            bizInfo.firstName    = "Bonzop";
            bizInfo.lastName     = "Zaius";
            bizInfo.businessName = "Bonzop Inc";
            bizInfo.fax          = "5126914161";
            bizInfo.phone        = "5126914160";
            bizInfo.website      = "www.bonzop-inc.com";
            bizInfo.customValue  = "Business mumbo jumbo ©";

            invoice                 = new InvoiceType();
            invoice.billingInfo     = this.bizInfo;
            invoice.currencyCode    = "USD";
            invoice.discountAmount  = 10.0M;
            invoice.discountPercent = 5;
            invoice.dueDate         = "2011-11-04T00:00:00";
            invoice.invoiceDate     = "2011-10-04T00:00:00";
            invoice.merchantEmail   = "*****@*****.**";
            invoice.payerEmail      = "*****@*****.**";
            invoice.merchantMemo    = "memo";
            invoice.note            = "Note about invoice";
            invoice.number          = "FD-123-5421";
            invoice.paymentTerms    = PaymentTermsType.NET4;
            invoice.shippingAmount  = 2.1M;
            invoice.shippingTaxName = "Bonzop Inc";
            invoice.shippingTaxRate = 1.2M;
            invoice.terms           = "Payment terms";
        }