protected function _initialize($disbursementAttribs) { $this->_attributes = $disbursementAttribs; $this->merchantAccountDetails = $disbursementAttribs['merchantAccount']; if (isset($disbursementAttribs['merchantAccount'])) { $this->_set('merchantAccount', MerchantAccount::factory($disbursementAttribs['merchantAccount'])); } }
protected function _initialize($attribs) { $this->_attributes = $attribs; $merchantAccountArray = []; if (isset($attribs['merchantAccounts'])) { foreach ($attribs['merchantAccounts'] as $merchantAccount) { $merchantAccountArray[] = MerchantAccount::factory($merchantAccount); } } $this->_set('merchantAccounts', $merchantAccountArray); }
private function _verifyGatewayResponse($response) { if (isset($response['merchantAccount'])) { // return a populated instance of merchantAccount return new Result\Successful(MerchantAccount::factory($response['merchantAccount'])); } else { if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected("Expected merchant account or apiErrorResponse"); } } }
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']); } }