Skip to content

Instantly share code, notes, and snippets.

@yock
Created June 3, 2013 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yock/42e6dd51d80e75d4cb81 to your computer and use it in GitHub Desktop.
Save yock/42e6dd51d80e75d4cb81 to your computer and use it in GitHub Desktop.
class GatewayService
def self.register(cc_token, customer = {})
account = Gateway::Account.create(name: user[:name].to_s, email: user[:email].to_s, credit_card: cc_token.to_s)
account.id
end
def self.pay(amount, customer = {})
account = Gateway::Account.get(customer[:external_id].to_s)
account.charge(amount.to_i)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment