当前位置: 首页>>代码示例>>PHP>>正文


PHP Address::setLine2方法代码示例

本文整理汇总了PHP中Address::setLine2方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::setLine2方法的具体用法?PHP Address::setLine2怎么用?PHP Address::setLine2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Address的用法示例。


在下文中一共展示了Address::setLine2方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testLatLongValidation

 function testLatLongValidation()
 {
     $address = new Address();
     $address->setLine1("900 Winslow Way");
     $address->setLine2("Ste 130");
     $address->setCity("Bainbridge Island");
     $address->setRegion("WA");
     $address->setPostalCode("98110");
     $address->setLongitude("-122.510359");
     $address->setLatitude("47.624972");
     $validateRequest = new ValidateRequest();
     $validateRequest->setAddress($address);
     $validateRequest->setTextCase(TextCase::$Upper);
     //added for 4.13 changes
     $validateRequest->setCoordinates(true);
     //Sets Profile name from Configuration File to "Jaas"
     //this will force it to Jaas (PostLocate)
     $this->client = new AddressServiceSoap("JaasDevelopement");
     //validate the Request
     $result = $this->client->validate($validateRequest);
     //Re-Assigning to the original Profile
     $this->client = new AddressServiceSoap("Development");
     $this->assertEqual($result->getResultCode(), SeverityLevel::$Success);
     $validAddresses = $result->getValidAddresses();
     $this->assertEqual(1, count($validAddresses));
     $validAddresses = $result->getValidAddresses();
     if (count($validAddresses) != 1) {
         echo "Unexpected number of addresses returned.  Expected one address.";
     } else {
         $validAddress = $validAddresses[0];
         $this->assertEqual(strtoupper($address->getLine1()) . " E " . strtoupper($address->getLine2()), $validAddress->getLine1());
         $this->assertEqual("", $validAddress->getLine2());
         $this->assertEqual(strtoupper($address->getCity()), $validAddress->getCity());
         $this->assertEqual(strtoupper($address->getRegion()), $validAddress->getRegion());
         $this->assertEqual($address->getPostalCode() . "-2450", $validAddress->getPostalCode());
         $this->assertEqual("H", $validAddress->getAddressType());
         $this->assertEqual("C051", $validAddress->getCarrierRoute());
         //Ticket 21203: Modified Fips Code value for jaas enabled account.
         //$this->assertEqual("5303500000", $validAddress->getFipsCode());
         $this->assertEqual("5303503736", $validAddress->getFipsCode());
         $this->assertEqual("KITSAP", $validAddress->getCounty());
         $this->assertEqual(strtoupper($address->getCity()) . " " . strtoupper($address->getRegion()) . " " . $address->getPostalCode() . "-2450", $validAddress->getLine4());
         $this->assertEqual("981102450307", $validAddress->getPostNet());
         // Added 4.13 changes for the Lat Long
         // Update to check for ZIP+4 precision
         // Zip+4 precision coordinates
         if (strlen($validAddress->getLatitude()) > 7) {
             echo "ZIP+4 precision coordinates received";
             $this->assertEqual($address->getLatitude(), $validAddress->getLatitude());
             $this->assertEqual($address->getLongitude(), $validAddress->getLongitude());
         } else {
             echo "ZIP5 precision coordinates received";
             $this->assertEqual(substr($validAddress->getLatitude(), 0, 4), substr($address->getLatitude(), 0, 4), "Expected Latitude to start with '47.64'");
             $this->assertEqual(substr($validAddress->getLongitude(), 0, 6), substr($address->getLongitude(), 0, 6), "Expected Longitude to start with '-122.53'");
         }
     }
 }
开发者ID:vijaynalawade-avalara,项目名称:AvaTax-SOAP-PHP-SDK,代码行数:57,代码来源:AddressSvcTest.php

示例2: _convertRequestAddress

 /**
  * Sets attributes from the Mage address on the AvaTax Request address.
  *
  * @return $this
  */
 protected function _convertRequestAddress()
 {
     if (!$this->_requestAddress) {
         $this->_requestAddress = new Address();
     }
     $this->_requestAddress->setLine1($this->_mageAddress->getStreet(1));
     $this->_requestAddress->setLine2($this->_mageAddress->getStreet(2));
     $this->_requestAddress->setCity($this->_mageAddress->getCity());
     $this->_requestAddress->setRegion($this->_mageAddress->getRegionCode());
     $this->_requestAddress->setCountry($this->_mageAddress->getCountry());
     $this->_requestAddress->setPostalCode($this->_mageAddress->getPostcode());
     return $this;
 }
开发者ID:shabirm,项目名称:avatax,代码行数:18,代码来源:Address.php

示例3: buildMerchants

 public function buildMerchants($xml)
 {
     $merchants = new Merchants();
     $merchants->setPageOffset((string) $xml->PageOffset);
     $merchants->setTotalCount((string) $xml->TotalCount);
     // merchant
     $merchantArray = array();
     foreach ($xml->Merchant as $merchant) {
         $tmpMerchant = new Merchant();
         $tmpMerchant->setId((string) $merchant->Id);
         $tmpMerchant->setName((string) $merchant->Name);
         $tmpMerchant->setWebsiteUrl((string) $merchant->WebsiteUrl);
         $tmpMerchant->setPhoneNumber((string) $merchant->PhoneNumber);
         $tmpMerchant->setCategory((string) $merchant->Category);
         $tmpLocation = new Location();
         $location = $merchant->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         // ACCEPTANCE FRAMEWORK NEEDS LOOKED AT <RETURN XML AND DOC DOES NOT HAVE ALL VALUES>
         //$tmpAcceptance = new Acceptance();
         //$acceptance = $merchant->Acceptance;
         // FEATURES FRAMEWORK NEEDS LOOKED AT <RETURN XML AND DOC DOES NOT HAVE ALL VALUES>
         //$tmpFeatures = new Features();
         //$features =  $merchant->Features;
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpMerchant->setLocation($tmpLocation);
         array_push($merchantArray, $tmpMerchant);
     }
     $merchants->setMerchant($merchantArray);
     return $merchants;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:51,代码来源:MerchantLocationService.php

示例4: vault_add_creditcard

 public function vault_add_creditcard($paydata)
 {
     $status = '';
     $result = '';
     $o_bcpc = new BaseCommerceClient(RENTSQUARE_MERCH_USER, RENTSQUARE_MERCH_PASS, RENTSQUARE_MERCH_KEY);
     $o_bcpc->setSandbox(BC_SANDBOXVALUE);
     $o_bc = new BankCard();
     $o_bc->setExpirationMonth($paydata['expire_dt_month']);
     $o_bc->setExpirationYear($paydata['expire_dt_year']);
     $o_bc->setName($paydata['first_name'] . " " . $paydata['last_name']);
     $o_bc->setNumber($paydata['card_number']);
     $o_billing_address = new Address(Address::$XS_ADDRESS_NAME_BILLING);
     $o_billing_address->setLine1($paydata['billing_address1']);
     if (!empty($paydata['billing_address2'])) {
         $o_billing_address->setLine2($paydata['billing_address2']);
     } else {
         $o_billing_address->setLine2(" ");
     }
     $o_billing_address->setCity($paydata['billing_city']);
     if (!empty($paydata['billing_state_id'])) {
         $States = new State();
         $billing_state = $States->findById($paydata['billing_state_id']);
         $billing_state = $billing_state['State']['abbr'];
     }
     $o_billing_address->setState($billing_state);
     $o_billing_address->setZipcode($paydata['billing_zip']);
     $o_billing_address->setCountry("USA");
     $o_bc->setBillingAddress($o_billing_address);
     /*
     echo "<pre>";
     print_r($o_bc);
     echo "</pre>";
     exit;
     */
     $o_bc = $o_bcpc->addBankCard($o_bc);
     $status = $o_bc->getStatus();
     if ($status == BankCard::$XS_BC_STATUS_FAILED) {
         // Fail
         $status = 0;
         $result = $o_bc->getMessages();
     } else {
         if ($status == BankCard::$XS_BC_STATUS_ACTIVE) {
             // Success
             $status = 1;
             $result = $o_bc->getToken();
         }
     }
     return array($status, $result);
 }
开发者ID:omusico,项目名称:RentSquare,代码行数:49,代码来源:PayMethodBasecommerce.php

示例5: buildAtms

 public function buildAtms($xml)
 {
     $atms = new Atms();
     $atms->setPageOffset($xml->PageOffset);
     $atms->setTotalCount($xml->TotalCount);
     $atmArray = array();
     foreach ($xml->Atm as $atm) {
         $tmpAtm = new Atm();
         $tmpAtm->setHandicapAccessible((string) $atm->HandicapAccessible);
         $tmpAtm->setCamera((string) $atm->Camera);
         $tmpAtm->setAvailability((string) $atm->Availability);
         $tmpAtm->setAccessFees((string) $atm->AccessFees);
         $tmpAtm->setOwner((string) $atm->Owner);
         $tmpAtm->setSharedDeposit((string) $atm->SharedDeposit);
         $tmpAtm->setSurchargeFreeAlliance((string) $atm->SurchargeFreeAlliance);
         $tmpAtm->setSponsor((string) $atm->Sponsor);
         $tmpAtm->setSupportEMV((string) $atm->SupportEMV);
         $tmpAtm->setSurchargeFreeAllianceNetwork((string) $atm->SurchargeFreeAllianceNetwork);
         $tmpLocation = new Location();
         $location = $atm->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpAtm->setLocation($tmpLocation);
         array_push($atmArray, $tmpAtm);
     }
     $atms->setAtm($atmArray);
     return $atms;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:49,代码来源:AtmLocationService.php

示例6: buildAtms

 public function buildAtms($xml)
 {
     $pageOffset = (string) $xml->PageOffset;
     $totalCount = (string) $xml->TotalCount;
     $restaurantArray = array();
     foreach ($xml->Restaurant as $restaurant) {
         $tmpRestaurant = new Restaurant();
         $tmpRestaurant->setId((string) $restaurant->Id);
         $tmpRestaurant->setName((string) $restaurant->Name);
         $tmpRestaurant->setWebsiteUrl((string) $restaurant->WebsiteUrl);
         $tmpRestaurant->setPhoneNumber((string) $restaurant->PhoneNumber);
         $tmpRestaurant->setCategory((string) $restaurant->Category);
         $tmpRestaurant->setLocalFavoriteInd((string) $restaurant->LocalFavoriteInd);
         $tmpRestaurant->setHiddenGemInd((string) $restaurant->HiddenGemInd);
         $tmpLocation = new Location();
         $location = $restaurant->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpRestaurant->setLocation($tmpLocation);
         array_push($restaurantArray, $tmpRestaurant);
     }
     $restaurants = new Restaurants($pageOffset, $totalCount, $restaurantArray);
     return $restaurants;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:45,代码来源:RestaurantsLocalFavoritesService.php

示例7: buildMerchantIds

 public function buildMerchantIds($xml)
 {
     $merchantArray = array();
     foreach ($xml->ReturnedMerchants->Merchant as $merchant) {
         $xmlAddress = $merchant->Address;
         $xmlCountrySubdivision = $merchant->Address->CountrySubdivision;
         $xmlCountry = $merchant->Address->Country;
         $xmlMerchant = $merchant;
         $address = new Address();
         $address->setLine1((string) $xmlAddress->Line1);
         $address->setLine2((string) $xmlAddress->Line2);
         $address->setCity((string) $xmlAddress->City);
         $address->setPostalCode((string) $xmlAddress->PostalCode);
         $countrySubdivision = new CountrySubdivision();
         $countrySubdivision->setCode((string) $xmlCountrySubdivision->Code);
         $countrySubdivision->setName((string) $xmlCountrySubdivision->Name);
         $country = new Country();
         $country->setCode((string) $xmlCountry->Code);
         $country->setName((string) $xmlCountry->Name);
         $address->setCountrySubdivision($countrySubdivision);
         $address->setCountry($country);
         $tmpMerchant = new Merchant();
         $tmpMerchant->setAddress($address);
         $tmpMerchant->setPhoneNumber((string) $xmlMerchant->PhoneNumber);
         $tmpMerchant->setBrandName((string) $xmlMerchant->BrandName);
         $tmpMerchant->setMerchantCategory((string) $xmlMerchant->MerchantCategory);
         $tmpMerchant->setMerchantDbaName((string) $xmlMerchant->MerchantDbaName);
         $tmpMerchant->setDescriptorText((string) $xmlMerchant->DescriptorText);
         $tmpMerchant->setLegalCorporateName((string) $xmlMerchant->LegalCorporateName);
         $tmpMerchant->setBrickCount((string) $xmlMerchant->BrickCount);
         $tmpMerchant->setComment((string) $xmlMerchant->Comment);
         $tmpMerchant->setLocationId((string) $xmlMerchant->LocationId);
         $tmpMerchant->setOnlineCount((string) $xmlMerchant->OnlineCount);
         $tmpMerchant->setOtherCount((string) $xmlMerchant->OtherCount);
         $tmpMerchant->setSoleProprietorName((string) $xmlMerchant->SoleProprietorName);
         array_push($merchantArray, $tmpMerchant);
     }
     $returnedMerchants = new ReturnedMerchants();
     $returnedMerchants->setMerchant($merchantArray);
     $merchantIds = new MerchantIds();
     $merchantIds->setReturnedMerchants($returnedMerchants);
     $merchantIds->setMessage($xml->Message);
     return $merchantIds;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:44,代码来源:MerchantIdentifierService.php

示例8: AddressServiceSoap

require '../../AvaTax4PHP/AvaTax.php';
// include in all Avalara Scripts
require '../Credentials.php';
// where service URL, account, license key are set
$client = new AddressServiceSoap('Development');
$STDIN = fopen('php://stdin', 'r');
try {
    $address = new Address();
    // Get The address from the user via keyboard input
    echo "Address Line 1: ";
    $input = rtrim(fgets($STDIN));
    $address->setLine1($input);
    echo "Address Line 2: ";
    $input = rtrim(fgets($STDIN));
    $address->setLine2($input);
    echo "Address Line 3: ";
    $input = rtrim(fgets($STDIN));
    $address->setLine3($input);
    echo "City: ";
    $input = rtrim(fgets($STDIN));
    $address->setCity($input);
    echo "State/Province: ";
    $input = rtrim(fgets($STDIN));
    $address->setRegion($input);
    echo "Postal Code: ";
    $input = rtrim(fgets($STDIN));
    $address->setPostalCode($input);
    $textCase = TextCase::$Mixed;
    $coordinates = 1;
    $request = new ValidateRequest($address, $textCase ? $textCase : TextCase::$Default, $coordinates);
开发者ID:vijaynalawade-avalara,项目名称:AvaTax-SOAP-PHP-SDK,代码行数:30,代码来源:Validate.php

示例9: TaxServiceSoap

// where service URL, account, license key are set
$client = new TaxServiceSoap('Development');
$request = new GetTaxRequest();
//Add Origin Address
$origin = new Address();
$origin->setLine1("435 Ericksen Ave NE");
$origin->setLine2("Suite 200");
$origin->setCity("Bainbridge Island");
$origin->setRegion("WA");
$origin->setPostalCode("98110-1896");
$request->setOriginAddress($origin);
//Address
//Add Destination address
$destination = new Address();
$destination->setLine1("900 Winslow Way");
$destination->setLine2("Suite 200");
$destination->setCity("Bainbridge Island");
$destination->setRegion("WA");
$destination->setPostalCode("98110");
$request->setDestinationAddress($destination);
//Address
$request->setCompanyCode('DEFAULT');
// Your Company Code From the Dashboard
$request->setDocType(DocumentType::$SalesInvoice);
// Only supported types are SalesInvoice or SalesOrder
$dateTime = new DateTime();
$docCode = "PHPSample" . date_format($dateTime, "dmyGis");
$request->setDocCode($docCode);
//    invoice number
$request->setDocDate(date_format($dateTime, "Y-m-d"));
//date
开发者ID:vijaynalawade-avalara,项目名称:AvaTax-SOAP-PHP-SDK,代码行数:31,代码来源:GetTax.php

示例10: contactParser

function contactParser($data)
{
    $contact = new Contact();
    if (isset($data['id'])) {
        $contact->setId($data['id']);
    }
    if (isset($data['firstName'])) {
        $contact->setFirstName($data['firstName']);
    }
    if (isset($data['name'])) {
        $contact->setName($data['name']);
    }
    if (isset($data['mail'])) {
        $contact->setMail($data['mail']);
    }
    if (isset($data['phone'])) {
        $contact->setPhone($data['phone']);
    }
    if (isset($data['phone2'])) {
        $contact->setPhone2($data['phone2']);
    }
    if (isset($data['phone3'])) {
        $contact->setPhone3($data['phone3']);
    }
    if (isset($data['company'])) {
        $contact->setCompany($data['company']);
    }
    if (isset($data['address'])) {
        $dataAddress = $data['address'];
        $address = new Address();
        if (isset($dataAddress['id'])) {
            $address->setId($dataAddress['id']);
        }
        if (isset($dataAddress['line1'])) {
            $address->setLine1($dataAddress['line1']);
        }
        if (isset($dataAddress['line2'])) {
            $address->setLine2($dataAddress['line2']);
        }
        if (isset($dataAddress['zipCode'])) {
            $address->setZipCode($dataAddress['zipCode']);
        }
        if (isset($dataAddress['city'])) {
            $address->setCity($dataAddress['city']);
        }
        if (isset($dataAddress['latitude']) && isset($dataAddress['longitude'])) {
            $address->setLatitude($dataAddress['latitude']);
            $address->setLongitude($dataAddress['longitude']);
        } else {
            $mapService = new GoogleMapService();
            $latlng = $mapService->getLatLong($address);
            if ($latlng != [] && sizeof($latlng) == 2) {
                $address->setLatitude($latlng[0]);
                $address->setLongitude($latlng[1]);
            }
        }
        $contact->setAddress($address);
    }
    if (isset($data['type'])) {
        if (isset($data['type']['id']) && isset($data['type']['name'])) {
            $type = new Type($data['type']['id'], $data['type']['name']);
        } elseif (isset($data['type']['name'])) {
            $type = new Type(null, $data['type']['name']);
        } else {
            $type = null;
        }
        $contact->setType($type);
    }
    if (isset($data['exchangeId'])) {
        $contact->setExchangeId($data['exchangeId']);
    }
    return $contact;
}
开发者ID:alex148,项目名称:SmartMastore,代码行数:73,代码来源:index.php

示例11: CalcTax

function CalcTax($taxSvcSoapClient, $companyCode)
{
    $request = new GetTaxRequest();
    $origin = new Address();
    $destination = new Address();
    $line1 = new Line();
    $origin->setLine1("435 Ericksen Ave NE");
    $origin->setLine2("Suite 200");
    $origin->setCity("Bainbridge Island");
    $origin->setRegion("WA");
    $origin->setPostalCode("98110-1896");
    $destination->setLine1("900 Winslow Way");
    $destination->setLine2("Suite 200");
    $destination->setCity("Bainbridge Island");
    $destination->setRegion("WA");
    $destination->setPostalCode("98110");
    $request->setOriginAddress($origin);
    //Address
    $request->setDestinationAddress($destination);
    //Address
    $request->setCompanyCode($companyCode);
    // Your Company Code From the Dashboard
    $request->setDocType(DocumentType::$SalesInvoice);
    // Only supported types are SalesInvoice or SalesOrder
    $dateTime = new DateTime();
    $docCode = "PHPSample" . date_format($dateTime, "dmyGis");
    $request->setDocCode($docCode);
    //    invoice number
    $request->setDocDate(date_format($dateTime, "Y-m-d"));
    //date
    $request->setSalespersonCode("");
    // string Optional
    $request->setCustomerCode("Cust123");
    //string Required
    $request->setCustomerUsageType("");
    //string   Entity Usage
    $request->setDiscount(0.0);
    //decimal
    $request->setPurchaseOrderNo("");
    //string Optional
    $request->setExemptionNo("");
    //string   if not using ECMS which keys on customer code
    $request->setDetailLevel(DetailLevel::$Document);
    $request->setCommit("true");
    // commit upon tax calc
    $request->setReferenceCode("");
    //string Optional
    $request->setLocationCode("");
    //string Optional - aka outlet id for tax forms
    $line1->setNo("1");
    //string  // line Number of invoice
    $line1->setItemCode("SKU123");
    //string
    $line1->setDescription("Invoice Calculated From PHP SDK");
    //string
    $line1->setTaxCode("");
    //string
    $line1->setQty(1.0);
    //decimal
    $line1->setAmount(1000.0);
    //decimal // TotalAmmount
    $line1->setDiscounted(false);
    //boolean
    $line1->setRevAcct("");
    //string
    $line1->setRef1("");
    //string
    $line1->setRef2("");
    //string
    $line1->setExemptionNo("");
    //string
    $line1->setCustomerUsageType("");
    //string
    $request->setLines(array($line1));
    //array
    try {
        $getTaxResult = $taxSvcSoapClient->getTax($request);
        echo 'GetTax Result: ' . $getTaxResult->getResultCode() . "\n";
        if ($getTaxResult->getResultCode() == SeverityLevel::$Success) {
            echo "DocCode: " . $request->getDocCode() . "\n";
            echo "TotalAmount: " . $getTaxResult->getTotalAmount() . "\n";
            echo "TotalTax: " . $getTaxResult->getTotalTax() . "\n";
        } else {
            foreach ($getTaxResult->getMessages() as $msg) {
                echo $msg->getName() . ": " . $msg->getSummary() . "\n";
            }
        }
    } catch (SoapFault $exception) {
        $msg = "Exception: ";
        if ($exception) {
            $msg .= $exception->faultstring;
        }
        echo $msg . "\n";
        echo $taxSvcSoapClient->__getLastRequest() . "\n";
        echo $taxSvcSoapClient->__getLastResponse() . "\n";
    }
    return $request->getDocCode();
}
开发者ID:vijaynalawade-avalara,项目名称:AvaTax-SOAP-PHP-SDK,代码行数:98,代码来源:AdjustTax.php

示例12: buildInquireMapping

 private function buildInquireMapping($xml)
 {
     $inquireMapping = new InquireMapping();
     $inquireMapping->setRequestId((string) $xml->RequestId);
     $mappings = new Mappings();
     $mappingArray = array();
     foreach ($xml->Mappings->Mapping as $mapping) {
         $tmpMapping = new Mapping();
         $tmpMapping->setMappingId((string) $mapping->MappingId);
         $tmpMapping->setSubscriberId((string) $mapping->SubscriberId);
         $tmpMapping->setAccountUsage((string) $mapping->AccountUsage);
         $tmpMapping->setDefaultIndicator((string) $mapping->DefaultIndicator);
         $tmpMapping->setAlias((string) $mapping->Alias);
         $tmpMapping->setICA((string) $mapping->ICA);
         $tmpMapping->setAccountNumber((string) $mapping->AccountNumber);
         $tmpCardholderFullName = new CardholderFullName();
         $cardholderFullName = $mapping->CardholderFullName;
         $tmpCardholderFullName->setCardholderFirstName((string) $cardholderFullName->CardholderFirstName);
         $tmpCardholderFullName->setCardholderMiddleName((string) $cardholderFullName->CardholderMiddleName);
         $tmpCardholderFullName->setCardholderLastName((string) $cardholderFullName->CardholderLastName);
         $tmpAddress = new Address();
         $address = $mapping->Address;
         $tmpAddress->setLine1((string) $address->line1);
         $tmpAddress->setLine2((string) $address->line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setCountrySubdivision((string) $address->CountrySubdivision);
         $tmpAddress->setPostalCode((string) $address->PostalCode);
         $tmpAddress->setCountry((string) $address->Country);
         $tmpReceivingEligibility = new ReceivingEligibility();
         $receivingEligibility = $mapping->ReceivingEligibility;
         $tmpReceivingEligibility->setEligible((string) $receivingEligibility->Eligible);
         $tmpCurrency = new Currency();
         $currency = $receivingEligibility->Currency;
         $tmpCurrency->setAlphaCurrencyCode((string) $currency->AlphaCurrencyCode);
         $tmpCurrency->setNumericCurrencyCode((string) $currency->NumericCurrencyCode);
         $tmpCountry = new Country();
         $country = $receivingEligibility->Country;
         $tmpCountry->setAlphaCountryCode((string) $country->AlphaCountryCode);
         $tmpCountry->setAlphaCountryCode((string) $country->NumericCountryCode);
         $tmpBrand = new Brand();
         $brand = $receivingEligibility->Brand;
         $tmpBrand->setAcceptanceBrandCode((string) $brand->AcceptanceBrandCode);
         $tmpBrand->setProductBrandCode((string) $brand->ProductBrandCode);
         $tmpMapping->setExpiryDate((string) $mapping->ExpiryDate);
         $tmpReceivingEligibility->setCurrency($tmpCurrency);
         $tmpReceivingEligibility->setCountry($tmpCountry);
         $tmpReceivingEligibility->setBrand($tmpBrand);
         $tmpMapping->setCardholderFullName($tmpCardholderFullName);
         $tmpMapping->setAddress($tmpAddress);
         $tmpMapping->setReceivingEligibility($tmpReceivingEligibility);
         array_push($mappingArray, $tmpMapping);
     }
     $mappings->setMapping($mappingArray);
     $inquireMapping->setMappings($mappings);
     return $inquireMapping;
 }
开发者ID:payene,项目名称:mastercard-api-php,代码行数:56,代码来源:CardMappingService.php

示例13: CreateTaxRequestForBINo

 private function CreateTaxRequestForBINo($bino)
 {
     $request = new GetTaxRequest();
     //Set origin Address
     $origin = new Address();
     $origin->setLine1("Avalara");
     $origin->setLine2("900 winslow way");
     $origin->setLine3("Suite 100");
     $origin->setCity("Bainbridge Island");
     $origin->setRegion("WA");
     $origin->setPostalCode("98110-1896");
     $origin->setCountry("USA");
     $request->setOriginAddress($origin);
     //Set destination address
     $destination = new Address();
     $destination->setLine1("3130 Elliott");
     $destination->setCity("Seattle");
     $destination->setRegion("WA");
     $destination->setPostalCode("98121");
     $destination->setCountry("USA");
     $request->setDestinationAddress($destination);
     //Set line
     $line = new Line();
     $line->setNo("1");
     //string  // line Number of invoice
     $line->setBusinessIdentificationNo("LL123");
     $line->setItemCode("Item123");
     //string
     $line->setQty(1.0);
     //decimal
     $line->setAmount(1010.0);
     $request->setLines(array($line));
     $request->setCompanyCode('DEFAULT');
     // Your Company Code From the Dashboard
     $request->setDocCode("DocTypeTest");
     $request->setBusinessIdentificationNo($bino);
     $request->setDocDate(date_format(new DateTime(), "Y-m-d"));
     $request->setCustomerCode("TaxSvcTest");
     //string Required
     $request->setSalespersonCode("");
     // string Optional
     $request->setDetailLevel(DetailLevel::$Tax);
     //Summary or Document or Line or Tax or Diagnostic
     return $request;
 }
开发者ID:vijaynalawade-avalara,项目名称:AvaTax-SOAP-PHP-SDK,代码行数:45,代码来源:TaxSvcTest.php

示例14: _newAddress

 /**
  * Generic address maker
  *
  * @param string $line1
  * @param string $line2
  * @param string $city
  * @param string $state
  * @param string $zip
  * @param string $country
  * @return Address
  */
 protected function _newAddress($line1, $line2, $city, $state, $zip, $country = 'USA')
 {
     // force string type because hash key generation uses serialize() in Estimate.php
     $address = new Address();
     $address->setLine1((string) $line1);
     $address->setLine2((string) $line2);
     $address->setCity((string) $city);
     $address->setRegion((string) $state);
     $address->setPostalCode((string) $zip);
     $address->setCountry((string) $country);
     return $address;
 }
开发者ID:boostmagento,项目名称:avatax,代码行数:23,代码来源:Abstract.php

示例15: buildFromJSON

 /**
  * 
  * Builds and Returns an Address object based off of the JSON input.
  * 
  * @param vo_json   JSON representation of an address
  * @return  the Address
  * @throws JSONException  if the json is not properly formatted
  */
 static function buildFromJSON($o_data)
 {
     $o_instance = new Address();
     if ($o_data != NULL) {
         if (array_key_exists("address_name", $o_data)) {
             $o_instance->setName($o_data['address_name']);
         }
         if (array_key_exists("address_line1", $o_data)) {
             $o_instance->setLine1($o_data['address_line1']);
         }
         if (array_key_exists("address_line2", $o_data)) {
             $o_instance->setLine2($o_data['address_line2']);
         }
         if (array_key_exists("address_city", $o_data)) {
             $o_instance->setCity($o_data['address_city']);
         }
         if (array_key_exists("address_state", $o_data)) {
             $o_instance->setState($o_data['address_state']);
         }
         if (array_key_exists("address_zipcode", $o_data)) {
             $o_instance->setZipcode($o_data['address_zipcode']);
         }
         if (array_key_exists("address_country", $o_data)) {
             $o_instance->setCountry($o_data['address_country']);
         }
     }
     return $o_instance;
 }
开发者ID:omusico,项目名称:RentSquare,代码行数:36,代码来源:Address.php


注:本文中的Address::setLine2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。