本文整理汇总了PHP中Transaction::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::factory方法的具体用法?PHP Transaction::factory怎么用?PHP Transaction::factory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::factory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _doTestRequest
private function _doTestRequest($testPath, $transactionId)
{
self::_checkEnvironment();
$path = $this->_config->merchantPath() . '/transactions/' . $transactionId . $testPath;
$response = $this->_http->put($path);
return Transaction::factory($response['transaction']);
}
示例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
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']);
}
}