Skip to content

Instantly share code, notes, and snippets.

@russ
Created February 2, 2010 23:02
Show Gist options
  • Save russ/293148 to your computer and use it in GitHub Desktop.
Save russ/293148 to your computer and use it in GitHub Desktop.
class CreditCardResource
include JsonRpc::Resource
service_api 'http://localhost:3000/billing/credit_cards'
property :number
property :type
end
begin
credit_card = CreditCardResource.new(
:number => '1',
:first_name => 'Russ',
:last_name => 'Smith',
:month => '10',
:year => '2010',
:verification_value => '000',
:type => 'bogus')
result = credit_card.authorize!
credit_card.void!(result['transaction_id'])
rescue JsonRpc::Resource::ProcedureError
puts c.errors.inspect
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment