payex 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/payex.rb +5 -2
- data/payex.gemspec +1 -1
- metadata +1 -1
data/lib/payex.rb
CHANGED
@@ -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
|
-
|
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)
|
data/payex.gemspec
CHANGED