lib/pay/braintree/billable.rb
# Handles Billable#charge
#
# Returns a Pay::Charge
Handles Billable#charge
Returns a Pay::Charge
Handles Billable#charge Returns a Pay :: Charge
def create_braintree_charge(amount, options = {})
        args = {
          amount: amount / 100.0,
          customer_id: customer.id,
          options: {submit_for_settlement: true}
        }.merge(options)
        result = gateway.transaction.sale(args)
        raise BraintreeError.new(result), result.message unless result.success?
        save_braintree_transaction(result.transaction)
      rescue ::Braintree::AuthorizationError => e
        raise BraintreeAuthorizationError
      rescue ::Braintree::BraintreeError => e
        raise BraintreeError, e.message
      end
def create_braintree_charge ( amount , options = { } ) args = { amount : amount / 100.0 , customer_id : customer . id , options : { submit_for_settlement : true } } . merge ( options ) result = gateway . transaction . sale ( args ) raise BraintreeError . new ( result ) , result . message unless result . success? save_braintree_transaction ( result . transaction ) rescue :: Braintree :: AuthorizationError => e raise BraintreeAuthorizationError rescue :: Braintree :: BraintreeError => e raise BraintreeError , e . message end
Handles Billable#charge
Returns a Pay::Charge
Handles Billable#charge Returns a Pay :: Charge
amount
options