gp_webpay 0.2.2 → 0.3.0

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: 66f08654173a78510ff2a06bd98a034b49ec4c83
4
- data.tar.gz: 0b88f8af914d24caf3109774aa87b8f017c62b80
3
+ metadata.gz: cc6617c021301b1751c36c4e45f40eb345ce8718
4
+ data.tar.gz: 792646f79d8e087e47a6ca5325977a69f923ca1f
5
5
  SHA512:
6
- metadata.gz: 329179521d2a27b1afbc761e31f40d6f8ccc96cb5b00957b775709d2f98f38a946ef64f42bd4ec6f7565c89a11903d53d629bc6f16d65e7d9692f99e0ec7d41d
7
- data.tar.gz: 3b6b3af161ea17838901475e57a4708bede0da2c18abbc0b753afc40b6707373a3f8b57d93790eb817b44d9616bacc15137235cc162ff2245a628eeb21407680
6
+ metadata.gz: 5ca28f03175eb89f444e68ff2542250d414fcb6d17fef4c5cef2329146ca246b53a93327b8cef759fe1e63a5d02fe9dd752001b196935d4becf00c879ed732c0
7
+ data.tar.gz: 3fd4664a3f3f4ece906199e26f4b2a9f057dc42704e8f5b5dbf3df030c87fc7f0b017ea12e3254829d2a9cdfa0864507ba5ca7434c637a63d2fed86748d5232e
data/README.md CHANGED
@@ -29,6 +29,17 @@ GpWebpay.configure do |config|
29
29
  config.merchant_number = ##########
30
30
  config.merchant_pem_path = 'my_cert.pem'
31
31
  config.merchant_password = 'password'
32
+ # config.gp_webpay_bank = :kb # :rb
33
+ end
34
+ ```
35
+
36
+ You can also use this GEM for integration with CSOB
37
+
38
+ ```ruby
39
+ GpWebpay.configure do |config|
40
+ config.merchant_number = ENV['MERCHANT_NUMBER']
41
+ config.merchant_pem = ENV['MERCHANT_PEM']
42
+ config.provider = :csob
32
43
  end
33
44
  ```
34
45
 
@@ -0,0 +1,27 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEmDCCA4CgAwIBAgIJAMaBjvjHnDqDMA0GCSqGSIb3DQEBBQUA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5OHVFhr0nkCsDfUShn+LDlKUpewjyaYD5T+VeDszjQASQKs3dUU
24
+ c0zV1quSPOzxTNo43PdlK7qK0HzQfpVJgYsVnUUKnjymfw02Ir057syMl10Bm7rE
25
+ JLx+upYLotXtUUjHTbwAEBtzi3SyMi43LYXt4ofgZXuNhIjAqKaDlgBSghRNf4ba
26
+ OIss2oMe/NvL1X/3zmYXVRk7KTnEQg==
27
+ -----END CERTIFICATE-----
@@ -23,21 +23,37 @@ module GpWebpay
23
23
  config_accessor :merchant_password
24
24
  config_accessor :gpe_pem_path
25
25
  config_accessor :environment
26
+ config_accessor :provider
27
+ config_accessor :gp_webpay_bank
26
28
 
27
29
  def param_name
28
30
  config.param_name.respond_to?(:call) ? config.param_name.call : config.param_name
29
31
  end
30
32
 
31
33
  def pay_url
32
- if production?
33
- 'https://3dsecure.gpwebpay.com/kb/order.do'
34
- else
35
- 'https://test.3dsecure.gpwebpay.com/kb/order.do'
34
+ case config.provider
35
+ when :csob
36
+ if production?
37
+ 'https://platebnibrana.csob.cz/pay/entry/merchant'
38
+ else
39
+ 'https://iplatebnibrana.csob.cz/pay/entry/merchant'
40
+ end
41
+ when :gp_webpay
42
+ if production?
43
+ "https://3dsecure.gpwebpay.com/#{config.gp_webpay_bank}/order.do"
44
+ else
45
+ "https://test.3dsecure.gpwebpay.com/#{config.gp_webpay_bank}/order.do"
46
+ end
36
47
  end
37
48
  end
38
49
 
39
50
  def gpe_pem_path
40
- file_name = production? ? 'muzo.signing_prod.pem' : 'muzo.signing_test.pem'
51
+ env = production? ? 'prod' : 'test'
52
+
53
+ file_name = case config.provider
54
+ when :csob then "mips_#{env}.csob.cz.pem"
55
+ when :gp_webpay then "muzo.signing_#{env}.pem"
56
+ end
41
57
 
42
58
  File.expand_path("../../../certs/#{file_name}", __FILE__)
43
59
  end
@@ -59,5 +75,7 @@ module GpWebpay
59
75
  config.merchant_pem_path = nil
60
76
  config.merchant_password = nil
61
77
  config.environment = defined?(Rails) && Rails.env || 'test'
78
+ config.provider = :gp_webpay
79
+ config.gp_webpay_bank = :kb
62
80
  end
63
81
  end
@@ -2,6 +2,9 @@ module GpWebpay
2
2
  module Payment
3
3
  extend ActiveSupport::Concern
4
4
 
5
+ DIGEST_ALLOWED_ATTRIBUTES = %w(OPERATION ORDERNUMBER MERORDERNUM PRCODE
6
+ SRCODE RESULTTEXT)
7
+
5
8
  included do
6
9
  attr_accessor :redirect_url
7
10
  end
@@ -45,7 +48,7 @@ module GpWebpay
45
48
  end
46
49
 
47
50
  def digest_verification(params)
48
- %w(OPERATION ORDERNUMBER PRCODE SRCODE RESULTTEXT).
51
+ (DIGEST_ALLOWED_ATTRIBUTES & params.keys).
49
52
  map { |key| params[key] }.join('|')
50
53
  end
51
54
 
@@ -1,3 +1,3 @@
1
1
  module GpWebpay
2
- VERSION = '0.2.2'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gp_webpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Magnusek
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-16 00:00:00.000000000 Z
11
+ date: 2016-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -81,6 +81,8 @@ files:
81
81
  - Rakefile
82
82
  - bin/console
83
83
  - bin/setup
84
+ - certs/mips_prod.csob.cz.pem
85
+ - certs/mips_test.csob.cz.pem
84
86
  - certs/muzo.signing_prod.pem
85
87
  - certs/muzo.signing_test.pem
86
88
  - gp_webpay.gemspec