本文整理汇总了PHP中Account::setShippingAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::setShippingAddress方法的具体用法?PHP Account::setShippingAddress怎么用?PHP Account::setShippingAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account::setShippingAddress方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: CreateAccount
function CreateAccount($merchantAccountId, $email)
{
$account = new Account();
$account->setName('Migrated Customer');
$account->setMerchantAccountId($merchantAccountId);
// Be conscious that using real email addresses in ProdTest depending on configuration will
// have live emails triggered and sent on billing events for the Account.
// It is recommended that when testing in ProdTest be certain to mask real email addresses.
$account->setEmailAddress($email);
$account->setEmailTypePreference('html');
$account->setWarnBeforeAutoBilling(true);
$anyOtherHelpfulDataForCSRsWhenLookingUpAccount = new NameValuePair();
$anyOtherHelpfulDataForCSRsWhenLookingUpAccount->setName('HelpfulData');
$anyOtherHelpfulDataForCSRsWhenLookingUpAccount->setValue('BestCustomerEver');
$account->setNameValues(array($anyOtherHelpfulDataForCSRsWhenLookingUpAccount));
$address = new Address();
$address->setAddr1('303 Twin Dolphin Drive');
$address->setAddr2('Suite 200');
$address->setCity('Redwood City');
$address->setDistrict('CA');
$address->setPostalCode('94065');
$address->setCountry('US');
$address->setPhone('123-456-7890');
$srd = '';
$account->setShippingAddress($address);
$response = $account->update($srd);
// Log soap id for each API call.
// $log->addDebug('Method = Account.update' . PHP_EOL);
// $log->addDebug('Soap Id = ' . $response['data']->return->soapId . PHP_EOL);
// $log->addDebug('Return Code = ' . $response['returnCode'] . PHP_EOL);
// $log->addDebug('Return String = ' . $response['returnString'] . PHP_EOL);
if ($response['returnCode'] == 200) {
print "Call succeeded" . PHP_EOL;
} else {
print "Call failed" . PHP_EOL;
print_r($response);
}
}
示例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: rand
$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
// and assign them to this new one
//$force=true;
$force = false;
// use payerReplace to determine if any existing autobills of these children
// should use the parents payment method, or only autobills created from here in should.
//$payerReplacementBehavior='ReplaceOnAllAutoBills';
$payerReplacementBehavior = 'ReplaceOnlyFutureAutoBills';
$response = $parent->addChildren(array($child1), $force, $payerReplacementBehavior);
print_r($response);
示例5: rand
$address->setName($name);
$address->setAddr1($addr1);
$address->setCity($city);
$address->setDistrict($state);
$address->setPostalCode($postalcode);
$address->setCountry($country);
$accountID = "map-" . rand(1000, 9999) . "-" . rand(1000, 999999);
$map = new MerchantAcceptedPayment();
$pm = new PaymentMethod();
$pm->setType('MerchantAcceptedPayment');
$pm->setMerchantAcceptedPayment($map);
$pm_array = array($pm);
$account = new Account();
$account->setMerchantAccountId($accountID);
$account->setEmailAddress($email);
$account->setShippingAddress($address);
$account->setEmailTypePreference('html');
$account->setWarnBeforeAutoBilling(false);
$account->setName($name);
$account->setPaymentMethods($pm_array);
// must be an existing Product
$productID = $argv[1];
print "productID is {$productID} \n";
$product = new Product();
$product->setMerchantProductId($productID);
// AutoBills may have multiple products
// each in an AutoBillItem as an array:
$item = new AutoBillItem();
// set the Product in the AutoBillItem
$item->setProduct($product);
$item->setMerchantAutoBillItemId('myAutoBillItem-' . rand(00, 99999));