本文整理汇总了PHP中Subscription::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscription::factory方法的具体用法?PHP Subscription::factory怎么用?PHP Subscription::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscription
的用法示例。
在下文中一共展示了Subscription::factory方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initialize
/**
* sets instance properties from an array of values
*
* @access protected
* @param array $venmoAccountAttribs array of Venmo account properties
* @return void
*/
protected function _initialize($venmoAccountAttribs)
{
$this->_attributes = $venmoAccountAttribs;
$subscriptionArray = array();
if (isset($venmoAccountAttribs['subscriptions'])) {
foreach ($venmoAccountAttribs['subscriptions'] as $subscription) {
$subscriptionArray[] = Subscription::factory($subscription);
}
}
$this->_set('subscriptions', $subscriptionArray);
}
示例2: _initialize
/**
* sets instance properties from an array of values
*
* @access protected
* @param array $amexExpressCheckoutCardAttribs array of Amex Express Checkout card properties
* @return void
*/
protected function _initialize($amexExpressCheckoutCardAttribs)
{
// set the attributes
$this->_attributes = $amexExpressCheckoutCardAttribs;
$subscriptionArray = [];
if (isset($amexExpressCheckoutCardAttribs['subscriptions'])) {
foreach ($amexExpressCheckoutCardAttribs['subscriptions'] as $subscription) {
$subscriptionArray[] = Subscription::factory($subscription);
}
}
$this->_set('subscriptions', $subscriptionArray);
}
示例3: _initialize
/**
* sets instance properties from an array of values
*
* @access protected
* @param array $androidPayCardAttribs array of Android Pay card properties
* @return none
*/
protected function _initialize($androidPayCardAttribs)
{
// set the attributes
$this->_attributes = $androidPayCardAttribs;
$subscriptionArray = array();
if (isset($androidPayCardAttribs['subscriptions'])) {
foreach ($androidPayCardAttribs['subscriptions'] as $subscription) {
$subscriptionArray[] = Subscription::factory($subscription);
}
}
$this->_set('subscriptions', $subscriptionArray);
}
示例4: _initialize
/**
* sets instance properties from an array of values
*
* @access protected
* @param array $coinbaseAccountAttribs array of coinbaseAccount data
* @return void
*/
protected function _initialize($coinbaseAccountAttribs)
{
// set the attributes
$this->_attributes = $coinbaseAccountAttribs;
$subscriptionArray = [];
if (isset($coinbaseAccountAttribs['subscriptions'])) {
foreach ($coinbaseAccountAttribs['subscriptions'] as $subscription) {
$subscriptionArray[] = Subscription::factory($subscription);
}
}
$this->_set('subscriptions', $subscriptionArray);
}
示例5: _initialize
/**
* sets instance properties from an array of values
*
* @access protected
* @param array $applePayCardAttribs array of Apple Pay card properties
* @return none
*/
protected function _initialize($applePayCardAttribs)
{
// set the attributes
$this->_attributes = $applePayCardAttribs;
$subscriptionArray = array();
if (isset($applePayCardAttribs['subscriptions'])) {
foreach ($applePayCardAttribs['subscriptions'] as $subscription) {
$subscriptionArray[] = Subscription::factory($subscription);
}
}
$this->_set('subscriptions', $subscriptionArray);
$this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear);
}
示例6: _initialize
protected function _initialize($attributes)
{
$this->_attributes = $attributes;
if (isset($attributes['subject']['apiErrorResponse'])) {
$wrapperNode = $attributes['subject']['apiErrorResponse'];
} else {
$wrapperNode = $attributes['subject'];
}
if (isset($wrapperNode['subscription'])) {
$this->_set('subscription', Subscription::factory($attributes['subject']['subscription']));
}
if (isset($wrapperNode['merchantAccount'])) {
$this->_set('merchantAccount', MerchantAccount::factory($wrapperNode['merchantAccount']));
}
if (isset($wrapperNode['transaction'])) {
$this->_set('transaction', Transaction::factory($wrapperNode['transaction']));
}
if (isset($wrapperNode['disbursement'])) {
$this->_set('disbursement', Disbursement::factory($wrapperNode['disbursement']));
}
if (isset($wrapperNode['partnerMerchant'])) {
$this->_set('partnerMerchant', PartnerMerchant::factory($wrapperNode['partnerMerchant']));
}
if (isset($wrapperNode['dispute'])) {
$this->_set('dispute', Dispute::factory($wrapperNode['dispute']));
}
if (isset($wrapperNode['accountUpdaterDailyReport'])) {
$this->_set('accountUpdaterDailyReport', AccountUpdaterDailyReport::factory($wrapperNode['accountUpdaterDailyReport']));
}
if (isset($wrapperNode['errors'])) {
$this->_set('errors', new Error\ValidationErrorCollection($wrapperNode['errors']));
$this->_set('message', $wrapperNode['message']);
}
}
示例7: _initialize
/**
* sets instance properties from an array of values
*
* @access protected
* @param array $creditCardAttribs array of creditcard data
* @return none
*/
protected function _initialize($creditCardAttribs)
{
// set the attributes
$this->_attributes = $creditCardAttribs;
// map each address into its own object
$billingAddress = isset($creditCardAttribs['billingAddress']) ? Address::factory($creditCardAttribs['billingAddress']) : null;
$subscriptionArray = array();
if (isset($creditCardAttribs['subscriptions'])) {
foreach ($creditCardAttribs['subscriptions'] as $subscription) {
$subscriptionArray[] = Subscription::factory($subscription);
}
}
$this->_set('subscriptions', $subscriptionArray);
$this->_set('billingAddress', $billingAddress);
$this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear);
$this->_set('maskedNumber', $this->bin . '******' . $this->last4);
if (isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) {
$verifications = $creditCardAttribs['verifications'];
usort($verifications, array($this, '_compareCreatedAtOnVerifications'));
$this->_set('verification', CreditCardVerification::factory($verifications[0]));
}
}