-
-
Save yock/42e6dd51d80e75d4cb81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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