Skip to content

Commit fb024bd

Browse files
authored
Merge pull request #143 from blnce-io/add-user-agent
add user agent into the balance requests
2 parents 9bda677 + 482df82 commit fb024bd

File tree

5 files changed

+6
-2
lines changed

5 files changed

+6
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
22
ci/magento-coding-standard
3+
.DS_Store

Model/AbstractRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ protected function sendRequest()
172172
HttpConstants::HEADER_CONTENT_TYPE => HttpConstants::CONTENT_TYPE_APPLICATION_JSON,
173173
HttpConstants::HEADER_BALANCE_X_API_KEY => $this->_balancepayConfig->getApiKey(),
174174
HttpConstants::HEADER_BALANCE_SOURCE => HttpConstants::BALANCE_SOURCE_MAGENTO,
175+
HttpConstants::HTTP_USER_AGENT => HttpConstants::HTTP_HARDCODED_USER_AGENT,
175176

176177
];
177178
$this->_curl->setHeaders($headers);

Model/HttpConstants.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ class HttpConstants
1010

1111
public const CONTENT_TYPE_APPLICATION_JSON = 'application/json';
1212
public const BALANCE_SOURCE_MAGENTO = 'magento';
13+
public const HTTP_USER_AGENT = 'User-Agent';
14+
public const HTTP_HARDCODED_USER_AGENT = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Magento/20100101 Firefox/15.0.1';
1315
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"laminas/laminas-crypt": "^3.4.0"
77
},
88
"type": "magento2-module",
9-
"version": "1.4.0",
9+
"version": "1.4.4",
1010
"license": [
1111
"OSL-3.0",
1212
"AFL-3.0"

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
-->
1313
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
14-
<module name="Balancepay_Balancepay" setup_version="1.4.0">
14+
<module name="Balancepay_Balancepay" setup_version="1.4.4">
1515
<sequence>
1616
<module name="Magento_Sales"/>
1717
<module name="Magento_Payment"/>

0 commit comments

Comments
 (0)