sofort 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3111d7330bfd101f852bbbccd07d5f196545068a
4
- data.tar.gz: 8bae4442e64adcac9d46b7b7ae49da6036b480d7
3
+ metadata.gz: 4b01ac9516d16ce8f293e3c236f74648e49ad4aa
4
+ data.tar.gz: 7f7c07e0a9c93e638779e17805adf935cf7a79f6
5
5
  SHA512:
6
- metadata.gz: 290a84bca4ee09095bffa1e62e7a57a5cad03e54b052844c052b8f256d0027ead2be1ff1def16fae0a1b1c96758bd55ce27c0d237dedb2f3399e067693232308
7
- data.tar.gz: 6d5bf6bfe1cbba7e36d8f71c54b7855f737d50fbb47a657190cc63e8950230413e784aaa4427014592b1ac2d8a15a244d4e8a40a7b889ece5d0b7fd100fdd9ae
6
+ metadata.gz: a1b246ce1898c42316672d375c6d94e51c65113ef6495f05e7beed5a09c318406c773a7b33fc8cf3f8c0e33f5d79f59d620361b227abeb081f60eaaf0b50e6bf
7
+ data.tar.gz: 14acc4d3fcac9c4232bb101ec04139c354ffb9d004248d9a6c981c56c771e5f7703243a205829771d5a09e5ab7c109f8521c88af53c73f2e4a660e24eba2031f
data/README.md CHANGED
@@ -30,7 +30,7 @@ Or install it yourself as:
30
30
  ### Example of pay
31
31
  you can set more attributes, please look at config/initializers/sofort.rb
32
32
  ```ruby
33
- client.pay(12, 'skopu', { success_url: 'http://google.com', abort_url: 'https://google.com' } )
33
+ client.pay(12, 'skopu', { success_url: 'http://google.com', abort_url: 'https://google.com', notification_url: 'https://google.com' } )
34
34
  ```
35
35
  ```ruby
36
36
  => {"transaction"=>"89043-182942-5490DD29-53B3",
@@ -91,6 +91,32 @@ Or install it yourself as:
91
91
  "status_reason"=>"sofort_bank_account_needed",
92
92
  "time"=>"2014-12-16T17:16:21+01:00"}}}
93
93
  ```
94
+ ## Pure ruby usage
95
+
96
+ require 'sofort'
97
+ require 'sofort/client'
98
+
99
+ Sofort.setup do |config|
100
+ config.base_url = 'https://api.sofort.com/api/xml'
101
+ config.user_id = 'id'
102
+ config.api_key = 'key'
103
+ config.abort_url = 'http:/google.pl'
104
+ config.success_url = 'http:/google.pl'
105
+ config.notification_url = 'http:/google.pl'
106
+ config.language_code = 'de'
107
+ config.email_customer = 'sebastian.skopp@gmail.com'
108
+ config.notification_email = 'sebastian.skopp@gmail.com'
109
+ config.country_code = 'DE'
110
+ config.currency_code = 'EUR'
111
+ config.reason = 'Reason'
112
+ config.user_variable = 'user_variable'
113
+ config.project_id = 'project_id'
114
+ end
115
+
116
+ client = Sofort::Client.new
117
+
118
+ client.pay(12, 'skopu', { success_url: 'http://google.com', abort_url: 'https://google.com', notification_url: 'https://google.com' } )
119
+
94
120
  ## Contributing
95
121
 
96
122
  1. Fork it ( https://github.com/skopu/sofort/fork )
@@ -9,7 +9,6 @@ Sofort.setup do |config|
9
9
  config.language_code = 'de'
10
10
  config.email_customer = 'email_customer'
11
11
  config.notification_email = 'notification_email'
12
- config.project_id = 'project_id'
13
12
  config.country_code = 'DE'
14
13
  config.currency_code = 'EUR'
15
14
  config.reason = 'Reason'
data/lib/sofort.rb CHANGED
@@ -1,20 +1,30 @@
1
1
  require 'sofort/version'
2
2
  require 'sofort/client'
3
+ require 'active_support/core_ext/array/extract_options'
4
+ require 'active_support/core_ext/hash/conversions'
5
+ require 'active_support/core_ext/hash/keys'
3
6
 
4
7
  module Sofort
8
+ VALUES = [:user_id, :api_key, :base_url, :abort_url,
9
+ :success_url, :notification_url, :email_customer,
10
+ :notification_email, :project_id, :country_code,
11
+ :currency_code, :reason, :language_code,:user_variable]
12
+
13
+ VALUES.each do |method|
14
+ class_eval(<<-EOS, __FILE__, __LINE__ + 1)
15
+ @@#{method} = nil unless defined? @@#{method}
16
+ def self.#{method}
17
+ @@#{method}
18
+ end
19
+
20
+ @@#{method} = nil unless defined? @@#{method}
21
+ def self.#{method}=(obj)
22
+ @@#{method} = obj
23
+ end
24
+ EOS
25
+
26
+ end
5
27
 
6
- mattr_accessor :user_id
7
- mattr_accessor :api_key
8
- mattr_accessor :base_url
9
- mattr_accessor :abort_url
10
- mattr_accessor :success_url
11
- mattr_accessor :notification_url
12
- mattr_accessor :email_customer
13
- mattr_accessor :notification_email
14
- mattr_accessor :project_id
15
- mattr_accessor :country_code
16
- mattr_accessor :currency_code
17
- mattr_accessor :reason
18
28
 
19
29
  @@user_id = 'sofort_user_id'
20
30
  @@api_key = 'api_key'
@@ -1,3 +1,3 @@
1
1
  module Sofort
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
data/sofort-rails.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'sofort/version'
5
- require "active_support/all"
5
+
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "sofort"
8
8
  spec.version = Sofort::VERSION
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec", "~> 3.3.0"
24
24
  spec.add_development_dependency "webmock", "~> 1.22.2"
25
- spec.add_dependency "rails", "~> 4"
26
25
  spec.add_dependency "httparty", "~> 0.13.7"
27
26
  spec.add_dependency "xml-simple", "~> 1.1.5"
27
+ spec.add_dependency "activesupport", "~> 4.2.6"
28
+ spec.add_dependency "builder", "~> 3.2.2"
28
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sofort
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - skopu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-05 00:00:00.000000000 Z
11
+ date: 2016-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,47 +67,61 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.22.2
69
69
  - !ruby/object:Gem::Dependency
70
- name: rails
70
+ name: httparty
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '4'
75
+ version: 0.13.7
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '4'
82
+ version: 0.13.7
83
83
  - !ruby/object:Gem::Dependency
84
- name: httparty
84
+ name: xml-simple
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.13.7
89
+ version: 1.1.5
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.13.7
96
+ version: 1.1.5
97
97
  - !ruby/object:Gem::Dependency
98
- name: xml-simple
98
+ name: activesupport
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.1.5
103
+ version: 4.2.6
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.1.5
110
+ version: 4.2.6
111
+ - !ruby/object:Gem::Dependency
112
+ name: builder
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 3.2.2
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 3.2.2
111
125
  description: Gem for use Sofort Api in Ruby. Payments and check details. SOFORT Überweisung
112
126
  - Sofort Api Banking
113
127
  email: