Method: Spree::PaymentMethod::SimpleBogusCreditCard#authorize

Defined in:
app/models/spree/payment_method/simple_bogus_credit_card.rb

#authorize(_money, credit_card, _options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'app/models/spree/payment_method/simple_bogus_credit_card.rb', line 10

def authorize(_money, credit_card, _options = {})
  message_detail = " - #{__method__}"

  if VALID_CCS.include? credit_card.number
    ActiveMerchant::Billing::Response.new(true, SUCCESS_MESSAGE + message_detail, {}, test: true, authorization: AUTHORIZATION_CODE, avs_result: { code: 'A' })
  else
    ActiveMerchant::Billing::Response.new(false, FAILURE_MESSAGE + message_detail, { message: FAILURE_MESSAGE }, test: true)
  end
end