本文整理汇总了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());
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例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
示例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;
}