Sha256: f70d5f62f4ebafce115aaca6d71381fbea08892be165f59b8285bf268858bc71
Contents?: true
Size: 614 Bytes
Versions: 1
Compression:
Stored size: 614 Bytes
Contents
module BraintreeRails class Transactions < SimpleDelegator include Association def initialize(customer, credit_card=nil) @customer = customer || Customer.new({}) @credit_card = credit_card || @customer.credit_cards.find(&:default?) transactions = Braintree::Transaction.search do |search| search.customer_id.is @customer.id search.payment_method_token.is @credit_card.token if @credit_card && @credit_card.persisted? end super(transactions.to_a) end def default_options {:customer => @customer, :credit_card => @credit_card} end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
braintree-rails-0.3.0 | lib/braintree_rails/transactions.rb |