本文整理汇总了PHP中Discount::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Discount::factory方法的具体用法?PHP Discount::factory怎么用?PHP Discount::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Discount
的用法示例。
在下文中一共展示了Discount::factory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initialize
protected function _initialize($attributes)
{
$this->_attributes = $attributes;
$addOnArray = [];
if (isset($attributes['addOns'])) {
foreach ($attributes['addOns'] as $addOn) {
$addOnArray[] = AddOn::factory($addOn);
}
}
$this->_attributes['addOns'] = $addOnArray;
$discountArray = [];
if (isset($attributes['discounts'])) {
foreach ($attributes['discounts'] as $discount) {
$discountArray[] = Discount::factory($discount);
}
}
$this->_attributes['discounts'] = $discountArray;
$planArray = [];
if (isset($attributes['plans'])) {
foreach ($attributes['plans'] as $plan) {
$planArray[] = self::factory($plan);
}
}
$this->_attributes['plans'] = $planArray;
}
示例2: _initialize
/**
* @ignore
*/
protected function _initialize($attributes)
{
$this->_attributes = $attributes;
$addOnArray = [];
if (isset($attributes['addOns'])) {
foreach ($attributes['addOns'] as $addOn) {
$addOnArray[] = AddOn::factory($addOn);
}
}
$this->_attributes['addOns'] = $addOnArray;
$discountArray = [];
if (isset($attributes['discounts'])) {
foreach ($attributes['discounts'] as $discount) {
$discountArray[] = Discount::factory($discount);
}
}
$this->_attributes['discounts'] = $discountArray;
if (isset($attributes['descriptor'])) {
$this->_set('descriptor', new Descriptor($attributes['descriptor']));
}
$statusHistory = [];
if (isset($attributes['statusHistory'])) {
foreach ($attributes['statusHistory'] as $history) {
$statusHistory[] = new Subscription\StatusDetails($history);
}
}
$this->_attributes['statusHistory'] = $statusHistory;
$transactionArray = [];
if (isset($attributes['transactions'])) {
foreach ($attributes['transactions'] as $transaction) {
$transactionArray[] = Transaction::factory($transaction);
}
}
$this->_attributes['transactions'] = $transactionArray;
}
示例3: _initialize
/**
* sets instance properties from an array of values
*
* @ignore
* @access protected
* @param array $transactionAttribs array of transaction data
* @return void
*/
protected function _initialize($transactionAttribs)
{
$this->_attributes = $transactionAttribs;
if (isset($transactionAttribs['applePay'])) {
$this->_set('applePayCardDetails', new Transaction\ApplePayCardDetails($transactionAttribs['applePay']));
}
if (isset($transactionAttribs['androidPayCard'])) {
$this->_set('androidPayCardDetails', new Transaction\AndroidPayCardDetails($transactionAttribs['androidPayCard']));
}
if (isset($transactionAttribs['amexExpressCheckoutCard'])) {
$this->_set('amexExpressCheckoutCardDetails', new Transaction\AmexExpressCheckoutCardDetails($transactionAttribs['amexExpressCheckoutCard']));
}
if (isset($transactionAttribs['venmoAccount'])) {
$this->_set('venmoAccountDetails', new Transaction\VenmoAccountDetails($transactionAttribs['venmoAccount']));
}
if (isset($transactionAttribs['creditCard'])) {
$this->_set('creditCardDetails', new Transaction\CreditCardDetails($transactionAttribs['creditCard']));
}
if (isset($transactionAttribs['coinbaseAccount'])) {
$this->_set('coinbaseDetails', new Transaction\CoinbaseDetails($transactionAttribs['coinbaseAccount']));
}
if (isset($transactionAttribs['europeBankAccount'])) {
$this->_set('europeBankAccount', new Transaction\EuropeBankAccountDetails($transactionAttribs['europeBankAccount']));
}
if (isset($transactionAttribs['usBankAccount'])) {
$this->_set('usBankAccount', new Transaction\UsBankAccountDetails($transactionAttribs['usBankAccount']));
}
if (isset($transactionAttribs['paypal'])) {
$this->_set('paypalDetails', new Transaction\PayPalDetails($transactionAttribs['paypal']));
}
if (isset($transactionAttribs['customer'])) {
$this->_set('customerDetails', new Transaction\CustomerDetails($transactionAttribs['customer']));
}
if (isset($transactionAttribs['billing'])) {
$this->_set('billingDetails', new Transaction\AddressDetails($transactionAttribs['billing']));
}
if (isset($transactionAttribs['shipping'])) {
$this->_set('shippingDetails', new Transaction\AddressDetails($transactionAttribs['shipping']));
}
if (isset($transactionAttribs['subscription'])) {
$this->_set('subscriptionDetails', new Transaction\SubscriptionDetails($transactionAttribs['subscription']));
}
if (isset($transactionAttribs['descriptor'])) {
$this->_set('descriptor', new Descriptor($transactionAttribs['descriptor']));
}
if (isset($transactionAttribs['disbursementDetails'])) {
$this->_set('disbursementDetails', new DisbursementDetails($transactionAttribs['disbursementDetails']));
}
$disputes = [];
if (isset($transactionAttribs['disputes'])) {
foreach ($transactionAttribs['disputes'] as $dispute) {
$disputes[] = Dispute::factory($dispute);
}
}
$this->_set('disputes', $disputes);
$statusHistory = [];
if (isset($transactionAttribs['statusHistory'])) {
foreach ($transactionAttribs['statusHistory'] as $history) {
$statusHistory[] = new Transaction\StatusDetails($history);
}
}
$this->_set('statusHistory', $statusHistory);
$addOnArray = [];
if (isset($transactionAttribs['addOns'])) {
foreach ($transactionAttribs['addOns'] as $addOn) {
$addOnArray[] = AddOn::factory($addOn);
}
}
$this->_set('addOns', $addOnArray);
$discountArray = [];
if (isset($transactionAttribs['discounts'])) {
foreach ($transactionAttribs['discounts'] as $discount) {
$discountArray[] = Discount::factory($discount);
}
}
$this->_set('discounts', $discountArray);
if (isset($transactionAttribs['riskData'])) {
$this->_set('riskData', RiskData::factory($transactionAttribs['riskData']));
}
if (isset($transactionAttribs['threeDSecureInfo'])) {
$this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($transactionAttribs['threeDSecureInfo']));
}
if (isset($transactionAttribs['facilitatorDetails'])) {
$this->_set('facilitatorDetails', FacilitatorDetails::factory($transactionAttribs['facilitatorDetails']));
}
}