sermepa 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +62 -0
- data/lib/sermepa/version.rb +1 -1
- metadata +4 -4
- data/README.rdoc +0 -3
data/README.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
Sermepa Gem for Rails
|
2
|
+
=====================
|
3
|
+
|
4
|
+
How to use
|
5
|
+
----------
|
6
|
+
|
7
|
+
### Configure
|
8
|
+
|
9
|
+
Add initalizer for sermepa configuration:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
Sermepa.configure do |config|
|
13
|
+
# For testing
|
14
|
+
config.service_url = "https://sis-t.sermepa.es:25443/sis/services/SerClsWSEntrada/wsdl/SerClsWSEntrada.wsdl"
|
15
|
+
# For production
|
16
|
+
config.service_url = "https://sis.sermepa.es/sis/services/SerClsWSEntrada/wsdl/SerClsWSEntrada.wsdl"
|
17
|
+
|
18
|
+
config.merchant_code = 'Here goes merchant code'
|
19
|
+
config.secret = 'Here goes secret'
|
20
|
+
config.terminal = '1' # Terminal code
|
21
|
+
config.currency = :EUR # Currency (:EUR, :USD, :GBP, :JPY)
|
22
|
+
config.raise_errors = true # If true will raise exceptions when error ocurrs
|
23
|
+
config.callback_url = "Here goes callback URL"
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
You can add some aditional config for savon
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
Savon.configure do |config|
|
31
|
+
config.pretty_print_xml = false
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
### Sending payment requests
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
# Timeout should be included
|
39
|
+
Timeout::timeout(20) {
|
40
|
+
Sermepa.pay_request(pan: params[:card_number],
|
41
|
+
cvv2: params[:cvv2],
|
42
|
+
expiration: expiration_date,
|
43
|
+
amount: amount,
|
44
|
+
order: oreder_reference)
|
45
|
+
}
|
46
|
+
```
|
47
|
+
|
48
|
+
### Refunding payments
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
Timeout::timeout(20) {
|
52
|
+
Sermepa.refund_request(amount: amount,
|
53
|
+
order: reference)
|
54
|
+
}
|
55
|
+
```
|
56
|
+
|
57
|
+
### Exceptions
|
58
|
+
|
59
|
+
* Sermepa::SermepaRemoteError
|
60
|
+
* Sermepa::SermepaPaymentError
|
61
|
+
|
62
|
+
|
data/lib/sermepa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sermepa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -76,7 +76,7 @@ files:
|
|
76
76
|
- lib/tasks/sermepa_tasks.rake
|
77
77
|
- MIT-LICENSE
|
78
78
|
- Rakefile
|
79
|
-
- README.
|
79
|
+
- README.md
|
80
80
|
- test/dummy/app/assets/javascripts/application.js
|
81
81
|
- test/dummy/app/assets/stylesheets/application.css
|
82
82
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -107,7 +107,7 @@ files:
|
|
107
107
|
- test/dummy/script/rails
|
108
108
|
- test/sermepa_test.rb
|
109
109
|
- test/test_helper.rb
|
110
|
-
homepage:
|
110
|
+
homepage: https://github.com/endSly/sermepa-rails
|
111
111
|
licenses: []
|
112
112
|
post_install_message:
|
113
113
|
rdoc_options: []
|
data/README.rdoc
DELETED