bluepan_client 0.3.0 → 0.4.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: 835660a6a72842d94ec8adf908185ef7e21cde23
4
- data.tar.gz: 5fd3cc2cea70e7ebe8d7d0f5e6df83f32f9facdd
3
+ metadata.gz: 83a7b193c1009bada8d2ff8fc80363507a3abf61
4
+ data.tar.gz: 47abeb0a3f8b83341557c228942afbd8e4a2ee31
5
5
  SHA512:
6
- metadata.gz: 15b91d9c9ed0eb9169d63727585cc22fe1c991fdbc03a91b618b0c08082fd749b030173703210942a5e03fd1a4b1f443d40434a9826e22227fa08f94740222fb
7
- data.tar.gz: 3cf7fab0ebc60658e5578983631de647be1eaa3fd5798fefd5f1c0f92e56878b4d19c57291346465f4a7d9d75ff8d238593a9f7c073c0503c501d8dcbfaa9597
6
+ metadata.gz: 9b1389b8257af454021f480f480e48e97d22b4225501ed985afdecccd5747a05ee42e0a6a23cd5e4b0dd8c285c7175cf92469d067eee90055cb2d092d185f10b
7
+ data.tar.gz: 242567e9dfa2ee3e7d5575e90a575a4eeaed53546354c1eafeb6c0af02ec8d0c5434280dce99bccc9f7d5a6ac81821d32a856853e36838c5065230b6d306a0c0
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [0.4.0] - 2017-06-13
8
+ ### Added
9
+ - Add `client.get_exchange_rates`
10
+
7
11
  ## [0.3.0] - 2016-11-15
8
12
  ### Added
9
13
  - Add ability to get error messages in responses
@@ -12,6 +12,7 @@ require "bluepan_client/schemas/create_recipient_schema"
12
12
  require "bluepan_client/schemas/get_recipient_schema"
13
13
  require "bluepan_client/schemas/create_remittance_schema"
14
14
  require "bluepan_client/models/city"
15
+ require "bluepan_client/models/exchange_rate"
15
16
  require "bluepan_client/models/province"
16
17
  require "bluepan_client/models/recipient"
17
18
  require "bluepan_client/models/remittance"
@@ -19,6 +20,7 @@ require "bluepan_client/models/strategy"
19
20
  require "bluepan_client/client"
20
21
  require "bluepan_client/requests/base_request"
21
22
  require "bluepan_client/requests/get_cities_request"
23
+ require "bluepan_client/requests/get_exchange_rates_request"
22
24
  require "bluepan_client/requests/get_provinces_request"
23
25
  require "bluepan_client/requests/get_strategies_request"
24
26
  require "bluepan_client/requests/create_recipient_request"
@@ -26,6 +28,7 @@ require "bluepan_client/requests/create_remittance_request"
26
28
  require "bluepan_client/requests/get_recipient_request"
27
29
  require "bluepan_client/responses/base_response"
28
30
  require "bluepan_client/responses/get_cities_response"
31
+ require "bluepan_client/responses/get_exchange_rates_response"
29
32
  require "bluepan_client/responses/get_provinces_response"
30
33
  require "bluepan_client/responses/get_strategies_response"
31
34
  require "bluepan_client/responses/recipient_response"
@@ -47,5 +47,11 @@ module BluepanClient
47
47
  CreateRemittanceResponse.new(raw_response: raw_response)
48
48
  end
49
49
 
50
+ def get_exchange_rates
51
+ request = GetExchangeRatesRequest.new(attributes)
52
+ raw_response = request.()
53
+ GetExchangeRatesResponse.new(raw_response: raw_response)
54
+ end
55
+
50
56
  end
51
57
  end
@@ -0,0 +1,9 @@
1
+ module BluepanClient
2
+ class ExchangeRate
3
+
4
+ include Virtus.model
5
+ attribute :rate, Float
6
+ attribute :currency_pair, String
7
+
8
+ end
9
+ end
@@ -3,22 +3,22 @@ module BluepanClient
3
3
 
4
4
  PATH = "/v1/:api_token/remittances"
5
5
 
6
- attribute :paymethod, String
7
- attribute :dest_currency, String
8
- attribute :amount, Float
9
- attribute :recipientseq, Integer
10
- attribute :strategyseq, Integer
11
- attribute :provinceseq, Integer
12
- attribute :cityseq, Integer
13
- attribute :accountname, String
14
- attribute :accountnumber, String
15
- attribute :branch, String
16
- attribute :alipayid, String
17
- attribute :wechatid, String
18
- attribute :nick, String
19
- attribute :payment_url, String
20
- attribute :payment_account, String
21
- attribute :payment_password, String
6
+ attribute :paymethod, String
7
+ attribute :dest_currency, String
8
+ attribute :amount, Float
9
+ attribute :recipientseq, Integer
10
+ attribute :strategyseq, Integer
11
+ attribute :provinceseq, Integer
12
+ attribute :cityseq, Integer
13
+ attribute :accountname, String
14
+ attribute :accountnumber, String
15
+ attribute :branch, String
16
+ attribute :alipayid, String
17
+ attribute :wechatid, String
18
+ attribute :nick, String
19
+ attribute :payment_url, String
20
+ attribute :payment_account, String
21
+ attribute :payment_password, String
22
22
 
23
23
  def call
24
24
  HTTParty.post(uri, {
@@ -0,0 +1,11 @@
1
+ module BluepanClient
2
+ class GetExchangeRatesRequest < BaseRequest
3
+
4
+ PATH = "/v1/:api_token/rates"
5
+
6
+ def call
7
+ HTTParty.get(uri)
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ module BluepanClient
2
+ class GetExchangeRatesResponse < BaseResponse
3
+
4
+ attribute :exchange_rates, Array, lazy: true, default: :default_rates
5
+
6
+ private
7
+
8
+ def default_rates
9
+ parsed_body.map do |pair, rate|
10
+ ExchangeRate.new(currency_pair: pair, rate: rate)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module BluepanClient
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bluepan_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-15 00:00:00.000000000 Z
11
+ date: 2017-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus
@@ -188,6 +188,7 @@ files:
188
188
  - lib/bluepan_client/factories.rb
189
189
  - lib/bluepan_client/indifferent_hash.rb
190
190
  - lib/bluepan_client/models/city.rb
191
+ - lib/bluepan_client/models/exchange_rate.rb
191
192
  - lib/bluepan_client/models/province.rb
192
193
  - lib/bluepan_client/models/recipient.rb
193
194
  - lib/bluepan_client/models/remittance.rb
@@ -196,6 +197,7 @@ files:
196
197
  - lib/bluepan_client/requests/create_recipient_request.rb
197
198
  - lib/bluepan_client/requests/create_remittance_request.rb
198
199
  - lib/bluepan_client/requests/get_cities_request.rb
200
+ - lib/bluepan_client/requests/get_exchange_rates_request.rb
199
201
  - lib/bluepan_client/requests/get_provinces_request.rb
200
202
  - lib/bluepan_client/requests/get_recipient_request.rb
201
203
  - lib/bluepan_client/requests/get_strategies_request.rb
@@ -203,6 +205,7 @@ files:
203
205
  - lib/bluepan_client/responses/create_recipient_response.rb
204
206
  - lib/bluepan_client/responses/create_remittance_response.rb
205
207
  - lib/bluepan_client/responses/get_cities_response.rb
208
+ - lib/bluepan_client/responses/get_exchange_rates_response.rb
206
209
  - lib/bluepan_client/responses/get_provinces_response.rb
207
210
  - lib/bluepan_client/responses/get_recipient_response.rb
208
211
  - lib/bluepan_client/responses/get_strategies_response.rb
@@ -236,9 +239,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
239
  version: '0'
237
240
  requirements: []
238
241
  rubyforge_project:
239
- rubygems_version: 2.5.1
242
+ rubygems_version: 2.6.10
240
243
  signing_key:
241
244
  specification_version: 4
242
245
  summary: Ruby wrapper for Bluepan's API
243
246
  test_files: []
244
- has_rdoc: