basecomm_sdk 1.1.4 → 1.1.5

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: cd06ef7476c4ae5bd31583ba41b194e0ffebdf2e
4
- data.tar.gz: 75a78fd86571e7ebe514e03fdf1a520f6dc64be9
3
+ metadata.gz: 7077053c37e3bff20c17dcf43fad28ba7a69259a
4
+ data.tar.gz: 9e96e414ff8d23ae43e76b6248a309f37b28179b
5
5
  SHA512:
6
- metadata.gz: dbed7bca8113b239ff8c951f34c12caaa785442c999659a2465057ba8bcf3a66284a1ec890c2da7990d9226e5e0bec6ebf1a60078659d5301a180341011ca7c0
7
- data.tar.gz: 9b2ee34f908fc4aa208326d085c30af3e49da2116018c0c92af996fe9e71f58e4b9972802fc459b273379c64d551e3537c7df3dda6fc7ad75d9139fc3653046c
6
+ metadata.gz: 854bb28168b558c648caa6dfa27920e304d10524e40720d26cc22f043a099b2f73b5e2f8277c9db237e20b3c381dabc36e0e1b3cdcdeb5d1764fc9b75fddb1e6
7
+ data.tar.gz: 0f4f3aac087d73c938bc51f04f80268c3d1c04cf3a7dcd30a5fc03de0f7e78edc453e452722ec10935dcc11d488eb44d5f649a718099ffa12da7c8e6930984b9
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *1.1.5* (March 25, 2015)
2
+
3
+ * Status date defaults to current time and set status date correctly for initiated.
4
+
1
5
  *1.1.4* (March 25, 2015)
2
6
 
3
7
  * Account for JSON format changes for failures
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Base Commerce SDK
2
2
 
3
- **Version: 1.1.4**
3
+ **Version: 1.1.5**
4
4
 
5
5
  A gem for interfacing with the [Base Commerce](http://www.basecommerce.com/) API. This gem was developed with their help and serves to provide a Gem wrapper around their own Ruby SDK. Please contact them for more information about the Ruby SDK.
6
6
 
data/basecomm_sdk.gemspec CHANGED
@@ -37,4 +37,5 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency 'guard-rspec'
38
38
  spec.add_development_dependency 'guard-bundler'
39
39
  spec.add_development_dependency 'guard-rubocop'
40
+ spec.add_development_dependency 'timecop'
40
41
  end
@@ -64,10 +64,15 @@ module BasecommSdk
64
64
  end
65
65
 
66
66
  def status_date
67
- if status_name == STATUS[:xs_bat_status_returned]
68
- return_date
69
- else
70
- settlement_date
67
+ case status_name
68
+ when STATUS[:xs_bat_status_returned]
69
+ return_date
70
+ when STATUS[:xs_bat_status_settled]
71
+ settlement_date
72
+ when STATUS[:xs_bat_status_initiated]
73
+ effective_date
74
+ else
75
+ Time.now.strftime('%m/%d/%Y %H:%M:%S')
71
76
  end
72
77
  end
73
78
 
@@ -1,3 +1,3 @@
1
1
  module BasecommSdk
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
@@ -132,9 +132,16 @@ module BasecommSdk
132
132
  expect(bat.status_date).to eq(bat.return_date)
133
133
  end
134
134
 
135
- it 'returns settlement_date by default' do
135
+ it 'returns effective_date for initiated' do
136
+ Timecop.freeze(Time.now)
136
137
  bat = described_class.from_json(bat_initiated_json)
137
- expect(bat.status_date).to eq(bat.settlement_date)
138
+ expect(bat.status_date).to eq(bat.effective_date)
139
+ end
140
+
141
+ it 'returns now by default' do
142
+ Timecop.freeze(Time.now)
143
+ bat = described_class.from_json(bat_created_json)
144
+ expect(bat.status_date).to eq(Time.now.strftime('%m/%d/%Y %H:%M:%S'))
138
145
  end
139
146
  end
140
147
 
data/spec/spec_helper.rb CHANGED
@@ -37,6 +37,7 @@ FactoryGirl.define do
37
37
  skip_create
38
38
  end
39
39
  require_relative 'factories'
40
+ require 'timecop'
40
41
 
41
42
  RSpec.configure do |config|
42
43
  config.include FactoryGirl::Syntax::Methods
@@ -80,5 +80,12 @@ shared_context 'bat_response_methods' do
80
80
  status_description: 'Initiated Transaction'
81
81
  ).to_json
82
82
  end
83
+
84
+ def bat_created_json(opts = {})
85
+ bat_hash(
86
+ status_name: 'CREATED',
87
+ status_description: 'Created Transaction'
88
+ ).to_json
89
+ end
83
90
  end
84
91
  # rubocop:enable all
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basecomm_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Blackburn
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-25 00:00:00.000000000 Z
12
+ date: 2015-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dotenv
@@ -263,6 +263,20 @@ dependencies:
263
263
  - - '>='
264
264
  - !ruby/object:Gem::Version
265
265
  version: '0'
266
+ - !ruby/object:Gem::Dependency
267
+ name: timecop
268
+ requirement: !ruby/object:Gem::Requirement
269
+ requirements:
270
+ - - '>='
271
+ - !ruby/object:Gem::Version
272
+ version: '0'
273
+ type: :development
274
+ prerelease: false
275
+ version_requirements: !ruby/object:Gem::Requirement
276
+ requirements:
277
+ - - '>='
278
+ - !ruby/object:Gem::Version
279
+ version: '0'
266
280
  description: Ruby client gem for Base Commerce ACH provider
267
281
  email:
268
282
  - chris@gosimplefin.com