sofort 0.0.4 → 0.1.0

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: 44dd736e69ff1d78d775a47027128af7f67512d4
4
- data.tar.gz: 7c56369147b69d7ea4922bf098e5f1b525a0bced
3
+ metadata.gz: 3812c315bdf8f276afb128d495820df156dededd
4
+ data.tar.gz: 2dfba027b309ded48ba0d8032e469836ff004a6a
5
5
  SHA512:
6
- metadata.gz: 7b6f13c85581b584a5590b148c51e16e9a15c9e166d87c4ba9faa5b02d9c862b395df0a8d4603eb003193d61114aef3a28b5abf385d4886e8f8ddec470cd85a7
7
- data.tar.gz: 9def96b09045250868486bf34c98cd18a502f07bea11012240063119ed474078c599260c1ac0f625d60ea50b13c67db27e9a0d35594704c9d3bc8044cd7949de
6
+ metadata.gz: 389acf5610e2604083a279f6a93b27a74f15bd7624b7d1ce82fe16fe73988ffbcab850c2d145e52558ea95499c71342610ddf7adc4b18953d68c5e84a11588a4
7
+ data.tar.gz: 2b8fbe048617bc3f722fa913b14a647f44313d4c5d1bc41a7105984e271a867d820c8a5ed7fc2fcd17b7994a781bfb224a2b2bd126259ca720e6a697a35c0bc2
data/README.md CHANGED
@@ -1,14 +1,14 @@
1
- Not ready!
1
+ # Sofort
2
2
 
3
- # Sofort::Rails
3
+ Gem for use Sofort Api in Ruby. Payments and check details.
4
+ SOFORT Überweisung - Sofort Api Banking https://www.sofort.com/integrationCenter-eng-DE/content/view/full/2513
4
5
 
5
- TODO: Write a gem description
6
6
 
7
7
  ## Installation
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem 'sofort-rails'
11
+ gem 'sofort'
12
12
 
13
13
  And then execute:
14
14
 
@@ -16,15 +16,84 @@ And then execute:
16
16
 
17
17
  Or install it yourself as:
18
18
 
19
- $ gem install sofort-rails
19
+ $ gem install sofort
20
20
 
21
21
  ## Usage
22
-
23
- TODO: Write usage instructions here
24
-
22
+ generate initializer file(confing/initializers/sofort.rb). You can change a lot of defaults
23
+ ```ruby
24
+ rails g sofort:install
25
+ ```
26
+ init api client
27
+ ```ruby
28
+ client=Sofort::Client.new
29
+ ```
30
+ ### Example of pay
31
+ you can set more attributes, please look at config/initializers/sofort.rb
32
+ ```ruby
33
+ client.pay(12, 'skopu', { success_url: 'http://google.com', abort_url: 'https://google.com'})
34
+ ```
35
+ ```ruby
36
+ => {"transaction"=>"89043-182942-5490DD29-53B3",
37
+ "payment_url"=>
38
+ "https://www.sofort.com/payment/go/894515b4df08d438eb76320asdasde3383ed72ae80"}
39
+ ```
40
+ ### Example of details
41
+ #### When no results
42
+ ```ruby
43
+ client.details('89043-182942-5490DD29-53B3')
44
+ ```
45
+ ```ruby
46
+ => {"transactions"=>nil}
47
+ ```
48
+ #### When results
49
+ ```ruby
50
+ client.details('89043-182942-5490DD29-53B3')
51
+ ```
52
+ ```ruby
53
+ => {"project_id"=>"your project id",
54
+ "transaction"=>"89043-182942-5490DD29-53B3",
55
+ "test"=>"0",
56
+ "time"=>"2014-12-16T17:16:21+01:00",
57
+ "status"=>"untraceable",
58
+ "status_reason"=>"sofort_bank_account_needed",
59
+ "status_modified"=>"2014-12-16T17:16:21+01:00",
60
+ "payment_method"=>"su",
61
+ "language_code"=>"de",
62
+ "amount"=>"42.00",
63
+ "amount_refunded"=>"0.00",
64
+ "currency_code"=>"EUR",
65
+ "reasons"=>{"reason"=>"Order 212"},
66
+ "user_variables"=>nil,
67
+ "sender"=>
68
+ {"holder"=>"Payer Name",
69
+ "account_number"=>"12312312",
70
+ "bank_code"=>"12312312",
71
+ "bank_name"=>"Deutsche Bank AG",
72
+ "bic"=>"DEUTDEDBHAN",
73
+ "iban"=>"DE50250700240444432900",
74
+ "country_code"=>"DE"},
75
+ "recipient"=>
76
+ {"holder"=>"Clean on Demand UG",
77
+ "account_number"=>"12312312",
78
+ "bank_code"=>"12312312",
79
+ "bank_name"=>"Commerzbank AG",
80
+ "bic"=>"C12312312",
81
+ "iban"=>"DE12312312",
82
+ "country_code"=>"DE"},
83
+ "email_customer"=>"your@gmail.com",
84
+ "phone_customer"=>nil,
85
+ "exchange_rate"=>"1.0000",
86
+ "costs"=>{"fees"=>"0.63", "currency_code"=>"EUR", "exchange_rate"=>"1.0000"},
87
+ "su"=>{"consumer_protection"=>"0"},
88
+ "status_history_items"=>
89
+ {"status_history_item"=>
90
+ {"status"=>"untraceable",
91
+ "status_reason"=>"sofort_bank_account_needed",
92
+ "time"=>"2014-12-16T17:16:21+01:00"}}}
93
+ ```
25
94
  ## Contributing
26
95
 
27
- 1. Fork it ( https://github.com/[my-github-username]/sofort-rails/fork )
96
+ 1. Fork it ( https://github.com/skopu/sofort/fork )
28
97
  2. Create your feature branch (`git checkout -b my-new-feature`)
29
98
  3. Commit your changes (`git commit -am 'Add some feature'`)
30
99
  4. Push to the branch (`git push origin my-new-feature`)
@@ -11,6 +11,6 @@ Sofort.setup do |config|
11
11
  config.project_id = 'project_id'
12
12
  config.country_code = "DE"
13
13
  config.currency_code = "EUR"
14
- config.reson = "Reason"
14
+ config.reason = "Reason"
15
15
 
16
16
  end
data/lib/sofort/client.rb CHANGED
@@ -47,11 +47,12 @@ module Sofort
47
47
  end
48
48
 
49
49
  def pay_xml(amount, name, opts)
50
- reason = opts['reason'] || Sofort.reason
51
- currency_code = opts['currency_code'] || Sofort.currency_code
52
- country_code = opts['country_code'] || Sofort.country_code
53
- success_url = opts['success_url'] || Sofort.success_url
54
- abort_url = opts['abort_url'] || Sofort.abort_url
50
+ reason = opts[:reason] || Sofort.reason
51
+ currency_code = opts[:currency_code] || Sofort.currency_code
52
+ country_code = opts[:country_code] || Sofort.country_code
53
+ success_url = opts[:success_url] || Sofort.success_url
54
+ abort_url = opts[:abort_url] || Sofort.abort_url
55
+ email_customer = opts[:email_customer] || Sofort.email_customer
55
56
 
56
57
  {
57
58
  amount: amount,
@@ -63,7 +64,7 @@ module Sofort
63
64
  holder: name,
64
65
  country_code: country_code
65
66
  },
66
- email_customer: Sofort.email_customer,
67
+ email_customer: email_customer,
67
68
  notification_emails: {
68
69
  notification_email: Sofort.notification_email
69
70
  },
@@ -1,3 +1,3 @@
1
1
  module Sofort
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/sofort.rb CHANGED
@@ -28,5 +28,8 @@ module Sofort
28
28
  @@country_code = "DE"
29
29
  @@currency_code = "EUR"
30
30
  @@reson = "Reason"
31
-
31
+
32
+ def self.setup
33
+ yield self
34
+ end
32
35
  end
data/sofort-rails.gemspec CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["skopu"]
10
10
  spec.email = ["sebastian.skopp@gmail.com"]
11
11
  spec.summary = %q{Ruby Client for Sofort Api}
12
- spec.description = %q{The newest sofort Api}
13
- spec.homepage = ""
12
+ spec.description = %q{Gem for use Sofort Api in Ruby. Payments and check details. SOFORT Überweisung - Sofort Api Banking}
13
+ spec.homepage = "https://github.com/skopu/sofort"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sofort
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - skopu
@@ -108,7 +108,8 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- description: The newest sofort Api
111
+ description: Gem for use Sofort Api in Ruby. Payments and check details. SOFORT Überweisung
112
+ - Sofort Api Banking
112
113
  email:
113
114
  - sebastian.skopp@gmail.com
114
115
  executables: []
@@ -126,7 +127,7 @@ files:
126
127
  - lib/sofort/client.rb
127
128
  - lib/sofort/version.rb
128
129
  - sofort-rails.gemspec
129
- homepage: ''
130
+ homepage: https://github.com/skopu/sofort
130
131
  licenses:
131
132
  - MIT
132
133
  metadata: {}