def md5_hash_is_valid?(json)
      if AuthNetReceiver.config.hash_value.nil? || AuthNetReceiver.config.gateway_login.nil?
        raise StandardError, 'AuthNetReceiver hash_value and gateway_login cannot be nil!'
      end
      parts = []
      parts << AuthNetReceiver.config.hash_value
      parts << AuthNetReceiver.config.gateway_login if json['x_subscription_id'].blank?
      parts << json['x_trans_id']
      parts << json['x_amount']
      hash = Digest::MD5.hexdigest(parts.join()).upcase
      return hash == json['x_MD5_Hash']
    end
def md5_hash_is_valid?(json)
      if AuthNetReceiver.config.hash_value.nil? || AuthNetReceiver.config.gateway_login.nil?
        raise StandardError, 'AuthNetReceiver hash_value and gateway_login cannot be nil!'
      end
      parts = []
      parts << AuthNetReceiver.config.hash_value
      parts << AuthNetReceiver.config.gateway_login if json['x_subscription_id'].blank?
      parts << json['x_trans_id']
      parts << json['x_amount']
      hash = Digest::MD5.hexdigest(parts.join()).upcase
      return hash == json['x_MD5_Hash']
    end
Check that the x_MD5_Hash value matches our expectations

 The formula for the hash differs for subscription vs regular transactions. Regular transactions
 will be associated with the gateway ID that was used in the originating API call. Subscriptions
 however are ran on the server at later date, and therefore will not be associated to a gateway ID.

 * Subscriptions: MD5 Digest(AUTH_NET_HASH_VAL + TRANSACTION_ID + TRANSACTION_AMOUNT)
 * Other Transactions: MD5 Digest(AUTH_NET_HASH_VAL + GATEWAY_LOGIN + TRANSACTION_ID + TRANSACTION_AMOUNT)