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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/bluepan_client.rb +3 -0
- data/lib/bluepan_client/client.rb +6 -0
- data/lib/bluepan_client/models/exchange_rate.rb +9 -0
- data/lib/bluepan_client/requests/create_remittance_request.rb +16 -16
- data/lib/bluepan_client/requests/get_exchange_rates_request.rb +11 -0
- data/lib/bluepan_client/responses/get_exchange_rates_response.rb +14 -0
- data/lib/bluepan_client/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83a7b193c1009bada8d2ff8fc80363507a3abf61
|
4
|
+
data.tar.gz: 47abeb0a3f8b83341557c228942afbd8e4a2ee31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b1389b8257af454021f480f480e48e97d22b4225501ed985afdecccd5747a05ee42e0a6a23cd5e4b0dd8c285c7175cf92469d067eee90055cb2d092d185f10b
|
7
|
+
data.tar.gz: 242567e9dfa2ee3e7d5575e90a575a4eeaed53546354c1eafeb6c0af02ec8d0c5434280dce99bccc9f7d5a6ac81821d32a856853e36838c5065230b6d306a0c0
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/bluepan_client.rb
CHANGED
@@ -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
|
@@ -3,22 +3,22 @@ module BluepanClient
|
|
3
3
|
|
4
4
|
PATH = "/v1/:api_token/remittances"
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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,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
|
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.
|
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:
|
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.
|
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:
|