module SkroutzPay::Gateways::AmericanExpress
Public Instance Methods
capture(ccn, expiration_date, cvv2, amount)
click to toggle source
Captures a payment by charging actual money
@param [String] ccn, the credit card number @param [Date] expiration date @param [String] cvv2 @param [Integer] amount to preauth in euros
# File lib/skroutz_pay/gateways/american_express.rb, line 24 def capture(ccn, expiration_date, cvv2, amount) request(ccn, expiration_date, cvv2, amount, :capture) end
Private Instance Methods
request(ccn, expiration_date, cvv2, amount, type = :auth)
click to toggle source
# File lib/skroutz_pay/gateways/american_express.rb, line 30 def request(ccn, expiration_date, cvv2, amount, type = :auth) if expiration_date < Date.today raise SkroutzPay::InvalidCreditCardData end if !amount.is_a?(Integer) raise SkroutzPay::InvalidChargeAmount end if type == :auth # actual code should be here rand(100) % 8 != 0 else type == :capture # actual code should be here rand(100) % 8 != 0 end end