Skip to content

Commit 1df1010

Browse files
author
Antonio Buedo
authored
#v3.5.2003.0-rc - Security update (#39)
* - Http headers fix
1 parent aedf005 commit 1df1010

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/BitPaySDK/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
* Class Client
4545
* @package Bitpay
4646
* @author Antonio Buedo
47-
* @version 3.5.2002.1
47+
* @version 3.5.2003
4848
* See bitpay.com/api for more information.
49-
* date 26.02.2020
49+
* date 25.03.2020
5050
*/
5151
class Client
5252
{

src/BitPaySDK/Env.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Env
1111
const TestUrl = "https://test.bitpay.com/";
1212
const ProdUrl = "https://bitpay.com/";
1313
const BitpayApiVersion = "2.0.0";
14-
const BitpayPluginInfo = "BitPay_PHP_Client_v3.5.2002.1";
14+
const BitpayPluginInfo = "BitPay_PHP_Client_v3.5.2003";
1515
const BitpayApiFrame = "custom";
1616
const BitpayApiFrameVersion = "1.0.0";
1717
}

src/BitPaySDK/Util/RESTcli/RESTcli.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public function init()
4747
'base_url' => $this->_baseUrl,
4848
'defaults' => [
4949
'headers' => [
50-
"x-accept-version" => Env::BitpayApiVersion,
51-
'X-BitPay-Plugin-Info' => Env::BitpayPluginInfo,
50+
'x-accept-version' => Env::BitpayApiVersion,
51+
'x-bitpay-plugin-info' => Env::BitpayPluginInfo,
5252
'x-bitpay-api-frame' => Env::BitpayApiFrame,
5353
'x-bitpay-api-frame-version' => Env::BitpayApiFrameVersion,
5454
],
@@ -65,6 +65,10 @@ public function post($uri, array $formData = [], $signatureRequired = true): str
6565
$fullURL = $this->_baseUrl.$uri;
6666
$headers = [
6767
'Content-Type' => 'application/json',
68+
'x-accept-version' => Env::BitpayApiVersion,
69+
'x-bitpay-plugin-info' => Env::BitpayPluginInfo,
70+
'x-bitpay-api-frame' => Env::BitpayApiFrame,
71+
'x-bitpay-api-frame-version' => Env::BitpayApiFrameVersion,
6872
];
6973

7074
if ($signatureRequired) {
@@ -96,6 +100,10 @@ public function get($uri, array $parameters = null, $signatureRequired = true):
96100
$fullURL = $this->_baseUrl.$uri;
97101
$headers = [
98102
'Content-Type' => 'application/json',
103+
'x-accept-version' => Env::BitpayApiVersion,
104+
'x-bitpay-plugin-info' => Env::BitpayPluginInfo,
105+
'x-bitpay-api-frame' => Env::BitpayApiFrame,
106+
'x-bitpay-api-frame-version' => Env::BitpayApiFrameVersion,
99107
];
100108

101109
if ($parameters) {
@@ -134,6 +142,10 @@ public function delete($uri, array $parameters = null): string
134142
}
135143

136144
$headers = [
145+
'x-accept-version' => Env::BitpayApiVersion,
146+
'x-bitpay-plugin-info' => Env::BitpayPluginInfo,
147+
'x-bitpay-api-frame' => Env::BitpayApiFrame,
148+
'x-bitpay-api-frame-version' => Env::BitpayApiFrameVersion,
137149
'Content-Type' => 'application/json',
138150
'x-signature' => $this->_ecKey->sign($fullURL),
139151
'x-identity' => $this->_identity,
@@ -162,6 +174,10 @@ public function update($uri, array $formData = []): string
162174
try {
163175
$fullURL = $this->_baseUrl.$uri;
164176
$headers = [
177+
'x-accept-version' => Env::BitpayApiVersion,
178+
'x-bitpay-plugin-info' => Env::BitpayPluginInfo,
179+
'x-bitpay-api-frame' => Env::BitpayApiFrame,
180+
'x-bitpay-api-frame-version' => Env::BitpayApiFrameVersion,
165181
'Content-Type' => 'application/json',
166182
'x-signature' => $this->_ecKey->sign($fullURL.json_encode($formData)),
167183
'x-identity' => $this->_identity,

0 commit comments

Comments
 (0)