Class: AlphaCard::Sale
Instance Method Summary
collapse
#filled_attributes, #to_query
Instance Method Details
#create(order, account) ⇒ Object
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/alpha_card/sale.rb', line 10
def create(order, account)
[:ccexp, :ccnumber, :amount].each do |attr|
raise Exception.new("No #{attr.to_s} information provided") if self.send(attr.to_s).blank?
end
params = self.filled_attributes || {}
[order, order.billing, order.shipping].compact.each { |obj| params.merge!(obj.try(:filled_attributes)) }
AlphaCard.request(params, account).success?
end
|