私がやろうとしていることは次のとおりです... CLASS FILEを他のクラスの1つに含めてから、次のことを行います:
$zSubscription = new zSubscription();
$zSubscription->Account->AccountNumber = "ABCD-230948";
$zSubscription->BillToContact->Address1= "123 Dirt Lane Road";
$this->createContact($zSubscription);
public function createContact($subscriptionObj){
if (strlen($subscriptionObj->Account->AccountNumber) > 10){
// Do something special
echo "Batch Processing<br />";
if ($subscriptionObj->Account->Batch == "Batch1"){
echo "Running Batch 1";
}
}
}
BATCH1 を設定する必要があります (これが期待される結果です)。現在は設定されていません。
require_once 経由でインクルードされるクラス ファイルは次のとおりです。
/**
* Zuora Definition Class
* @author Will H
* @license MIT
*/
class Account{
/** @var string */
public $AccountNumber = null;
/** @var bool */
public $AllowInvoiceEdit = true;
/** @var bool */
public $AutoPay = true;
/** @var string */
public $Batch = "Batch1";
/** @var string */
public $BcdSettingOption = "ManualSet";
/** @var int */
public $BillCycleDay = 31;
/** @var string */
public $CrmId;
/** @var string */
public $Currency = "USD";
/** @var string */
public $CustomerServiceRepName = "Online Order";
/** @var string */
public $Name;
/** @var string */
public $PaymentTerm = "Due Upon Receipt";
/** @var string */
public $PurchaseOrderNumber = null;
/** @var string */
public $SalesRepName = "Online Order";
}
class PaymentMethod{
/** @var string */
public $CreditCardAddress1;
/** @var string */
public $CreditCardAddress2;
/** @var string */
public $CreditCardCity;
/** @var string */
public $CreditCardCountry;
/** @var int */
public $CreditCardExpirationMonth;
/** @var int */
public $CreditCardExpirationYear;
/** @var string */
public $CreditCardHolderName;
/** @var string */
public $CreditCardNumber;
/** @var string */
public $CreditCardPostalCode;
/** @var string */
public $CreditCardState;
/** @var string */
public $CreditCardType;
/** @var string */
public $Type = 'CreditCard';
}
class BillToContact{
/** @var string */
public $Address1;
/** @var string */
public $Address2;
/** @var string */
public $City;
/** @var string */
public $Country;
/** @var string */
public $FirstName;
/** @var string */
public $LastName;
/** @var string */
public $PostalCode;
/** @var string */
public $State;
/** @var string */
public $WorkEmail;
/** @var string */
public $WorkPhone;
}
class SubscribeOptions{
/** @var bool */
public $GenerateInvoice = true;
/** @var bool */
public $ProcessPayments = true;
}
class Subscription{
/** @var bool */
public $AutoRenew = true;
/** @var string */
public $ContractAcceptanceDate;
/** @var string */
public $ContractEffectiveDate;
/** @var int */
public $InitialTerm = 12;
/** @var int */
public $RenewalTerm = 12;
/** @var string */
public $ServiceActivationDate;
/** @var string */
public $TermStartDate;
}
class RatePlan{
/** @var string */
public $ProductRatePlanId;
}
class RatePlanData{
/** @var RatePlan */
public $RatePlan;
}
class SubscriptionData{
/** @var Subscription */
public $Subscription;
/** @var RatePlanData */
public $RatePlanData;
}
class zSubscription{
/** @var Account */
public $Account;
/** @var PaymentMethod */
public $PaymentMethod;
/** @var BillToContact */
public $BillToContact;
/** @var SubscribeOptions */
public $SubscribeOptions;
/** @var SubscriptionData */
public $SubscriptionData;
}
?>