poundpay 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.mkd ADDED
@@ -0,0 +1,61 @@
1
+ Poundpay
2
+ ========
3
+
4
+
5
+ Install
6
+ -------
7
+ gem install poundpay
8
+
9
+
10
+ Configure
11
+ ---------
12
+ Poundpay.configure(
13
+ "developer_sid",
14
+ "auth_token",
15
+ api_url = "https://api-sandbox.poundpay.com", # Note: Leave out for production
16
+ )
17
+
18
+
19
+ Creating a payment
20
+ ------------------
21
+ require 'poundpay'
22
+
23
+ payment = Poundpay::Payment.create(
24
+ :amount => 20000,
25
+ :payer_fee_amount => 0,
26
+ :payer_email_address => "fred@example.com",
27
+ :recipient_fee_amount => 500,
28
+ :recipient_email_address => "david@example.com",
29
+ :description => "Beats by Dr. Dre",
30
+ )
31
+
32
+ Serving iframe
33
+ ---------------
34
+ <script src="https://www.poundpay.com/js/poundpay.js"></script>
35
+
36
+ <div id="pound-root"></div>
37
+
38
+ <script>
39
+ function handlePaymentSuccess() {
40
+ // do something
41
+ }
42
+
43
+ function handlePaymentError() {
44
+ // handle error
45
+ }
46
+
47
+ PoundPay.init({
48
+ payment_sid: <%= payment.sid %>,
49
+ success: handlePaymentSuccess,
50
+ error: handlePaymentError,
51
+ cardholder_name: 'Fred Nietzsche', // note: optional
52
+ phone_number: '4085551234', // note: optional
53
+ server: 'https://www-sandbox.poundpay.com' // note: exclude this property when in production
54
+ });
55
+ </script>
56
+
57
+
58
+ Releasing a payment
59
+ ------------------
60
+ payment.release
61
+ payment.save!
@@ -4,8 +4,8 @@ class SimpleApplication
4
4
  api_url: "https://api-sandbox.poundpay.com",
5
5
  www_url: "https://www-sandbox.poundpay.com",
6
6
  version: "silver",
7
- sid: "DV8539761e250011e0a81d1231400042c7",
8
- token: "5d291d63059f5c2fe8d144820a847982a9fba7004a1009a35ed7a5fdf1f67960",
7
+ sid: "DVxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
8
+ token: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
9
9
  }
10
10
  }
11
11
  end
@@ -15,7 +15,9 @@ module Poundpay
15
15
  unless status == 'ESCROWED'
16
16
  raise PaymentReleaseException.new "Payment status is #{status}. Only ESCROWED payments may be released"
17
17
  end
18
- status = 'RELEASED'
18
+ # Tried setting status with status=, but save still had status == 'ESCROWED'.
19
+ # Setting the status through the attributes, however, does work.
20
+ attributes['status'] = 'RELEASED'
19
21
  save
20
22
  end
21
23
  end
@@ -1,3 +1,3 @@
1
1
  module Poundpay
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -11,8 +11,7 @@ describe Developer do
11
11
  before (:all) do
12
12
  Poundpay.configure(
13
13
  "DV0383d447360511e0bbac00264a09ff3c",
14
- "c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449cc4526b2381a",
15
- )
14
+ "c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449cc4526b2381a")
16
15
  end
17
16
 
18
17
  describe "#me" do
@@ -29,8 +28,7 @@ describe Payment do
29
28
  before (:all) do
30
29
  Poundpay.configure(
31
30
  "DV0383d447360511e0bbac00264a09ff3c",
32
- "c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449cc4526b2381a",
33
- )
31
+ "c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449cc4526b2381a")
34
32
  end
35
33
 
36
34
  describe "#release" do
@@ -39,12 +37,12 @@ describe Payment do
39
37
  expect {@created_payment.release}.to raise_error(PaymentReleaseException)
40
38
  end
41
39
 
42
- it "should release a ESCROWED payment" do
40
+ it "should release an ESCROWED payment" do
43
41
  @escrowed_payment = Payment.new escrowed_payment_attributes
44
42
  @escrowed_payment.should_receive(:save).and_return(Payment.new released_payment_attributes)
45
43
 
46
44
  @escrowed_payment.release
47
- @escrowed_payment.status.should == 'ESCROWED'
45
+ @escrowed_payment.status.should == 'RELEASED'
48
46
  end
49
47
  end
50
48
  end
@@ -6,8 +6,7 @@ describe Poundpay, ".configure" do
6
6
  # Pass developer_sid and auth_token in wrong order
7
7
  Poundpay.configure(
8
8
  "c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449cc4526b2381a",
9
- "DV0383d447360511e0bbac00264a09ff3c",
10
- )
9
+ "DV0383d447360511e0bbac00264a09ff3c")
11
10
  }.to raise_error(ArgumentError, /DV/)
12
11
  end
13
12
 
@@ -25,8 +24,7 @@ describe Poundpay, ".configure" do
25
24
  "DV0383d447360511e0bbac00264a09ff3c",
26
25
  "c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449cc4526b2381a",
27
26
  api_url="https://api-sandbox.poundpay.com",
28
- version="gold",
29
- )
27
+ version="gold")
30
28
  Poundpay::Resource.site.to_s.should == "https://api-sandbox.poundpay.com/gold/"
31
29
  end
32
30
 
@@ -35,8 +33,7 @@ describe Poundpay, ".configure" do
35
33
  "DV0383d447360511e0bbac00264a09ff3c",
36
34
  "c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449cc4526b2381a",
37
35
  api_url="https://api-sandbox.poundpay.com/",
38
- version="gold",
39
- )
36
+ version="gold")
40
37
  Poundpay::Resource.site.to_s.should == "https://api-sandbox.poundpay.com/gold/"
41
38
  end
42
39
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
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-02-11 00:00:00 -08:00
17
+ date: 2011-02-14 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -59,7 +59,7 @@ files:
59
59
  - .rspec
60
60
  - .rvmrc
61
61
  - Gemfile
62
- - README
62
+ - README.mkd
63
63
  - Rakefile
64
64
  - examples/simple_application/.gems
65
65
  - examples/simple_application/.rvmrc
data/README DELETED
File without changes