Skip to content

Commit 8102aa8

Browse files
committed
feat: backport user-agent changes
1 parent 12ad051 commit 8102aa8

File tree

5 files changed

+12
-40
lines changed

5 files changed

+12
-40
lines changed

CHANGELOG.md

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## CHANGELOG
22

3+
### 4.0.3 2022-06-29
4+
5+
* Backports User-Agent header changes
6+
37
### 4.0.2 2021-10-20
48

59
* Further fixes JSON encoding by dropping null key/values, sending values as strings where necessary (returning to previous behavior), and removing the `array_filter` from the previous release
@@ -26,128 +30,104 @@
2630
* Fixed a bug that did not allow users to be deleted
2731
* Removed various pieces of old code
2832

29-
3033
### 3.4.5 2020-05-07
3134

3235
* Added "Refund" and "Shipment Invoice" to the prefix and type lists
3336

34-
3537
### 3.4.4 2020-03-11
3638

3739
* Version bump with updated author
3840

39-
4041
### 3.4.3 2020-03-10
4142

4243
* Bumped version in package.json for Packagist
4344
* Updated README with release instructions
4445

45-
4646
### 3.4.2 2020-03-09
4747

4848
* Fixed a bug that would not create reports properly
4949
* Added unit tests for reports
5050

51-
5251
### 3.4.1 2018-04-13
5352

5453
* Added ability to set connection and response timeouts for all EasyPost actions (thanks mattjanssen!)
5554

56-
5755
### 3.4.0 2017-11-30
5856

5957
* Renamed `Object` class `EasyPostObject` since Object is a keyword in PHP7.2
6058

61-
6259
### 3.3.4 2017-05-24
6360

6461
* Fixed confusing Pickup example
6562
* Enabled Reports to retrieve without a type parameter
6663
* Use X-Client-User-Agent over X-EasyPost-Client-User-Agent
6764

68-
6965
### 3.3.3 2017-02-14
7066

7167
* Added get_rates method to Order objects
7268

73-
7469
### 3.3.2 2017-01-24
7570

7671
* Fixed compatibility issues with older PHP versions and the Report class
7772

78-
7973
### 3.3.1 2017-01-19
8074

8175
* Fixed Create for ScanForms
8276

83-
8477
### 3.3.0 2017-01-17
8578

8679
* Added basic CRUD methods for Webhooks
8780

88-
8981
### 3.2.1 2016-12-14
9082

9183
* Fixed error in Util.php they may have affected shipment_reports retrievals
9284

93-
9485
### 3.2.0 2016-12-12
9586

9687
* Added ability to create Report objects for shipment, tracker and payment_log reports
9788

98-
9989
### 3.1.3 2016-10-25
10090

10191
* Fixed warning message from Address Verify/VerifyStrict
10292

103-
10493
### 3.1.2 2016-09-16
10594

10695
* Added create_list for trackers
10796

108-
10997
### 3.1.1 2016-07-21
11098

11199
* Added Insurance support
112100

113-
114101
### 3.1.0 2016-06-02
115102

116103
* Renamed "Resource" class to "EasypostResource" since Resource is reserved in PHP7 (thanks ccovey!)
117104

118-
119105
### 3.0.3 2016-02-22
120106

121107
* Added ability to create top-level users
122108

123-
124109
### 3.0.2 2016-01-29
125110

126111
* Added 'verify' and 'verify_strict' options to Address creation
127112

128-
129113
### 3.0.1 2016-01-05
130114

131115
* Updated ReadMe (thanks browner12!)
132116
* Added DocBlock annotations to all methods (thanks browner12!)
133117

134-
135118
### 3.0.0 2015-12-18
136119

137120
* Fixed Shipment Retrieve by tracking_code
138121

139-
140122
### 2.1.2 2015-11-04
141123

142124
* Added Tracker.all example, and updated some old examples
143125

144-
145126
### 2.1.1 2015-07-01
146127

147128
* Removed cURL options for SSL version, timeout, and connect timeout. The
148129
default values for these options are acceptable.
149130

150-
151131
### 2.1.0 2015-04-10
152132

153133
* Added User and CarrierAccount resources and examples for each.
@@ -164,65 +144,53 @@ display errors in development.
164144
* Added support for additional HTTP methods PATCH and PUT.
165145
* EasyPost Objects are now Iterable.
166146

167-
168147
### 2.0.12 2015-02-04
169148

170149
* Added pickup class
171150
* Added pickup example
172151

173-
174152
### 2.0.11 2014-11-04
175153

176154
* Added tracker to shipment buy response
177155
* Updated tracker examples
178156

179-
180157
### 2.0.10 2014-07-07
181158

182159
* Added Item, Container, and Order resources.
183160

184-
185161
### 2.0.9 2014-04-08
186162

187163
* Updated the CA cert bundle.
188164

189-
190165
### 2.0.8 2013-12-29
191166

192167
* Added the ability to add negative filters to Shipment->lowest_rate by starting them with an exclamation mark.
193168

194-
195169
### 2.0.7 2013-11-08
196170

197171
* Added endpoint to create shipment from tracking code.
198172

199-
200173
### 2.0.6 2013-10-21
201174

202175
* Added Event resource for webhooks.
203176

204-
205177
### 2.0.5 2013-08-30
206178

207179
* API Addition: Batch.buy method added. Trigger the purchasing of labels after a successful Batch.create.
208180
* API Addition: Batch.scan_form method added. Quickly generate a scan_form for an entire batch.
209181

210-
211182
### 2.0.4 2013-07-31
212183

213184
* API Addition: Tracker objects added. Trackers can be used to register any tracking code with EasyPost webhooks.
214185

215-
216186
### 2.0.3 2013-07-16
217187

218188
* Bug fix: error messages should no longer be truncated to their first character.
219189

220-
221190
### 2.0.2 2013-07-05
222191

223192
* Added function to Address to all creating and verifying at the same time.
224193

225-
226194
### 2.0.1 2013-07-01
227195

228196
* Add label function to Shipment to request specific label file_formats (pdf, epl2, zpl).

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.2
1+
4.0.3

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@
4242
"EasyPost": "lib/"
4343
}
4444
},
45-
"version": "4.0.2"
45+
"version": "4.0.3"
4646
}

lib/EasyPost/EasyPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract class EasyPost
4040
/**
4141
* @var string
4242
*/
43-
const VERSION = '4.0.2';
43+
const VERSION = '4.0.3';
4444

4545
/**
4646
* get the API key.

lib/EasyPost/Requestor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ private function _requestRaw($method, $url, $params, $apiKeyRequired)
154154
$params = self::_encodeObjects($params);
155155

156156
$langVersion = phpversion();
157+
$phpVersion = phpversion();
158+
$osType = php_uname('s');
159+
$osVersion = php_uname('r');
160+
$osArch = php_uname('m');
157161
$uname = php_uname();
158162
$ua = array(
159163
'bindings_version' => EasyPost::VERSION,
@@ -166,7 +170,7 @@ private function _requestRaw($method, $url, $params, $apiKeyRequired)
166170
'Accept: application/json',
167171
"Authorization: Bearer {$myApiKey}",
168172
'Content-Type: application/json',
169-
'User-Agent: EasyPost/v2 PhpClient/' . EasyPost::VERSION,
173+
'User-Agent: EasyPost/v2 PhpClient/' . EasyPost::VERSION . " PHP/$phpVersion OS/$osType OSVersion/$osVersion OSArch/$osArch",
170174
'X-Client-User-Agent: ' . json_encode($ua),
171175
);
172176
if (EasyPost::$apiVersion) {

0 commit comments

Comments
 (0)