Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix issue with Poundpay::Payment.authorize method, add two tests, bum…

…p version
  • Loading branch information...
commit beb407890e81638555172d79b3fc00f8ce044635 1 parent 3da8723
@mahmoudimus mahmoudimus authored
View
2  README.rdoc
@@ -7,7 +7,7 @@ Poundpay is a payments platform for marketplaces
1. Add the following to your Gemfile
- gem 'poundpay', '~> 0.3.0'
+ gem 'poundpay', '~> 0.3.1'
2. At the command prompt, install the gem with bundler
View
2  lib/poundpay/elements.rb
@@ -75,7 +75,7 @@ def authorize
unless status == 'STAGED'
raise PaymentAuthorizeException.new "Payment status is #{status}. Only STAGED payments may be AUTHORIZED."
end
- attributes['status'] = 'ESCROWED'
+ attributes['status'] = 'AUTHORIZED'
save
end
View
2  lib/poundpay/version.rb
@@ -1,3 +1,3 @@
module Poundpay
- VERSION = "0.3"
+ VERSION = "0.3.1"
end
View
15 spec/poundpay/elements_spec.rb
@@ -67,6 +67,21 @@
Poundpay.clear_config!
end
+ describe "#authorize" do
+ it "should not be able to authorize a non STAGED payment" do
+ @non_staged_payment = Payment.new authorized_payment_attributes
+ expect {@non_staged_payment.authorize}.to raise_error(PaymentAuthorizeException)
+ end
+
+ it "should authorize a STAGED payment" do
+ @staged_payment = Payment.new staged_payment_attributes
+ @staged_payment.should_receive(:save).and_return(Payment.new authorized_payment_attributes)
+
+ @staged_payment.authorize
+ @staged_payment.status.should == 'AUTHORIZED'
+ end
+ end
+
describe "#escrow" do
it "should not be able to escrow a STAGED payment" do
@staged_payment = Payment.new staged_payment_attributes
Please sign in to comment.
Something went wrong with that request. Please try again.