You are here

private static function Braintree_SettlementBatchSummary::_verifyGatewayResponse in Commerce Braintree 7

1 call to Braintree_SettlementBatchSummary::_verifyGatewayResponse()
Braintree_SettlementBatchSummary::generate in braintree_php/lib/Braintree/SettlementBatchSummary.php

File

braintree_php/lib/Braintree/SettlementBatchSummary.php, line 40

Class

Braintree_SettlementBatchSummary

Code

private static function _verifyGatewayResponse($response) {
  if (isset($response['settlementBatchSummary'])) {
    return new Braintree_Result_Successful(self::factory($response['settlementBatchSummary']));
  }
  else {
    if (isset($response['apiErrorResponse'])) {
      return new Braintree_Result_Error($response['apiErrorResponse']);
    }
    else {
      throw new Braintree_Exception_Unexpected("Expected settlementBatchSummary or apiErrorResponse");
    }
  }
}