Module: Api::Vendor::V1::Concerns::TicketTransactionHelpers

Extended by:
ActiveSupport::Concern
Included in:
Dianping::Concerns::OrderErrorResponses
Defined in:
app/controllers/api/vendor/v1/concerns/ticket_transaction_helpers.rb

Overview

typed: ignore frozen_string_literal: true

Constant Summary collapse

SKIP_ERROR_PHRASES =
[
  'Sorry, the quantity is not sufficient.',
  'voucher sales quantity, has reached the limit.',
  'vouchers have been sold.',
  'vouchers have been fully booked.',
  'vouchers have limited quantity'
].freeze

Instance Method Summary collapse

Instance Method Details

#skip_reporting_error?(message) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/controllers/api/vendor/v1/concerns/ticket_transaction_helpers.rb', line 15

def skip_reporting_error?(message)
  SKIP_ERROR_PHRASES.any? { |phrase| message.to_s.include?(phrase) }
end