lolita-bank-link 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e74f394b4ccaa4df8e5c47a05a85c712dc24a87
4
- data.tar.gz: 26d8081ddbdcd5d7bbc205bdb4005f9f842a6b9b
3
+ metadata.gz: 9d3c12e9a0e2abad36809a9bb092c979b62b9d51
4
+ data.tar.gz: 1e97787930fa2c2f8413179e67af45aa5e37958d
5
5
  SHA512:
6
- metadata.gz: bc1456bb97e93593b20081e4f0f7c0d23b167620b5d4e4edc095c496d893224eae6be1baed536d9946f247a103bf741531d361fd0e1a0b2a5313ae61e09f87a4
7
- data.tar.gz: 786ac8d289fafcda5b616b3bcb21a42c427021b1c85f9352fae761e7cf938fc34bc91f6d9ba9e094797d687f59f13e0b1e3bf3ced417611f0c204d8b85db1975
6
+ metadata.gz: 2c8d9f51bd48bd3636d3d4bcaf71e91315a0737eaa74b37bb0fb1cc2e98a4b7580f632e7df8e82ab9a836e062ca31f1f4cfd850f3e811e69afdbe4247130cb71
7
+ data.tar.gz: 26308a49920440c8a551d1afaacd748710f09a8ecd363ce619efa427161dce58161dd5ddd23f7ec0c5f296009551b760b6a3d22be7133cddf08f1d6de33c1603
@@ -25,8 +25,12 @@ module LolitaBankLink
25
25
  redirect_to response.return_path
26
26
  end
27
27
  else
28
- LolitaBankLink.logger.error("[#{session_id}][#{response.paymentable_id}][answer] #{response.error}")
29
- render text: I18n.t("bank_link.wrong_request"), status: 400
28
+ if !bank_auto_response? && response.transaction_completed?
29
+ redirect_to response.return_path
30
+ else
31
+ LolitaBankLink.logger.error("[#{session_id}][#{response.paymentable_id}][answer] #{response.error}")
32
+ render text: I18n.t("bank_link.wrong_request"), status: 400
33
+ end
30
34
  end
31
35
  ensure
32
36
  if response
@@ -17,6 +17,10 @@ module LolitaBankLink
17
17
  self[:ip] = IPAddr.new(x).to_i
18
18
  end
19
19
 
20
+ def completed?
21
+ status == 'completed'
22
+ end
23
+
20
24
  class << self
21
25
  # add new transaction in Checkout
22
26
  def add payment, request
@@ -43,6 +43,10 @@ module LolitaBankLink
43
43
  transaction && transaction.paymentable_id
44
44
  end
45
45
 
46
+ def transaction_completed?
47
+ transaction && transaction.completed?
48
+ end
49
+
46
50
  private
47
51
 
48
52
  def read_signature(params)
@@ -1,3 +1,3 @@
1
1
  module LolitaBankLink
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolita-bank-link
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatis Tomsons
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-03 00:00:00.000000000 Z
12
+ date: 2015-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.2.0
177
+ rubygems_version: 2.4.4
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: BankLink payment plugin for Lolita