Skip to content

Commit 8a47031

Browse files
committed
initial commit
0 parents  commit 8a47031

File tree

16 files changed

+349
-0
lines changed

16 files changed

+349
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.bundle/
2+
/.yardoc
3+
/Gemfile.lock
4+
/_yardoc/
5+
/coverage/
6+
/doc/
7+
/pkg/
8+
/spec/reports/
9+
/tmp/

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: ruby
2+
rvm:
3+
- 2.2.2

Gemfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'rake'
4+
5+
group :development do
6+
gem 'awesome_print'
7+
gem 'hirb-unicode'
8+
gem 'bundler', '~> 1.9'
9+
end
10+
11+
group :test do
12+
gem 'minitest'
13+
gem 'vcr', '~> 2.9.3'
14+
gem 'webmock', '>= 1.21.0'
15+
end
16+
17+
gemspec

INTERFACE.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Raiffeisen URI Variables
2+
3+
## Production
4+
`<fqdn> tb.raiffeisendirect.ch`
5+
`<authenticationpath> non existend`
6+
`<authenticationpath> (for CLX.Sentinel) /certLogin`
7+
`<softcertaktivierungpath> /softCertActivation`
8+
`<softcertauthenticationpath> /softCertLogin`
9+
`<clientpath> non existend`
10+
11+
## Staging System (Needs contracted access)
12+
`<fqdn> at.raiffeisendirect.ch`
13+
`<authenticationpath> non existend`
14+
`<authenticationpath> (for CLX.Sentinel) /certLogin`
15+
`<softcertaktivierungpath> /softCertActivation`
16+
`<softcertauthenticationpath> /softCertLogin`
17+
`<clientpath> non existend`
18+
19+
## Testing System (Needs contracted access)
20+
`<fqdn> it.raiffeisendirect.ch`
21+
`<authenticationpath> non existend`
22+
`<authenticationpath> (for CLX.Sentinel) /certLogin`
23+
`<softcertaktivierungpath> /softCertActivation`
24+
`<softcertauthenticationpath> /softCertLogin`
25+
`<clientpath> non existend`
26+
27+
28+
# General Endpoints
29+
30+
## Authentication with soft certificate
31+
### Certificate Activation
32+
#### Request
33+
URL: `https://<fqdn><softcertaktivierungspath>/offlinetool/`
34+
Method: `POST`
35+
36+
**Parameters**
37+
`lang` values: `de, fr, it, en`
38+
`codeA` The first code that you will get with the activation letter.
39+
`codeB` The second code that you will get with the activation letter.
40+
`bank` is optional.
41+
42+
####Response
43+
```
44+
<?xml version="1.0" encoding="ISO-8859-1" ?>
45+
<ACTIVATION_SOFT_CERT_RESPONSE>
46+
<ErrorCode>num</ErrorCode>
47+
<StatusMsg>Msg</StatusMsg>
48+
<LastLogin> Msg</LastLogin>
49+
</ACTIVATION_SOFT_CERT_RESPONSE>
50+
```
51+
52+
**`ErrorCode`**
53+
`0` Certificate correct and valid
54+
`1` Certificate and/or conctract unknown
55+
`2` Contract locked
56+
`3` One or multiple activation codes are wrong.
57+
`4` Certificate is locked
58+
`6` Certificate rejected
59+
`7` Certificate expired
60+
`-1` System currently not available
61+
62+
**`StatusMsg`**
63+
Text with error message
64+
65+
**`LastLogin`**
66+
This field only exists if ErrorCode=0. Date and time of the last successfull login in the format dd.mm.yyyy hh:mm
67+
68+
### Login
69+
#### Request
70+
71+
URL: `https://<fqdn><softcertauthenticationpath>/offlinetool/`
72+
Method: `POST`
73+
74+
**Parameters**
75+
`lang` values: `de, fr, it, en`
76+
`password`
77+
`new_password` Mandatory if the password has to be changed (first login), later optional. If present, current password gets overwritten with new password.
78+
`bank` is optional.
79+
80+
####Response
81+
```
82+
<?xml version="1.0" encoding="ISO-8859-1" ?>
83+
<LOGIN_SOFT_CERT_RESPONSE>
84+
<ErrorCode>num</ErrorCode>
85+
<StatusMsg>Msg</StatusMsg>
86+
<LastLogin> Msg</LastLogin>
87+
</LOGIN_SOFT_CERT_RESPONSE>
88+
```
89+
90+
**`ErrorCode`**
91+
`0` Certificate correct and valid
92+
`1` Certificate and/or conctract unknown
93+
`2` Contract locked
94+
`4` User needs to log in on the website to accept disclaimers.
95+
`6` Certificate rejected.
96+
`7` Certificate expired
97+
`8` Password wrong or empty. Please enter new password.
98+
`9` New password is too short or empty. Please enter correct password.
99+
`10` New password is the same as the initial password. Please enter a personal password.
100+
`-1` System currently not available.
101+
102+
**`StatusMsg`**
103+
Text with error message
104+
105+
**`LastLogin`**
106+
This field only exists if ErrorCode=0. Date and time of the last successfull login in the format dd.mm.yyyy hh:mm
107+
108+
109+
> **IMPORTANT:** If the login is successfull the response will include a *RDI_SESS* Cookie in the header. This cookie has to be sent with further requests.
110+
111+
### Logout
112+
#### Request
113+
URL: `https://<fqdn><clientpath>/root/extras/logout`
114+
Method: `POST`
115+
116+
**Parameters**
117+
`output` **xml** If this parameter is omitted, the response is in HTML format.
118+
119+
####Response
120+
```
121+
<?xml version="1.0" encoding="ISO-8859-1" ?>
122+
<LOGOUT_RESPONSE>
123+
<ErrorCode>num</ErrorCode>
124+
</LOGOUT_RESPONSE>
125+
```
126+
127+
**`ErrorCode`**
128+
`0` Logout successful
129+
`-1` System currently not available
130+
131+
### Session Status
132+
By querying thesession status it can be checked if a HTTP-session is still valid. Atthe same time this function can be used to keep the session alive. This means that the session can be kept active for a longer time and reused for later transactions.
133+
134+
#### Request
135+
URL: `https://<fqdn><clientpath>/root/extras/sessionstatus`
136+
Method: `GET`
137+
138+
####Response
139+
```
140+
<?xml version="1.0" encoding="ISO-8859-1" ?>
141+
<SESSIONSTATUS_RESPONSE>
142+
<ErrorCode>num</ErrorCode>
143+
<LoginTime>datetime</LoginTime>
144+
</SESSIONSTATUS_RESPONSE >
145+
```
146+
147+
**`ErrorCode`**
148+
`0` Session is valid
149+
`-1` Session is invalid or system is currently unavailable
150+
151+
**`LoginTime`**
152+
Login time of the current session in the format YYYY-MM-DD HH:MM:SS.mmm. In case of an invalid session this field stays empty.
153+
154+
### Go-Online
155+
#### Request
156+
URL: `https://<fqdn><clientpath>/root/extras/go-online?Page=main`
157+
Method: `GET`
158+
159+
**Parameters**
160+
`page` values: `main` (default) With the parameter value "main" the main entry page is returned as if the user logged in online. `dtaoverview` The parameter value "dtaoverview" returns the page "Overview of datatransfers". If parameter is omitted, "main" is taken as the default.

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2015 Codegestalt GmbH, Rodrigo Haenggi
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
**ATTENTION:** This gem is work in progress and not usable at the moment.
2+
3+
# Logix
4+
Ruby wrapper for the Crealogix E-Banking web "offline-tool" (API).
5+
6+
# Quick start
7+
Install via Rubygems
8+
9+
`gem install logix`
10+
11+
... or add to your Gemfile
12+
13+
`gem "logix"`
14+
15+
## Usage
16+
**Certificate & Private key:** To be able to connect to your bank you need a valid Certificate and Private Key (usually issued by your Bank / Crealogix).
17+
You can either provide the path using the constructor or set the predefined environment variables `LOGIX_CERTIFICATE` and `LOGIX_PRIVATE_KEY`.
18+
19+
**Example:**
20+
`client = Logix::Client.new(password: 'y0l0', certificate: "./path/to/certificate.crt.pem", private_key: "./path/to/private.key.pem")`
21+
22+
**Login:**
23+
`client.login!`
24+
25+
### First time login and Certificate activation
26+
If this is your first time using the certificate to login in you need to activate it first. After the activation you need to change the password on your first login.
27+
This can be done with following two steps.
28+
29+
`client.activate!(code_a: "aaa", code_b: "bbb")`
30+
31+
after the certificate has been verified you need to login for the first while also setting a new password:
32+
33+
`client.login!(password: "initialpassword", new_password: "new_password")`
34+
35+
**NOTE:** If the `new_password` option is defined it will ALWAYS overrite the current password. This is handy should you want to change your password in the future.
36+
37+
### Environment Variables
38+
Instead of providing all attributes to the constructor you can also set following environment variables instead:
39+
40+
- `LOGIX_FQDN` the fully qualified domain name of your bank. Example: `"something.bankname.ch"`
41+
- `LOGIX_PASSWORD` your login password.
42+
- `LOGIX_CERTIFICATE` path to the certificate file.
43+
- `LOGIX_PRIVATE_KEY` path to the private key file.
44+
45+
## Bank specific settings
46+
Various endpoints to the API can differ from Bank to Bank. These are what I think are "defaults" used by Crealogix.
47+
You can always change them using the constructor.
48+
49+
- `soft_cert_authentication_endpoint` the endpoint where the login happens. Default value: `/softCertLogin`
50+
- `soft_cert_activation_endpoint` the endpoint that is used for the initial certificate verification (only happens once). Default value: `/softCertActivation`

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require "bundler/gem_tasks"

bin/console

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env ruby
2+
3+
require "bundler/setup"
4+
require "logix"
5+
6+
# You can add fixtures and/or initialization code here to make experimenting
7+
# with your gem easier. You can also use a different console, if you like.
8+
9+
# (If you use this, don't forget to add pry to your Gemfile!)
10+
# require "pry"
11+
# Pry.start
12+
13+
require "irb"
14+
IRB.start

bin/setup

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
IFS=$'\n\t'
4+
5+
bundle install
6+
7+
# Do any other automated setup that you need to do here

lib/logix.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'logix/client'

0 commit comments

Comments
 (0)