six_saferpay 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +61 -5
- data/lib/six_saferpay/api/six_transaction/requests/authorize.rb +1 -1
- data/lib/six_saferpay/version.rb +1 -1
- data/six_saferpay.gemspec +4 -4
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ea96a4a1b6b8e55b6efead411c804f3d1f53988abb0aa6e5ca28b0621045c7f
|
4
|
+
data.tar.gz: 822a87104aee2873660031adc16ebd3cbecbf5158264a0249b8b8862f79756d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fa4163aa019b661c4c3a4b7b76905e9bdfe12178b7a49f1c367ca8f1a0b6a786bf59e81278a1fafefd2845ced703a0ad18c46dd25c53b24ff4ae67a7589eeed
|
7
|
+
data.tar.gz: 47316d2aa1028ac01f58bfab01d4f3ad7125bdbc00c4304882c64f33c969617179fc379b73456fe3523aafdcc3bb9b76afc62b6f792535944c24c3bce6617bee
|
data/README.md
CHANGED
@@ -3,10 +3,6 @@
|
|
3
3
|
|
4
4
|
# SixSaferpay
|
5
5
|
|
6
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/six_saferpay`. To experiment with that code, run `bin/console` for an interactive prompt.
|
7
|
-
|
8
|
-
TODO: Delete this and the text above, and describe your gem
|
9
|
-
|
10
6
|
## Installation
|
11
7
|
|
12
8
|
Add this line to your application's Gemfile:
|
@@ -23,9 +19,69 @@ Or install it yourself as:
|
|
23
19
|
|
24
20
|
$ gem install six_saferpay
|
25
21
|
|
22
|
+
|
23
|
+
## Configuration
|
24
|
+
|
25
|
+
Please configure your gem:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
SixSaferpay.configure do |config|
|
29
|
+
config.customer_id = YOUR_SIX_SAFERPAY_CUSTOMER_ID
|
30
|
+
config.terminal_id = YOUR_SIX_SAFERPAY_TERMINAL_ID
|
31
|
+
config.username = YOUR_SIX_SAFERPAY_USERNAME
|
32
|
+
config.password = YOUR_SIX_SAFERPAY_PASSWORD
|
33
|
+
config.success_url = YOUR_SIX_SAFERPAY_SUCCESS_URL
|
34
|
+
config.fail_url = YOUR_SIX_SAFERPAY_FAIL_URL
|
35
|
+
config.base_url = YOUR_SIX_SAFERPAY_BASE_URL
|
36
|
+
config.css_url = YOUR_SIX_SAFERPAY_CSS_URL
|
37
|
+
end
|
38
|
+
|
39
|
+
```
|
40
|
+
|
26
41
|
## Usage
|
27
42
|
|
28
|
-
|
43
|
+
SIX Saferpay provides multiple interfaces. We give you a short introduction in the usage of the gem by showing you two examples for the initialize requests.
|
44
|
+
|
45
|
+
### SIX Saferpay Payment Page
|
46
|
+
|
47
|
+
The SIX Saferpay Payment Page is a simple implementation of the payment gateway of SIX.
|
48
|
+
|
49
|
+
#### PaymentPage Initialize
|
50
|
+
|
51
|
+
Before we start we have to create a two basic objects. The first object is the ```SixSaferpay::Amount```. This object represents the value of your cart in the currency you sell your products. The second object is the ```SixSaferpay::Payment```. This object represents the payment a user of your shop will do. As you can see, the amount object is includes in this object.
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
amount = SixSaferpay::Amount.new(value: 100, currency_code: "CHF")
|
55
|
+
payment = SixSaferpay::Payment.new(amount: amount, order_id: 1234, description: 'Order #1234')
|
56
|
+
```
|
57
|
+
|
58
|
+
After we create those two objects, we can create the initialize object for the SIX Saferpay Payment Page.
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
initialize = SixSaferpay::SixPaymentPage::Initialize.new(payment: payment)
|
62
|
+
```
|
63
|
+
|
64
|
+
Now we can send the initialize request to the API. We can use the client object to send a post request to the API.
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
initialize_response = SixSaferpay::Client.post(initialize)
|
68
|
+
```
|
69
|
+
The client will return a response object. After an initialize request, the client will return you a initialize response object (```SixSaferpay::InitializeResponse```).
|
70
|
+
|
71
|
+
If the request goes wrong the client raises a ```SixSaferpay::Error```
|
72
|
+
|
73
|
+
#### Other Requests
|
74
|
+
|
75
|
+
You will find for all the other requests an predefined object. Feel free to use this according the SIX Saferpay API documentation.
|
76
|
+
|
77
|
+
## Documentation
|
78
|
+
|
79
|
+
### SIX Saferpay Transaction
|
80
|
+
|
81
|
+
TODO
|
82
|
+
|
83
|
+
|
84
|
+
[https://saferpay.github.io/jsonapi](Saferpay JSON API)
|
29
85
|
|
30
86
|
## Development
|
31
87
|
|
@@ -25,7 +25,7 @@ module SixSaferpay
|
|
25
25
|
|
26
26
|
def to_hash
|
27
27
|
hash = Hash.new
|
28
|
-
hash.merge!(request_header: @request_header.to_h) if @
|
28
|
+
hash.merge!(request_header: @request_header.to_h) if @request_header
|
29
29
|
hash.merge!(token: @token) if @token
|
30
30
|
hash.merge!(condition: @condition) if @condition
|
31
31
|
hash.merge!(verification_code: @verification_code) if @verification_code
|
data/lib/six_saferpay/version.rb
CHANGED
data/six_saferpay.gemspec
CHANGED
@@ -6,12 +6,12 @@ require "six_saferpay/version"
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "six_saferpay"
|
8
8
|
spec.version = SixSaferpay::VERSION
|
9
|
-
spec.authors = ["Felix Langenegger"]
|
9
|
+
spec.authors = ["Fadendaten GmbH", "Felix Langenegger"]
|
10
10
|
spec.email = ["felix.langenegger@fadendaten.ch"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
14
|
-
spec.homepage = "https://github.com/fadendaten/
|
12
|
+
spec.summary = %q{Gem for the SIX Saferpay API}
|
13
|
+
spec.description = %q{This Gem helps you consume the SIX Saferpay API. Accoring the documentation of API of SIX Saferpay you can define your request models and get a response object back.}
|
14
|
+
spec.homepage = "https://github.com/fadendaten/six_saferpay"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
# Specify which files should be added to the gem when it is released.
|
metadata
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: six_saferpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Fadendaten GmbH
|
7
8
|
- Felix Langenegger
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
@@ -188,7 +189,9 @@ dependencies:
|
|
188
189
|
- - "~>"
|
189
190
|
- !ruby/object:Gem::Version
|
190
191
|
version: '0.1'
|
191
|
-
description:
|
192
|
+
description: This Gem helps you consume the SIX Saferpay API. Accoring the documentation
|
193
|
+
of API of SIX Saferpay you can define your request models and get a response object
|
194
|
+
back.
|
192
195
|
email:
|
193
196
|
- felix.langenegger@fadendaten.ch
|
194
197
|
executables: []
|
@@ -295,7 +298,7 @@ files:
|
|
295
298
|
- lib/six_saferpay/models/wallet.rb
|
296
299
|
- lib/six_saferpay/version.rb
|
297
300
|
- six_saferpay.gemspec
|
298
|
-
homepage: https://github.com/fadendaten/
|
301
|
+
homepage: https://github.com/fadendaten/six_saferpay
|
299
302
|
licenses:
|
300
303
|
- MIT
|
301
304
|
metadata: {}
|
@@ -318,5 +321,5 @@ rubyforge_project:
|
|
318
321
|
rubygems_version: 2.7.6
|
319
322
|
signing_key:
|
320
323
|
specification_version: 4
|
321
|
-
summary:
|
324
|
+
summary: Gem for the SIX Saferpay API
|
322
325
|
test_files: []
|