payex 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/payex.rb +5 -2
  2. data/payex.gemspec +1 -1
  3. metadata +1 -1
@@ -49,10 +49,13 @@ def PayEx.complete_transaction! id
49
49
 
50
50
  status = response[:transaction_status]
51
51
  status = PayEx.parse_transaction_status(status)
52
+ error = nil
52
53
 
53
54
  case status
54
55
  when :sale, :authorize
55
- error = nil
56
+ if response[:already_completed]
57
+ error = 'Transaction already completed'
58
+ end
56
59
  when :initialize
57
60
  error = 'Transaction not completed'
58
61
  when :failure
@@ -65,7 +68,7 @@ def PayEx.complete_transaction! id
65
68
  error = 'Unexpected transaction status: ' + status.to_s.upcase
66
69
  end
67
70
 
68
- [response[:order_id], error]
71
+ [response[:order_id], error, response]
69
72
  end
70
73
 
71
74
  def PayEx.parse_transaction_status(status)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'payex'
5
- gem.version = '0.1.0'
5
+ gem.version = '0.1.1'
6
6
  gem.summary = 'PayEx SOAP API glue'
7
7
  gem.author = 'Daniel Brockman'
8
8
  gem.files = `git ls-files 2>/dev/null`.split($\)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: