Skip to content

Instantly share code, notes, and snippets.

@r00k
Created June 27, 2012 18:23
Show Gist options
  • Save r00k/3005856 to your computer and use it in GitHub Desktop.
Save r00k/3005856 to your computer and use it in GitHub Desktop.
class User
def charge_for_subscription
PaymentActions.new(user, BraintreeGemSomethingSomething.new).charge_for_subscription
end
end
class PaymentActions
def initialize(user, braintree)
@user, @braintree = user, braintree
end
def charge_for_subscription
@braintree.create_subscription(@user)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment