Skip to content

Instantly share code, notes, and snippets.

@sethherr
Created June 22, 2012 16:25
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 sethherr/2973831 to your computer and use it in GitHub Desktop.
Save sethherr/2973831 to your computer and use it in GitHub Desktop.
{"created":1326853478,"data":{"object":{"amount":100,"amount_refunded":0,"card":{"address_country":null,"address_line1":null,"address_line1_check":null,"address_line2":null,"address_state":null,"address_zip":null,"address_zip_check":null,"country":"US","cvc_check":null,"exp_month":8,"exp_year":2013,"fingerprint":"yDYVpmGorv6HbB5u","id":"cc_00000000000000","last4":"4242","name":null,"object":"card","type":"Visa"},"created":1340205965,"currency":"usd","customer":null,"description":"MyFirstTestCharge(createdforAPIdocs)","disputed":false,"failure_message":null,"fee":0,"fee_details":[],"id":"ch_00000000000000","invoice":null,"livemode":false,"object":"charge","paid":true,"refunded":false}},"id":"evt_00000000000000","livemode":false,"object":"event","type":"charge.succeeded"}
WebhooksController parse stripe webhook should parse the data from the post
Failure/Error: post 'stripe', @example_success
JSON::ParserError:
757: unexpected token at '&data%5Bobject%5D%5Bamount%5D=100&data%5Bobject%5D%5Bamount_refunded%5D=0&data%5Bobject%5D%5Bcard%5D%5Baddress_country%5D=&data%5Bobject%5D%5Bcard%5D%5Baddress_line1%5D=&data%5Bobject%5D%5Bcard%5D%5Baddress_line1_check%5D=&data%5Bobject%5D%5Bcard%5D%5Baddress_line2%5D=&data%5Bobject%5D%5Bcard%5D%5Baddress_state%5D=&data%5Bobject%5D%5Bcard%5D%5Baddress_zip%5D=&data%5Bobject%5D%5Bcard%5D%5Baddress_zip_check%5D=&data%5Bobject%5D%5Bcard%5D%5Bcountry%5D=US&data%5Bobject%5D%5Bcard%5D%5Bcvc_check%5D=&data%5Bobject%5D%5Bcard%5D%5Bexp_month%5D=8&data%5Bobject%5D%5Bcard%5D%5Bexp_year%5D=2013&data%5Bobject%5D%5Bcard%5D%5Bfingerprint%5D=yDYVpmGorv6HbB5u&data%5Bobject%5D%5Bcard%5D%5Bid%5D=cc_00000000000000&data%5Bobject%5D%5Bcard%5D%5Blast4%5D=4242&data%5Bobject%5D%5Bcard%5D%5Bname%5D=&data%5Bobject%5D%5Bcard%5D%5Bobject%5D=card&data%5Bobject%5D%5Bcard%5D%5Btype%5D=Visa&data%5Bobject%5D%5Bcreated%5D=1340205965&data%5Bobject%5D%5Bcurrency%5D=usd&data%5Bobject%5D%5Bcustomer%5D=&data%5Bobject%5D%5Bdescription%5D=MyFirstTestCharge%28createdforAPIdocs%29&data%5Bobject%5D%5Bdisputed%5D=false&data%5Bobject%5D%5Bfailure_message%5D=&data%5Bobject%5D%5Bfee%5D=0&data%5Bobject%5D%5Bid%5D=ch_00000000000000&data%5Bobject%5D%5Binvoice%5D=&data%5Bobject%5D%5Blivemode%5D=false&data%5Bobject%5D%5Bobject%5D=charge&data%5Bobject%5D%5Bpaid%5D=true&data%5Bobject%5D%5Brefunded%5D=false&created=1326853478&id=evt_00000000000000&livemode=false&object=event&type=charge.succeeded'
# ./app/controllers/webhooks_controller.rb:7:in `stripe'
# ./spec/controllers/webhooks_controller_spec.rb:17:in `block (3 levels) in <top (required)>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment