tipjoy 0.0.6 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/tipjoy.rb +8 -0
- data/lib/tipjoy/payment.rb +2 -2
- data/lib/tipjoy/tipjoy_requestor.rb +4 -4
- data/tipjoy.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
data/lib/tipjoy.rb
CHANGED
data/lib/tipjoy/payment.rb
CHANGED
@@ -31,15 +31,15 @@ module Tipjoy
|
|
31
31
|
private
|
32
32
|
|
33
33
|
def tweet_payment
|
34
|
+
Tipjoy.logger.error("tweeting payment")
|
34
35
|
response = self.client.update("p $#{amount} @#{to_account.twitter_username} #{message}")
|
36
|
+
Tipjoy.logger.error(" response " + response.inspect)
|
35
37
|
self.tweet_id = response["id"]
|
36
38
|
end
|
37
39
|
|
38
40
|
def notify_tipjoy
|
39
41
|
json = tipjoy_request(:post,"http://tipjoy.com/api/tweetpayment/notify/", { "tweet_id" => self.tweet_id })
|
40
|
-
p json
|
41
42
|
Transaction.new(json)
|
42
43
|
end
|
43
|
-
|
44
44
|
end
|
45
45
|
end
|
@@ -21,11 +21,11 @@ module Tipjoy
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def tipjoy_request(method, url, data={})
|
24
|
-
Tipjoy.logger.
|
24
|
+
Tipjoy.logger.error("requesting via #{method} " + url + "with args " + data.inspect)
|
25
25
|
response = tipjoy_http_request(method, url, data)
|
26
26
|
|
27
27
|
if !(200..299).include?(response.code.to_i)
|
28
|
-
Tipjoy.logger.
|
28
|
+
Tipjoy.logger.error(" RequestError " + response.inspect)
|
29
29
|
raise RequestError.new('ah!')
|
30
30
|
end
|
31
31
|
|
@@ -33,11 +33,11 @@ module Tipjoy
|
|
33
33
|
json = JSON.parse(response.body)
|
34
34
|
|
35
35
|
if json['result'] != 'success'
|
36
|
-
Tipjoy.logger.
|
36
|
+
Tipjoy.logger.error(" ResultError " + json.inspect)
|
37
37
|
raise ::Tipjoy::ResultError.new(json.inspect)
|
38
38
|
end
|
39
39
|
|
40
|
-
Tipjoy.logger.
|
40
|
+
Tipjoy.logger.error(" response: " + json.inspect)
|
41
41
|
json
|
42
42
|
end
|
43
43
|
end
|
data/tipjoy.gemspec
CHANGED