poundpay 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -9
- data/lib/poundpay/callback.rb +12 -10
- data/lib/poundpay/version.rb +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -7,7 +7,7 @@ Poundpay is a payments platform for marketplaces
|
|
7
7
|
|
8
8
|
1. Add the following to your Gemfile
|
9
9
|
|
10
|
-
gem 'poundpay', '~> 0.2.
|
10
|
+
gem 'poundpay', '~> 0.2.0'
|
11
11
|
|
12
12
|
2. At the command prompt, install the gem with bundler
|
13
13
|
|
@@ -70,16 +70,12 @@ Poundpay is a payments platform for marketplaces
|
|
70
70
|
</script>
|
71
71
|
|
72
72
|
|
73
|
-
==
|
73
|
+
== Payment methods
|
74
74
|
|
75
75
|
payment = Poundpay::Payment.find(payment_sid)
|
76
|
-
payment.
|
77
|
-
|
78
|
-
|
79
|
-
== Cancel a payment
|
80
|
-
|
81
|
-
payment = Poundpay::Payment.find(payment_sid)
|
82
|
-
payment.cancel
|
76
|
+
payment.escrow # AUTHORIZED -> ESCROWED. Credit card is charged
|
77
|
+
payment.release # ESCROWED -> RELEASED. Recipient receives money
|
78
|
+
payment.cancel # ESCROWED -> CANCELED. Payer receives refund
|
83
79
|
|
84
80
|
|
85
81
|
== Setting callback url
|
data/lib/poundpay/callback.rb
CHANGED
@@ -21,16 +21,18 @@ module Poundpay
|
|
21
21
|
end
|
22
22
|
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
if defined? Rails
|
25
|
+
module ActionController
|
26
|
+
class Base
|
27
|
+
protected
|
28
|
+
def verify_poundpay_callback
|
29
|
+
signature = request.headers['HTTP_X_POUNDPAY_SIGNATURE']
|
30
|
+
Poundpay.verified_callback?(signature, request.POST) || handle_unverified_poundpay_callback
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
def handle_unverified_poundpay_callback
|
34
|
+
raise RoutingError.new('Not Found')
|
35
|
+
end
|
36
|
+
end
|
35
37
|
end
|
36
38
|
end
|
data/lib/poundpay/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 7
|
9
|
+
version: 0.2.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matin Tamizi
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-04-
|
17
|
+
date: 2011-04-24 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|