sermepa 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/lib/sermepa/constants.rb +17 -0
- data/lib/sermepa/form_helper.rb +9 -6
- data/lib/sermepa/sermepa.rb +3 -2
- data/lib/sermepa/signature.rb +0 -2
- data/lib/sermepa/version.rb +1 -1
- metadata +25 -11
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MjdiZTgxMDQyYjcxMGM5OTEwZTZlOGZlYzczNWQ2ZGQ1YTA1ZmM4Y2YyZWEw
|
10
|
-
NTE5M2MyMzJiMzllNGVlYWRhOWM5YjUwYTIyMmU1ZWJlZTZlOTljZTYzODI2
|
11
|
-
MGYyY2Q0OTZlMDFkZTdlMWM5YjIzY2ZjOTQ0OGNjNGE2NWNjYjk=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZGE4YjJlY2E0N2UyZTQ1YzAyNGI0NTFmNjBjZWU3MDc1Y2M2YzUyZWFlZTcy
|
14
|
-
YmQyNTIzYzYxMzM5MGQ2YmRkODRjMzEzMjUzYWVmYTU2NjllMTJjY2MxNTEx
|
15
|
-
M2I5M2FmY2FiMjA2YjI5ODk0NzgzMGU4MDFlOWNjNWI5YjE4MWU=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 514fda42869c6470f9bd79515a02c3244567504d
|
4
|
+
data.tar.gz: 53f8694c70dcf2987e0f1d6a4ee66a9c9df53634
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7e2293193d2341f0dac117011ddb194e6204f81cebd4f24678136ea898cbb1f1dac45e6cad4d9bcf8a41ae40856521e22f90321b678760f7f496fa038a6617d3
|
7
|
+
data.tar.gz: 8838fbefb93ac5652f0de61e9bdbfe04b8e0013cf42ac2fd96b30a3695bce936b0426c9119c49ce2d2f2ab5cf381d3979f7552cab8fda5d43758590b56f47e6c
|
data/lib/sermepa/constants.rb
CHANGED
@@ -7,6 +7,23 @@ module Sermepa
|
|
7
7
|
:JPY => '392'
|
8
8
|
}
|
9
9
|
|
10
|
+
FORM_TRANSACTION_TYPES = {
|
11
|
+
# Payment Requests
|
12
|
+
:traditional_payment => '0',
|
13
|
+
:preauthorization => '1',
|
14
|
+
:deferred_authorization_confirmation => '2',
|
15
|
+
:total_or_partial_devolution => '3',
|
16
|
+
:authentication => '7',
|
17
|
+
:authentication_confirmation => '8',
|
18
|
+
:preauthorization_cancel => '9',
|
19
|
+
:start_file_card => 'L',
|
20
|
+
:next_file_card => 'M',
|
21
|
+
:deferred_preauthorization => 'O',
|
22
|
+
:deferred_preauthorization_confirmation => 'P',
|
23
|
+
:deferred_preauthorization_cancel => 'Q'
|
24
|
+
}
|
25
|
+
|
26
|
+
|
10
27
|
TRANSACTION_TYPES = {
|
11
28
|
# Payment Requests
|
12
29
|
:traditional_payment => 'A',
|
data/lib/sermepa/form_helper.rb
CHANGED
@@ -9,7 +9,7 @@ module Sermepa
|
|
9
9
|
DS_MERCHANT_ORDER: params[:order] || Time.now.to_i,
|
10
10
|
DS_MERCHANT_MERCHANTCODE: params[:merchant_code] || Sermepa.config.merchant_code,
|
11
11
|
DS_MERCHANT_TERMINAL: params[:terminal] || Sermepa.config.terminal,
|
12
|
-
DS_MERCHANT_TRANSACTIONTYPE:
|
12
|
+
DS_MERCHANT_TRANSACTIONTYPE: FORM_TRANSACTION_TYPES[params[:transaction_type]],
|
13
13
|
DS_MERCHANT_MERCHANTURL: params[:merchant_url] || Sermepa.config.merchant_url,
|
14
14
|
DS_MERCHANT_URLOK: params[:url_ok] || Sermepa.config.url_ok,
|
15
15
|
DS_MERCHANT_URLKO: params[:url_ko] || Sermepa.config.url_ko,
|
@@ -21,16 +21,19 @@ module Sermepa
|
|
21
21
|
|
22
22
|
def sermepa_payment_form(amount, params = {}, &block)
|
23
23
|
values = sermepa_form_fields(amount, params)
|
24
|
-
|
25
24
|
output = ActiveSupport::SafeBuffer.new
|
26
|
-
|
27
|
-
|
25
|
+
|
26
|
+
output << form_tag(Sermepa.config.post_url, :method => :post) do
|
27
|
+
innerOutput = ActiveSupport::SafeBuffer.new
|
28
28
|
values.each_pair do |k,v|
|
29
|
-
|
29
|
+
innerOutput << hidden_field_tag(k, v) if v
|
30
30
|
end
|
31
|
-
|
31
|
+
innerOutput << (block_given?? capture(&block) : submit_tag(t 'sermepa.payment_form.send_action'))
|
32
32
|
end
|
33
|
+
|
33
34
|
output
|
34
35
|
end
|
36
|
+
|
37
|
+
|
35
38
|
end
|
36
39
|
end
|
data/lib/sermepa/sermepa.rb
CHANGED
@@ -2,6 +2,7 @@ require 'active_support/core_ext'
|
|
2
2
|
require 'sermepa/constants'
|
3
3
|
require 'sermepa/errors'
|
4
4
|
require 'sermepa/signature'
|
5
|
+
require 'savon'
|
5
6
|
|
6
7
|
module Sermepa
|
7
8
|
|
@@ -44,7 +45,7 @@ module Sermepa
|
|
44
45
|
end
|
45
46
|
|
46
47
|
def call(values = {})
|
47
|
-
client = Savon.client(config.service_url)
|
48
|
+
client = ::Savon.client(config.service_url)
|
48
49
|
|
49
50
|
response = client.request :trata_peticion do
|
50
51
|
soap.body do |xml|
|
@@ -79,4 +80,4 @@ module Sermepa
|
|
79
80
|
|
80
81
|
return false # No errors
|
81
82
|
end
|
82
|
-
end
|
83
|
+
end
|
data/lib/sermepa/signature.rb
CHANGED
@@ -7,8 +7,6 @@ module Sermepa
|
|
7
7
|
token += values[:DS_MERCHANT_ORDER].to_s
|
8
8
|
token += values[:DS_MERCHANT_MERCHANTCODE].to_s
|
9
9
|
token += values[:DS_MERCHANT_CURRENCY].to_s
|
10
|
-
token += values[:DS_MERCHANT_PAN].to_s
|
11
|
-
token += values[:DS_MERCHANT_CVV2].to_s
|
12
10
|
token += values[:DS_MERCHANT_TRANSACTIONTYPE].to_s
|
13
11
|
token += values[:DS_MERCHANT_MERCHANTURL].to_s if config.merchant_url
|
14
12
|
token += secret || config.secret
|
data/lib/sermepa/version.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sermepa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Endika Gutiérrez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -30,28 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.0
|
33
|
+
version: 1.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.0
|
40
|
+
version: 1.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.9'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.9'
|
55
69
|
description: Sermepa is a spanish payments gateway
|
56
70
|
email:
|
57
71
|
- me@endika.net
|
@@ -112,17 +126,17 @@ require_paths:
|
|
112
126
|
- lib
|
113
127
|
required_ruby_version: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- -
|
129
|
+
- - '>='
|
116
130
|
- !ruby/object:Gem::Version
|
117
131
|
version: '0'
|
118
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
133
|
requirements:
|
120
|
-
- -
|
134
|
+
- - '>='
|
121
135
|
- !ruby/object:Gem::Version
|
122
136
|
version: '0'
|
123
137
|
requirements: []
|
124
138
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.0.
|
139
|
+
rubygems_version: 2.0.3
|
126
140
|
signing_key:
|
127
141
|
specification_version: 4
|
128
142
|
summary: Sermepa gateway for rails.
|