six_saferpay 1.2.1 → 1.2.3

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
  SHA256:
3
- metadata.gz: a4dcccfabf4b881707c8da788ba5029fe21eb7767f25437a7f7e27f34c064dbd
4
- data.tar.gz: 1f1bc93b10ee325e2dbe154f5d6029ce453dea1523ebd73da2aa201f36cd2824
3
+ metadata.gz: 1ea96a4a1b6b8e55b6efead411c804f3d1f53988abb0aa6e5ca28b0621045c7f
4
+ data.tar.gz: 822a87104aee2873660031adc16ebd3cbecbf5158264a0249b8b8862f79756d9
5
5
  SHA512:
6
- metadata.gz: d6cd5b2df26536d3b1097755a3c1fbfbfcc1391200b23d79d89bdf2af6fe1d4820b57910627665c5a4607047b4e994e8331ba430f462f0c3388a6ca423f7d902
7
- data.tar.gz: 78593896fb7e48bd4cf92de1f3045fb0071db325bf5d8357c7528d81aa8a7cc637a6a1aed0da3ff9a5e8bfe168f81f9602e926b8b64e58ad57c835ba308cb69b
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
- TODO: Write usage instructions here
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 @register_alias
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
@@ -1,3 +1,3 @@
1
1
  module SixSaferpay
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.3"
3
3
  end
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{Write a short summary, because RubyGems requires one.}
13
- spec.description = %q{Write a longer description or delete this line.}
14
- spec.homepage = "https://github.com/fadendaten/six_saferpa://github.com/fadendaten/six_saferpay"
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.1
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: Write a longer description or delete this line.
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/six_saferpa://github.com/fadendaten/six_saferpay
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: Write a short summary, because RubyGems requires one.
324
+ summary: Gem for the SIX Saferpay API
322
325
  test_files: []