Method: ActiveMerchant::Billing::PaypalGateway#verify

Defined in:
lib/active_merchant/billing/gateways/paypal.rb

#verify(credit_card, options = {}) ⇒ Object

[View source] [View on GitHub]

26
27
28
29
30
31
32
33
34
35
# File 'lib/active_merchant/billing/gateways/paypal.rb', line 26

def verify(credit_card, options = {})
  if %w(visa master).include?(credit_card.brand)
    authorize(0, credit_card, options)
  else
    MultiResponse.run(:use_first_response) do |r|
      r.process { authorize(100, credit_card, options) }
      r.process(:ignore_result) { void(r.authorization, options) }
    end
  end
end