bloom_remit_client 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +4 -0
- data/lib/bloom_remit_client.rb +1 -0
- data/lib/bloom_remit_client/coercers/indifferent_hash.rb +11 -0
- data/lib/bloom_remit_client/factories.rb +19 -0
- data/lib/bloom_remit_client/responses/base_response.rb +6 -1
- data/lib/bloom_remit_client/responses/billers_response.rb +1 -1
- data/lib/bloom_remit_client/responses/create_payment_response.rb +1 -1
- data/lib/bloom_remit_client/responses/create_sender_response.rb +1 -1
- data/lib/bloom_remit_client/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cf3bdf11ae936af4cbce95367f78077bd3ba046
|
4
|
+
data.tar.gz: 87970217a5a5aa828ad0b5be52f15cfa19b1b105
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27671383f4825bf63e170a06eca5d15bf3c93aa3020973656ead1cd6708bd69cce0a90d1436f66138314dcba0b4011b012ea0f382474abfe8e19a352553d1125
|
7
|
+
data.tar.gz: 0a8113dcb8a7819ee1ef89b6a3f8a3c69bd76498c246dab4c7b38c5789d1820a0e0ecf0c9d81880129a14f725e3be0932b322068f343dfaaf896ad7789ae67f9
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [0.3.0] - 2016-08-06
|
6
|
+
### Added
|
7
|
+
- Factories for app development
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
- Use BaseResponse#body to access the `to_hash`ed json response
|
11
|
+
|
5
12
|
## [0.2.0] - 2016-07-29
|
6
13
|
### Added
|
7
14
|
- Add ability to create sender
|
data/README.md
CHANGED
@@ -24,6 +24,10 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
TODO: Write usage instructions here
|
26
26
|
|
27
|
+
## Factories
|
28
|
+
|
29
|
+
To make testing easier, you may `require 'bloom_remit_client/factories'` in your app.
|
30
|
+
|
27
31
|
## Development
|
28
32
|
|
29
33
|
- Copy `spec/config.yml.sample` to `spec/config.yml` and put your credentials
|
data/lib/bloom_remit_client.rb
CHANGED
@@ -3,6 +3,7 @@ require 'httparty'
|
|
3
3
|
require 'active_model'
|
4
4
|
require 'active_support/core_ext/hash/indifferent_access'
|
5
5
|
require 'active_support/core_ext/object/try'
|
6
|
+
require 'bloom_remit_client/coercers/indifferent_hash'
|
6
7
|
require "bloom_remit_client/version"
|
7
8
|
require "bloom_remit_client/client"
|
8
9
|
require "bloom_remit_client/models/biller"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
|
3
|
+
factory :bloom_remit_client_biller, class: "BloomRemitClient::Biller" do
|
4
|
+
sequence(:slug) {|n| "biller_#{n}" }
|
5
|
+
first_field "Account No."
|
6
|
+
first_field_format "Alphanumeric"
|
7
|
+
first_field_width 30
|
8
|
+
second_field "Account Name"
|
9
|
+
second_field_format "Alphanumeric"
|
10
|
+
second_field_width 50
|
11
|
+
end
|
12
|
+
|
13
|
+
factory(:bloom_remit_client_create_payment_response, {
|
14
|
+
class: "BloomRemitClient::CreatePaymentResponse",
|
15
|
+
}) do
|
16
|
+
body { {"json" => "value"} }
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -3,10 +3,15 @@ module BloomRemitClient
|
|
3
3
|
|
4
4
|
include Virtus.model
|
5
5
|
attribute :raw_response, Object
|
6
|
+
attribute(:body, {
|
7
|
+
Coercers::IndifferentHash,
|
8
|
+
lazy: true,
|
9
|
+
default: :default_body,
|
10
|
+
})
|
6
11
|
|
7
12
|
private
|
8
13
|
|
9
|
-
def
|
14
|
+
def default_body
|
10
15
|
json = JSON.parse(raw_response.body)
|
11
16
|
|
12
17
|
if json.is_a?(Array)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bloom_remit_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.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
|
+
date: 2016-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -174,6 +174,8 @@ files:
|
|
174
174
|
- bloom_remit_client.gemspec
|
175
175
|
- lib/bloom_remit_client.rb
|
176
176
|
- lib/bloom_remit_client/client.rb
|
177
|
+
- lib/bloom_remit_client/coercers/indifferent_hash.rb
|
178
|
+
- lib/bloom_remit_client/factories.rb
|
177
179
|
- lib/bloom_remit_client/models/biller.rb
|
178
180
|
- lib/bloom_remit_client/models/payment.rb
|
179
181
|
- lib/bloom_remit_client/models/user.rb
|
@@ -207,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
209
|
version: '0'
|
208
210
|
requirements: []
|
209
211
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.
|
212
|
+
rubygems_version: 2.6.4
|
211
213
|
signing_key:
|
212
214
|
specification_version: 4
|
213
215
|
summary: Ruby wrapper around Bloom Remit's API
|