def balance
      return nil unless @access_token

      begin
        @timestamp = Time.now.iso8601(3)
        @relative_url = "/banking/v3/corporates/#{@corporate_id}/accounts/#{@account_number}"
        response = RestClient.get("#{@base_url}#{@relative_url}",
          "Content-Type": 'application/json',
          "Authorization": "Bearer #{@access_token}",
          "Origin": @domain,
          "X-BCA-Key": @api_key,
          "X-BCA-Timestamp":  @timestamp,
          "X-BCA-Signature": signature)

        data = JSON.parse response.body
        if account_detail_success = data['AccountDetailDataSuccess']
          detail = account_detail_success.first
            attribute = {
              account_number: detail['AccountNumber'],
              currency: detail['Currency'],
              balance: detail['Balance'].to_f,
              available_balance: detail['AvailableBalance'].to_f,
              float_amount: detail['FloatAmount'].to_f,
              hold_amount: detail['HoldAmount'].to_f,
              plafon: detail['Plafon'].to_f
            }
          BcaStatement::Entities::Balance.new(attribute)
      
        else
          return nil
        end
      rescue RestClient::ExceptionWithResponse => err
        return nil
      end 
    end
def balance
      return nil unless @access_token

      begin
        @timestamp = Time.now.iso8601(3)
        @relative_url = "/banking/v3/corporates/#{@corporate_id}/accounts/#{@account_number}"
        response = RestClient.get("#{@base_url}#{@relative_url}",
          "Content-Type": 'application/json',
          "Authorization": "Bearer #{@access_token}",
          "Origin": @domain,
          "X-BCA-Key": @api_key,
          "X-BCA-Timestamp":  @timestamp,
          "X-BCA-Signature": signature)

        data = JSON.parse response.body
        if account_detail_success = data['AccountDetailDataSuccess']
          detail = account_detail_success.first
            attribute = {
              account_number: detail['AccountNumber'],
              currency: detail['Currency'],
              balance: detail['Balance'].to_f,
              available_balance: detail['AvailableBalance'].to_f,
              float_amount: detail['FloatAmount'].to_f,
              hold_amount: detail['HoldAmount'].to_f,
              plafon: detail['Plafon'].to_f
            }
          BcaStatement::Entities::Balance.new(attribute)
      
        else
          return nil
        end
      rescue RestClient::ExceptionWithResponse => err
        return nil
      end 
    end
Get your BCA Bisnis account balance information