fondy 0.1.1 → 0.1.2

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: cd7a2cb3bab7cf8652c5c9ffb062092765c3875f
4
- data.tar.gz: 183b415692c4a4d742678c521c0ff32fbe585908
3
+ metadata.gz: 57bc5a72e4c5d272e31aed137929ea388a7c4b88
4
+ data.tar.gz: 138b4e44a69784bbf7f4d9d66617a82a77294b10
5
5
  SHA512:
6
- metadata.gz: 267dd9d9bf3f81466052f0f87a791ff7417bcac1c037825ef05e99f85929ddb5e48d999aa1d774b79fd6d7a64d964231d93b2a5b88d06989ca95c28056f46d4f
7
- data.tar.gz: 99ae2a12d7a4c778c377331c649318be714692952a7e6f4a50b884c521f36dcc5cdbf75e58245ae16d0dd05d6bae6cc7c743d2a150ede8d081e057972fdc5236
6
+ metadata.gz: d6d369d94c931eca6a7ea9faec46a1db670ffa109950f4d180ba66e39181cb1463f032dd56f5695c4749f455500a3fffeb4c078e13363deb2d90140e921a73c3
7
+ data.tar.gz: 0ac578585a0511c4f48be32479b559d0a0df07d8ca733eca74079d96d93ab2fdd27530b254d3ab3c362de747a93657879220adb0f57ba0d7641bdb04f71b002e
@@ -1,3 +1,4 @@
1
+ require 'json'
1
2
  require 'faraday'
2
3
 
3
4
  require 'fondy/version'
@@ -12,7 +12,7 @@ module Fondy
12
12
  merchant_id: merchant_id,
13
13
  order_id: order_id,
14
14
  }
15
- send_request(:post, "/api/status/#{order_id}", params)
15
+ send_request(:post, '/api/status/order_id', params)
16
16
  end
17
17
 
18
18
  def capture(order_id:, amount:, currency:)
@@ -22,7 +22,7 @@ module Fondy
22
22
  amount: amount,
23
23
  currency: currency,
24
24
  }
25
- send_request(:post, "/api/capture/#{order_id}", params)
25
+ send_request(:post, '/api/capture/order_id', params)
26
26
  end
27
27
 
28
28
  def reverse(order_id:, amount:, currency:, comment: nil)
@@ -33,7 +33,7 @@ module Fondy
33
33
  currency: currency,
34
34
  }
35
35
  params[:comment] = comment if comment
36
- send_request(:post, "/api/reverse/#{order_id}", params)
36
+ send_request(:post, '/api/reverse/order_id', params)
37
37
  end
38
38
 
39
39
  private
@@ -17,7 +17,7 @@ module Fondy
17
17
  connection.public_send(method) do |request|
18
18
  request.url url
19
19
  if body
20
- request.body = { request: body }.to_json
20
+ request.body = JSON.generate(request: body)
21
21
  request.headers['Content-Type'] = 'application/json'
22
22
  end
23
23
  end
@@ -10,7 +10,9 @@ module Fondy
10
10
  end
11
11
 
12
12
  def build
13
- filtered_params = params.reject { |k, _v| k.to_s == 'signature' }
13
+ filtered_params = params.reject do |k, v|
14
+ %w(signature response_signature_string).include?(k.to_s) || v.to_s.empty?
15
+ end
14
16
  params_str = filtered_params.sort_by(&:first).map(&:last).join('|')
15
17
  Digest::SHA1.hexdigest("#{password}|#{params_str}")
16
18
  end
@@ -1,3 +1,3 @@
1
1
  module Fondy
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fondy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Khrebtov