synapseruby 1.0.6 → 1.0.7

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: f2ec61a12be269799de1e59029ec944b83deb237
4
- data.tar.gz: f0e595fb6c21ab5c93ae3e89f52277a42a13001e
3
+ metadata.gz: c72881b56ac6c7d24df4fcd8557efe4f425ce3bf
4
+ data.tar.gz: cf9741cdeefcca8d5b548bb13f323e17ad36c7a0
5
5
  SHA512:
6
- metadata.gz: d4686cdc4f9a8d13c427f9bb51b01773c6e8c68571d721c06b7e2afa790d56eaa331933660c2a5a7618bd3e0912ab125b4ea93ae7ac712ddc286f89a776570fa
7
- data.tar.gz: 5fdadbbc37377a92c42f6478ed52a927a0486e06f9535718945d00963106640178996733a525ff0a5bf67522f580fcf417c3e10ba5f918548228642da2bfca7d
6
+ metadata.gz: e433989b2f426139e297503438c07c99425aa697157ac10efd00caede14fa72408f062fe1e5ec7fd01a8f8a3ad92219ef11c73c48834fde767ec3b4ccd61bef9
7
+ data.tar.gz: aee054c111573007c2478d204bcafb7bcf8f52a16cd06b1f13cd69e970e09e87ecb9a5c329c7c00c385ffec8f5635765b3d65f55408614d8f40f41f2b0a2e697
@@ -1,18 +1,10 @@
1
- require_relative './http_request'
2
- require 'open-uri'
3
- require 'json'
4
- require_relative './error'
5
- require_relative './node'
6
- require_relative './nodes'
7
- require_relative './transaction'
8
- require_relative './transactions'
9
-
10
1
  module Synapse
11
2
  # Wrapper class for /users endpoints
12
3
  class User
13
4
 
14
5
  # Valid optional args for #get
15
- VALID_QUERY_PARAMS = [:query, :page, :per_page, :type, :full_dehydrate, :ship, :force_refresh].freeze
6
+ VALID_QUERY_PARAMS = [:query, :page, :per_page, :type, :full_dehydrate, :ship, :force_refresh, :is_credit,
7
+ :subnetid, :foreign_transaction,].freeze
16
8
 
17
9
  attr_accessor :client, :user_id,:refresh_token, :oauth_key, :expires_in, :payload, :full_dehydrate
18
10
 
@@ -554,18 +546,21 @@ module Synapse
554
546
 
555
547
  # Initiates dummy transactions to a node
556
548
  # @param node_id [String]
557
- # @param is_credit [Boolean], for credit send true, for debit send false
549
+ # @param is_credit [String]
550
+ # @param foreign_transaction [String]
551
+ # @param subnetid [String]
552
+ # @param type [String]
558
553
  # @see https://docs.synapsefi.com/docs/trigger-dummy-transactions
559
- def dummy_transactions(node_id:, is_credit: nil)
560
- is_credit = "YES" if is_credit == true
561
- is_credit = "NO" if is_credit == false
554
+ def dummy_transactions(node_id:, **options)
555
+
556
+ path = node(user_id: self.user_id, node_id: node_id) + "/dummy-tran"
562
557
 
563
- if is_credit
564
- path = node(user_id: self.user_id, node_id: node_id) + "/dummy-tran?#{is_credit}"
565
- else
566
- path = node(user_id: self.user_id, node_id: node_id) + "/dummy-tran"
567
- end
568
558
 
559
+ params = VALID_QUERY_PARAMS.map do |p|
560
+ options[p] ? "#{p}=#{options[p]}" : nil
561
+ end.compact
562
+ path += '?' + params.join('&') if params.any?
563
+ print(path)
569
564
  begin
570
565
  response = client.get(path)
571
566
  rescue Synapse::Error::Unauthorized
@@ -5,7 +5,7 @@
5
5
  # rake release
6
6
  module Synapse
7
7
  # Gem version
8
- VERSION = '1.0.6'.freeze
8
+ VERSION = '1.0.7'.freeze
9
9
  end
10
10
 
11
11
 
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synapseruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Mawutor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-12 00:00:00.000000000 Z
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -122,12 +122,7 @@ files:
122
122
  - lib/synapse_api/users.rb
123
123
  - lib/synapse_api/version.rb
124
124
  - lib/synapse_fi.rb
125
- - pkg/synapseruby-1.0.0.gem
126
- - pkg/synapseruby-1.0.1.gem
127
- - pkg/synapseruby-1.0.2.gem
128
- - pkg/synapseruby-1.0.3.gem
129
- - pkg/synapseruby-1.0.4.gem
130
- - pkg/synapseruby-1.0.5.gem
125
+ - pkg/synapseruby-1.0.7.gem
131
126
  - samples.md
132
127
  - synapse_fi.gemspec
133
128
  - yarn.lock
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file