basecomm_sdk 1.1.6 → 1.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1da749fdf2e66ef1f44866609d0182c62febad8b
4
- data.tar.gz: ce7cd92b9fa957e5fe20dc5b5117ec2e5347c7d4
3
+ metadata.gz: dbf7365333973a1e8379b6bb2848db5299184dbb
4
+ data.tar.gz: 9b5235ab28864cd3dd878fe02f8295ae23aed324
5
5
  SHA512:
6
- metadata.gz: 3294d41146a580dcbe15fba9f067d7a0272aa06ff3fdcbf28477b7b7d1125da17adddc1db9d739a04c7c1dce6e442e87a7a422bd0c64061d7f5603ceb3555b3c
7
- data.tar.gz: 478feceb7116b6b19c269229b80043d523519f71b19c702a9f1ea4ed3e3f0603489de1176164f87c5aea27987c713fcfeaa940ca0f25b3b3376f6a6c22883bf5
6
+ metadata.gz: 56acd7e96ed26f2dbbb77e5c0614d3097ca951c6875ce533903a91612bf51017880be291e2f1370174495c4c0184ed13005e083784486716f301997faeb73705
7
+ data.tar.gz: 09c277cc003d66d0baa4a946f0b2df4e66e6ad5331982f33622a1cb00c8849791fcff37f3de7883f9c38692765ada596cf8acc486ac9fcda9ff6914ac231ea8a
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *1.1.7* (March 30, 2015)
2
+
3
+ * The transaction returns a datetime for status date instead of a string
4
+
1
5
  *1.1.6* (March 30, 2015)
2
6
 
3
7
  * Status date returns creation date if status is created
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Base Commerce SDK
2
2
 
3
- **Version: 1.1.6**
3
+ **Version: 1.1.7**
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
 
@@ -64,7 +64,7 @@ module BasecommSdk
64
64
  end
65
65
 
66
66
  def status_date
67
- case status_name
67
+ the_date = case status_name
68
68
  when STATUS[:xs_bat_status_created]
69
69
  creation_date
70
70
  when STATUS[:xs_bat_status_returned]
@@ -75,7 +75,9 @@ module BasecommSdk
75
75
  effective_date
76
76
  else
77
77
  Time.now.strftime('%m/%d/%Y %H:%M:%S')
78
- end
78
+ end
79
+
80
+ DateTime.strptime(the_date, '%m/%d/%Y %H:%M:%S')
79
81
  end
80
82
 
81
83
  def account_name=(name)
@@ -1,3 +1,3 @@
1
1
  module BasecommSdk
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  end
@@ -124,30 +124,31 @@ module BasecommSdk
124
124
  context '.status_date' do
125
125
  it 'returns settlement_date if settled' do
126
126
  bat = described_class.from_json(bat_settled_json)
127
- expect(bat.status_date).to eq(bat.settlement_date)
127
+ expect(bat.status_date).to eq(DateTime.strptime(bat.settlement_date, '%m/%d/%Y %H:%M:%S'))
128
128
  end
129
129
 
130
130
  it 'returns return_date if returned (or corrected)' do
131
131
  bat = described_class.from_json(bat_returned_json)
132
- expect(bat.status_date).to eq(bat.return_date)
132
+ expect(bat.status_date).to eq(DateTime.strptime(bat.return_date, '%m/%d/%Y %H:%M:%S'))
133
133
  end
134
134
 
135
135
  it 'returns effective_date for initiated' do
136
- Timecop.freeze(Time.now)
137
136
  bat = described_class.from_json(bat_initiated_json)
138
- expect(bat.status_date).to eq(bat.effective_date)
137
+ expect(bat.status_date).to eq(DateTime.strptime(bat.effective_date, '%m/%d/%Y %H:%M:%S'))
139
138
  end
140
139
 
141
140
  it 'returns created_date for created' do
142
- Timecop.freeze(Time.now)
143
141
  bat = described_class.from_json(bat_created_json)
144
- expect(bat.status_date).to eq(bat.creation_date)
142
+ expect(bat.status_date).to eq(DateTime.strptime(bat.creation_date, '%m/%d/%Y %H:%M:%S'))
145
143
  end
146
144
 
147
145
  it 'returns now by default' do
148
- Timecop.freeze(Time.now)
146
+ now = Time.now
147
+ Timecop.freeze(now)
149
148
  bat = described_class.from_json(bat_failed_json)
150
- expect(bat.status_date).to eq(Time.now.strftime('%m/%d/%Y %H:%M:%S'))
149
+ now_string = now.strftime('%m/%d/%Y %H:%M:%S')
150
+ expect(bat.status_date).to eq(DateTime.strptime(now_string, '%m/%d/%Y %H:%M:%S'))
151
+ Timecop.return
151
152
  end
152
153
  end
153
154
 
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.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Blackburn