Sha256: 4b3ca2d0c2d1e94007679eed439b8c211b27cd54a76c89c5bcf4d7d8b536510b
Contents?: true
Size: 619 Bytes
Versions: 10
Compression:
Stored size: 619 Bytes
Contents
module Pay module Braintree module Charge extend ActiveSupport::Concern def braintree? processor == "braintree" end def braintree_charge Pay.braintree_gateway.transaction.find(processor_id) rescue ::Braintree::BraintreeError => e raise Error, e.message end def braintree_refund!(amount_to_refund) Pay.braintree_gateway.transaction.refund(processor_id, amount_to_refund / 100.0) update(amount_refunded: amount_to_refund) rescue ::Braintree::BraintreeError => e raise Error, e.message end end end end
Version data entries
10 entries across 10 versions & 1 rubygems