Skip to content
This repository has been archived by the owner on Dec 2, 2018. It is now read-only.

Commit

Permalink
added status codes for pending, renamed other status codes to match t…
Browse files Browse the repository at this point in the history
…he statuses in the PHP lib
  • Loading branch information
koenpunt committed May 23, 2013
1 parent 0597157 commit 8d05798
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/omni_kassa/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ module OmniKassa
class Response
RESPONSE_CODES = {
0 => :success,
17 => :user_cancellation,
97 => :request_timeout
17 => :cancelled,
60 => :pending,
90 => :pending,
97 => :expired
}

attr_accessor :data, :seal, :order_id, :response_code, :amount
Expand Down
7 changes: 5 additions & 2 deletions test/response_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ def test_responses
assert_equal :success, @response.response

@response.response_code = 17
assert_equal :user_cancellation, @response.response
assert_equal :cancelled, @response.response

@response.response_code = 60
assert_equal :pending, @response.response

@response.response_code = 97
assert_equal :request_timeout, @response.response
assert_equal :expired, @response.response

@response.response_code = 1 # not 0
assert_equal :unknown_failure, @response.response
Expand Down

0 comments on commit 8d05798

Please sign in to comment.