Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
API calls with JSON format
Browse files Browse the repository at this point in the history
Changed parameters format from query to json in API calls
  • Loading branch information
piotrjozwiak committed Dec 19, 2018
1 parent fac46f2 commit 3e74329
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Model/CardTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public function createCardTransaction($transactionData)
$url = "{$this->urlApi}/{$this->apiKey}";
$transactionData['json'] = 1;

return (array)json_decode(Curl::doCurlRequest($url, $transactionData));

return json_decode(Curl::doCurlRequest($url, $transactionData), true);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tpaycom/magento2cards",
"description": "tpay.com card payments module",
"type": "magento2-module",
"version": "1.3.1",
"version": "1.3.2",
"license": [
"OSL-3.0"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="tpaycom_magento2cards" setup_version="1.3.1">
<module name="tpaycom_magento2cards" setup_version="1.3.2">
<sequence>
<module name="Magento_Sales" />
<module name="Magento_Payment" />
Expand Down
2 changes: 1 addition & 1 deletion lib/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function doCurlRequest($url, $postData = [])
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_URL, $url);
Expand Down

0 comments on commit 3e74329

Please sign in to comment.