Skip to content

Instantly share code, notes, and snippets.

@paulcook
Last active March 22, 2016 14:26
Show Gist options
  • Save paulcook/007b5d484e7aa17946e9 to your computer and use it in GitHub Desktop.
Save paulcook/007b5d484e7aa17946e9 to your computer and use it in GitHub Desktop.
def save_card
# Stubbed method on the api wrapper
response = Api::save_card(card_info)
if response.success?
# do something because it was saved
else
# let user know it wasnt saved
end
end
def charge_card
# Stubbed method on the api wrapper
response = Api::charge_card(amount, customer_id, etc)
if response.success?
# yeah! we got the money and they bought something
else
# Failed to charge card...uh oh!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment