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


PHP Address::setName方法代码示例

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


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

示例1: testapi

 public function testapi()
 {
     $o_bcpc = new BaseCommerceClient(RENTSQUARE_MERCH_USER, RENTSQUARE_MERCH_PASS, RENTSQUARE_MERCH_KEY);
     $o_bcpc->setSandbox(BC_SANDBOXVALUE);
     $o_address = new Address();
     $o_address->setName(Address::$XS_ADDRESS_NAME_BILLING);
     $o_address->setLine1("123 Some Address");
     $o_address->setCity("Tempe");
     $o_address->setState("AZ");
     $o_address->setZipcode("12345");
     $o_bc = new BankCard();
     $o_bc->setBillingAddress($o_address);
     $o_bc->setExpirationMonth("02");
     $o_bc->setExpirationYear("2015");
     $o_bc->setName("Nick 2");
     $o_bc->setNumber("4111111111111111");
     $o_bc->setToken("myToken12asdfas3");
     $o_bc = $o_bcpc->addBankCard($o_bc);
     if ($o_bc->isStatus(BankCard::$XS_BC_STATUS_FAILED)) {
         //the add Failed, look at messages array for reason(s) why
         //var_dump( $o_bc->getMessages() );
         $this->set('message', $o_bc->getMessages());
     } else {
         if ($o_bc->isStatus(BankCard::$XS_BC_STATUS_ACTIVE)) {
             //Card added successfully
             //var_dump( $o_bc->getToken() );
             $this->set('message', $o_bc->getToken());
         }
     }
 }
开发者ID:veslo1,项目名称:RentSquare,代码行数:30,代码来源:PaymentMethodsController.php

示例2: create_ecp_PaymentMethod

function create_ecp_PaymentMethod()
{
    $uniqueValue = get_unique_value();
    $merchantAccountId = 'account-' . $uniqueValue;
    $merchantPaymentMethodId = 'pm-' . $uniqueValue;
    $email = get_unique_value() . '@nomail.com';
    $successUrl = 'http://good.com/';
    //need a trailing slash
    $errorUrl = 'http://bad.com/';
    //need a trailing slash
    $name = 'John Vindicia';
    $addr1 = '303 Twin Dolphin Drive';
    $city = 'Redwood City';
    $district = 'CA';
    $postalCode = '94065';
    $country = 'US';
    $address = new Address();
    $address->setName($name);
    $address->setAddr1($addr1);
    $address->setCity($city);
    $address->setDistrict($district);
    $address->setPostalCode($postalCode);
    $address->setCountry($country);
    $paymentmethod = new PaymentMethod();
    $paymentmethod->setType('ECP');
    $paymentmethod->setAccountHolderName($name);
    $paymentmethod->setBillingAddress($address);
    $paymentmethod->setMerchantPaymentMethodId($merchantPaymentMethodId);
    $paymentmethod->setCurrency('USD');
    $ecp = new ECP();
    $ecp->setAccount('495958930');
    $ecp->setRoutingNumber('611111111');
    $ecp->setAllowedTransactionType('Inbound');
    $ecp->setAccountType('ConsumerChecking');
    $paymentmethod->setECP($ecp);
    $account = new Account();
    $account->setMerchantAccountId($merchantAccountId);
    $account->setEmailAddress($email);
    $account->setShippingAddress($address);
    $account->setEmailTypePreference('html');
    $account->setName($name);
    $account->setPaymentMethods(array($paymentmethod));
    return $account;
}
开发者ID:sheller-vin,项目名称:CashBoxAPISamples,代码行数:44,代码来源:ecpAutoBill.php

示例3: create_paypal_PaymentMethod

function create_paypal_PaymentMethod()
{
    $uniqueValue = get_unique_value();
    $merchantAccountId = 'account-' . $uniqueValue;
    $merchantPaymentMethodId = 'pm-' . $uniqueValue;
    $email = get_unique_value() . '@nomail.com';
    $successUrl = 'http://good.com/';
    //need a trailing slash
    $errorUrl = 'http://bad.com/';
    //need a trailing slash
    $name = 'John Vindicia';
    $addr1 = '303 Twin Dolphin Drive';
    $city = 'Redwood City';
    $district = 'CA';
    $postalCode = '94065';
    $country = 'US';
    $address = new Address();
    $address->setName($name);
    $address->setAddr1($addr1);
    $address->setCity($city);
    $address->setDistrict($district);
    $address->setPostalCode($postalCode);
    $address->setCountry($country);
    $paymentmethod = new PaymentMethod();
    $paymentmethod->setType('PayPal');
    $paymentmethod->setAccountHolderName($name);
    $paymentmethod->setBillingAddress($address);
    $paymentmethod->setMerchantPaymentMethodId($merchantPaymentMethodId);
    $paymentmethod->setCurrency('USD');
    $paypal = new PayPal();
    $paypal->setReturnUrl($successUrl);
    $paypal->setCancelUrl($errorUrl);
    $paymentmethod->setPaypal($paypal);
    $account = new Account();
    $account->setMerchantAccountId($merchantAccountId);
    $account->setEmailAddress($email);
    $account->setShippingAddress($address);
    $account->setEmailTypePreference('html');
    $account->setName($name);
    //$account->setPaymentMethods(array($paymentmethod));
    //return $account;
    return array('account' => $account, 'paymentmethod' => $paymentmethod);
}
开发者ID:sheller-vin,项目名称:CashBoxAPISamples,代码行数:43,代码来源:paypalAutoBill.php

示例4: 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

示例5: rand

<?php

require_once 'Vindicia/Soap/Vindicia.php';
require_once 'Vindicia/Soap/Const.php';
$parentID = $argv[1];
print "parent: {$parentID} \n";
$name = "Child One";
$addr1 = "19 Davis Dr";
$city = "Belmont";
$state = "CA";
$postalcode = "94002";
$country = "US";
$email = "childAccount" . rand(10000, 99999) . "@vindicia.com";
$address = new Address();
$address->setName($name);
$address->setAddr1($addr1);
$address->setCity($city);
$address->setDistrict($state);
$address->setPostalCode($postalcode);
$address->setCountry($country);
$accountID = "childAccount" . rand(1000, 9999) . "-" . rand(1000, 999999);
$child1 = new Account();
$child1->setMerchantAccountId($accountID);
$child1->setEmailAddress($email);
$child1->setShippingAddress($address);
$child1->setEmailTypePreference('html');
$child1->setWarnBeforeAutoBilling(false);
$child1->setName($name);
$parent = new Account();
$parent->setMerchantAccountId($parentID);
// use the force flag to remove these children from a previous parent
开发者ID:sheller-vin,项目名称:CashBoxAPISamples,代码行数:31,代码来源:accountAddNewChild.php

示例6: processAddressObject

 /**
  * This function takes in an array of the address objects generated by the message headers and turns them into an
  * associative array.
  *
  * @param string $addresses
  *
  * @return Address[]
  */
 protected function processAddressObject($addresses)
 {
     $output_addresses = array();
     $decoded_addresses = imap_rfc822_parse_adrlist($addresses, null);
     if (is_array($decoded_addresses)) {
         foreach ($decoded_addresses as $address) {
             $current_address = new Address($address->mailbox . '@' . $address->host);
             if (isset($address->personal)) {
                 $current_address->setName($address->personal);
             }
             array_push($output_addresses, $current_address);
         }
     }
     return $output_addresses;
 }
开发者ID:komex,项目名称:fetch,代码行数:23,代码来源:Message.php


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