m1_api 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/m1_api.rb +8 -14
  3. data/lib/m1_api/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 475e1c6fb04452314313521cd450258bdbe267261bf832473296682027a35c9b
4
- data.tar.gz: db5ebe7aaf45bed0c93ebc132d19d47017d5faba256ff489b6145c085d019c6d
3
+ metadata.gz: e4d85b86d6da758bbb881fbc582b88951bd0c046b6dbafe28536fad6129c42af
4
+ data.tar.gz: 93ab544f417bfb89c20de2ab102f964bbea565c4839224d3275815a6368df0d6
5
5
  SHA512:
6
- metadata.gz: 25cf2ab1e505f41201feff61a3a02349531c8fd1bbc1a36259d80c4d1d9a4384e3759cf92832eaeb58bc7f6df306cdb2477f91cf895c0d801bf143265be4f885
7
- data.tar.gz: 960d1e1f5650eead60a3a23396a37d8fd7e2fcaf7cf9324e38eef2b90ea24b8eb7c7addb533ee7e331a0f3ee4c3b6fb46d648ca01bf6c9899a97d78f238ec091
6
+ metadata.gz: 77f385dca21e6fdc43564ec8864ce0a94135560c84fab88129550c5ad44944954c498b6d22f88ff363a29a1b44762ce4e43fbc2067d1f3c9533c44c7eb79436e
7
+ data.tar.gz: 6e9559904f0e6ef78d58ef67524097d53a2e082fffbaa183773bee1e50fb9982df1ab4ea35e28b7b35fdc1cb973702e0a4bf1ed5692f1ad9dd7b15fc2b4e064b
@@ -63,29 +63,23 @@ class M1API
63
63
  @accounts_detail
64
64
  end
65
65
 
66
- def deposit(action, account_id, bank_id, transaction)
67
- case action
68
- when 'deposit'
69
- data = { token: @token, account_id: account_id, bank_id: bank_id, amount: transaction }
70
- YamlHelpers.call_api_from_config(@api_configs, :deposit, data)
71
- when 'cancel'
66
+ def deposit(account_id, bank_id, transaction, cancel = false)
67
+ if cancel
72
68
  data = { token: @token, account_id: account_id, bank_id: bank_id, transfer_id: transaction }
73
69
  YamlHelpers.call_api_from_config(@api_configs, :cancel_deposit, data)
74
70
  else
75
- output "Invalid deposit action: '#{action}'"
71
+ data = { token: @token, account_id: account_id, bank_id: bank_id, amount: transaction }
72
+ YamlHelpers.call_api_from_config(@api_configs, :deposit, data)
76
73
  end
77
74
  end
78
75
 
79
- def withdraw(action, account_id, bank_id, transaction)
80
- case action
81
- when 'withdraw'
82
- data = { token: @token, account_id: account_id, bank_id: bank_id, amount: transaction }
83
- YamlHelpers.call_api_from_config(@api_configs, :withdraw, data)
84
- when 'cancel'
76
+ def withdraw(account_id, bank_id, transaction, cancel = false)
77
+ if cancel
85
78
  data = { token: @token, account_id: account_id, bank_id: bank_id, transfer_id: transaction }
86
79
  YamlHelpers.call_api_from_config(@api_configs, :cancel_withdraw, data)
87
80
  else
88
- output "Invalid withdraw action: '#{action}'"
81
+ data = { token: @token, account_id: account_id, bank_id: bank_id, amount: transaction }
82
+ YamlHelpers.call_api_from_config(@api_configs, :withdraw, data)
89
83
  end
90
84
  end
91
85
  end
@@ -1,3 +1,3 @@
1
1
  class M1API
2
- VERSION = Version = '0.1.0'
2
+ VERSION = Version = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m1_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuan Feng
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-21 00:00:00.000000000 Z
11
+ date: 2019-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client