Ejemplo n.º 1
0
 /**
  * Check if specified Merchant Account Id is correct
  * 
  * @return boolean
  */
 protected function _checkMerchantAccountId()
 {
     $storeId = null;
     if (Mage::app()->getStore()->isAdmin()) {
         $quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
         $storeId = $quote->getStoreId();
     }
     $merchantAccountId = Mage::getStoreConfig('payment/braintree/merchant_account_id', $storeId);
     try {
         Braintree_MerchantAccount::find($merchantAccountId);
         $result = true;
     } catch (Exception $e) {
         $result = false;
     }
     return $result;
 }
Ejemplo n.º 2
0
 function testFind_throwsIfNotFound()
 {
     $this->setExpectedException('Braintree_Exception_NotFound', 'merchant account with id does-not-exist not found');
     Braintree_MerchantAccount::find('does-not-exist');
 }