lemonway_ruby 0.9.0 → 0.10.0

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
  SHA1:
3
- metadata.gz: 70a792ecb396068252188fb589ad90d8025face2
4
- data.tar.gz: 4d033dbe75086a7a7f6eca9c18703fd6276db7a5
3
+ metadata.gz: 3153217b475accc913d406d34c293c548bfe523b
4
+ data.tar.gz: 31b00de9b65e0e67162c29c4cfaed205e5a9cbed
5
5
  SHA512:
6
- metadata.gz: 6d5edd46c53e4ed3cbbb96cb5cbf28268056150151c040358395738fee045b5cd5603b23459fdd4cd30aec9c3a94803ebbd29caeefcfd73a6bbc9d7955439a9f
7
- data.tar.gz: 702d63a41f4ead4191b091e7586fc833203450c89b2f4821011afa7231aea0c9bf15a9932e3ae3e2b71ac5e606a071b23e06edbcd7ff48d22d666132222e84a5
6
+ metadata.gz: '0182446eb9b9096f44145ed7d92abdf90c383c87f7e4bec642ffa0747e2cbd0bee0921423ccdc6b123b997d86f4a5a86d51685de6a00539b8c46949e9bc5f35a'
7
+ data.tar.gz: 5a79cb6107d4b66ed2e56bc5336fdd31120b67ee72e3a5387c9aa26b9e2ed1c542c44c688d4d6680447ae17ad4b12e36a84bffe9e9bd0ad51f31aa1fd53f5ec6
data/README.md CHANGED
@@ -38,9 +38,10 @@ If you work with **Rails** :
38
38
  lemon_way_configuration = {
39
39
  login: ENV['LEMONWAY_LOGIN'],
40
40
  password: ENV['LEMONWAY_PASSWORD'],
41
- company: ENV['LEMONWAY_COMPANY']
41
+ company: ENV['LEMONWAY_COMPANY'],
42
+ society_wallet_id: ENV['LEMONWAY_SOCIETY_WALLET_ID']
42
43
  }
43
- lemon_way_configuration.merge!(sandbox: true) unless Rails.env.production?
44
+ lemon_way_configuration[:sandbox] = true unless Rails.env.production?
44
45
 
45
46
  LemonWay.configuration = lemon_way_configuration
46
47
  ```
@@ -112,6 +113,15 @@ This module allows you to prepare/debit a wallet to credit a bank account:
112
113
 
113
114
  Details of the [MoneyOut module](https://github.com/MesPetitsArtistes/lemon_way/wiki/MoneyOut).
114
115
 
116
+ ### P2P
117
+
118
+ This module allows you to transfer fund from a Wallet to another Wallet
119
+
120
+ * Send payment from a wallet to another wallet
121
+ * Get details on wallet to wallet transfer
122
+
123
+ Details of the [P2P module](https://github.com/MesPetitsArtistes/lemon_way/wiki/P2P).
124
+
115
125
  ## License
116
126
 
117
127
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -8,5 +8,5 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  task default: :spec
9
9
 
10
10
  task :console do
11
- exec 'irb -r lemon_way -I ./lib'
11
+ exec 'irb -r lemonway_ruby -I ./lib'
12
12
  end
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'bundler/setup'
5
- require 'lemon_way'
5
+ require 'lemonway_ruby'
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -9,11 +9,8 @@ module LemonWay
9
9
  class Client
10
10
  include HTTParty
11
11
 
12
- attr_reader :login, :password, :company, :env, :options
13
-
14
12
  DIRECTKIT_URL = \
15
13
  'https://sandbox-api.lemonway.fr/mb/{company_name}/{env}/directkitjson2/Service.asmx'.freeze
16
-
17
14
  REQUIRED_CONFIGURATION = %i[login password company].freeze
18
15
  DEFAULT_LANGUAGE = 'fr'.freeze
19
16
  DEFAULT_HEADERS = {
@@ -23,6 +20,8 @@ module LemonWay
23
20
  'Pragma' => 'no-cache'
24
21
  }.freeze
25
22
 
23
+ attr_reader :login, :password, :company, :society_wallet_id, :env, :options
24
+
26
25
  base_uri DIRECTKIT_URL
27
26
  debug_output $stdout
28
27
 
@@ -31,11 +30,12 @@ module LemonWay
31
30
  raise MissingConfigurationError.new
32
31
  end
33
32
 
34
- @login = options[:login]
35
- @password = options[:password]
36
- @company = options[:company]
33
+ %i[login password company society_wallet_id].each do |key|
34
+ instance_variable_set("@#{key}".to_sym, options.delete(key))
35
+ end
36
+
37
37
  @env = options[:sandbox] ? 'dev' : 'prod'
38
- @options = options.delete_if { |k, _v| REQUIRED_CONFIGURATION.include?(k) }
38
+ @options = options
39
39
  end
40
40
 
41
41
  def send_request(lw_method, version, params = {})
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lemon_way/error'
4
+
5
+ module LemonWay
6
+ class P2P
7
+ class << self
8
+ def send_payment(params = {})
9
+ LemonWay.client.send_request('SendPayment', '1.0', params)
10
+ end
11
+
12
+ def get_payment_details(params = {})
13
+ LemonWay.client.send_request('GetPaymentDetails', '1.0', params)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -20,7 +20,7 @@ module LemonWay
20
20
  end
21
21
 
22
22
  def response_keys
23
- %i[wallet moneyinweb trans form iban_register]
23
+ %i[wallet moneyinweb trans form iban_register trans_sendpayment]
24
24
  end
25
25
  end
26
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LemonWay
4
- VERSION = '0.9.0'.freeze
4
+ VERSION = '0.10.0'.freeze
5
5
  end
@@ -6,6 +6,7 @@ require 'lemon_way/wallet'
6
6
  require 'lemon_way/money_in'
7
7
  require 'lemon_way/money_out'
8
8
  require 'lemon_way/form'
9
+ require 'lemon_way/p2p'
9
10
  require 'lemon_way/middleware'
10
11
  require 'lemon_way/helpers/forms'
11
12
  require 'lemon_way/generators/id'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lemonway_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Ktifa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-07-12 00:00:00.000000000 Z
12
+ date: 2017-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -166,6 +166,7 @@ files:
166
166
  - lib/lemon_way/middleware.rb
167
167
  - lib/lemon_way/money_in.rb
168
168
  - lib/lemon_way/money_out.rb
169
+ - lib/lemon_way/p2p.rb
169
170
  - lib/lemon_way/railtie.rb
170
171
  - lib/lemon_way/response_adapter.rb
171
172
  - lib/lemon_way/version.rb
@@ -191,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
192
  version: '0'
192
193
  requirements: []
193
194
  rubyforge_project:
194
- rubygems_version: 2.5.1
195
+ rubygems_version: 2.6.11
195
196
  signing_key:
196
197
  specification_version: 4
197
198
  summary: Client for LemonWay Directkit API in JSON