Version Notes
* Fix for order ids with special characters
Download this release
Release Info
Developer | Aplazame |
Extension | Aplazame_Aplazame |
Version | 0.4.4 |
Comparing to | |
See all releases |
Code changes from version 0.4.3 to 0.4.4
app/code/community/Aplazame/Aplazame/Model/Api/Client.php
CHANGED
@@ -2,6 +2,11 @@
|
|
2 |
|
3 |
class Aplazame_Aplazame_Model_Api_Client extends Varien_Object
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* @var Aplazame_Sdk_Api_Client
|
7 |
*/
|
@@ -9,8 +14,9 @@ class Aplazame_Aplazame_Model_Api_Client extends Varien_Object
|
|
9 |
|
10 |
public function __construct()
|
11 |
{
|
|
|
12 |
$this->apiClient = new Aplazame_Sdk_Api_Client(
|
13 |
-
|
14 |
(Mage::getStoreConfig('payment/aplazame/sandbox') ? Aplazame_Sdk_Api_Client::ENVIRONMENT_SANDBOX : Aplazame_Sdk_Api_Client::ENVIRONMENT_PRODUCTION),
|
15 |
Mage::getStoreConfig('payment/aplazame/secret_api_key'),
|
16 |
new Aplazame_Aplazame_Http_ZendClient()
|
@@ -23,7 +29,7 @@ class Aplazame_Aplazame_Model_Api_Client extends Varien_Object
|
|
23 |
*/
|
24 |
public function authorize($orderId)
|
25 |
{
|
26 |
-
return $this->apiClient->request(Varien_Http_Client::POST, '/orders/' . $orderId .
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -32,7 +38,7 @@ class Aplazame_Aplazame_Model_Api_Client extends Varien_Object
|
|
32 |
*/
|
33 |
public function fetchOrder($orderId)
|
34 |
{
|
35 |
-
$orders = $this->apiClient->request(Varien_Http_Client::GET, '/orders?mid=' . $orderId);
|
36 |
|
37 |
return $orders['results'][0];
|
38 |
}
|
@@ -66,6 +72,6 @@ class Aplazame_Aplazame_Model_Api_Client extends Varien_Object
|
|
66 |
*/
|
67 |
protected function getEndpointForOrder($order)
|
68 |
{
|
69 |
-
return '/orders/' . $order->getIncrementId();
|
70 |
}
|
71 |
}
|
2 |
|
3 |
class Aplazame_Aplazame_Model_Api_Client extends Varien_Object
|
4 |
{
|
5 |
+
/**
|
6 |
+
* @var string
|
7 |
+
*/
|
8 |
+
public $apiBaseUri;
|
9 |
+
|
10 |
/**
|
11 |
* @var Aplazame_Sdk_Api_Client
|
12 |
*/
|
14 |
|
15 |
public function __construct()
|
16 |
{
|
17 |
+
$this->apiBaseUri = getenv('APLAZAME_API_BASE_URI') ? getenv('APLAZAME_API_BASE_URI') : 'https://api.aplazame.com';
|
18 |
$this->apiClient = new Aplazame_Sdk_Api_Client(
|
19 |
+
$this->apiBaseUri,
|
20 |
(Mage::getStoreConfig('payment/aplazame/sandbox') ? Aplazame_Sdk_Api_Client::ENVIRONMENT_SANDBOX : Aplazame_Sdk_Api_Client::ENVIRONMENT_PRODUCTION),
|
21 |
Mage::getStoreConfig('payment/aplazame/secret_api_key'),
|
22 |
new Aplazame_Aplazame_Http_ZendClient()
|
29 |
*/
|
30 |
public function authorize($orderId)
|
31 |
{
|
32 |
+
return $this->apiClient->request(Varien_Http_Client::POST, '/orders/' . urlencode(urlencode($orderId)) . '/authorize');
|
33 |
}
|
34 |
|
35 |
/**
|
38 |
*/
|
39 |
public function fetchOrder($orderId)
|
40 |
{
|
41 |
+
$orders = $this->apiClient->request(Varien_Http_Client::GET, '/orders?mid=' . urlencode($orderId));
|
42 |
|
43 |
return $orders['results'][0];
|
44 |
}
|
72 |
*/
|
73 |
protected function getEndpointForOrder($order)
|
74 |
{
|
75 |
+
return '/orders/' . urlencode(urlencode($order->getIncrementId()));
|
76 |
}
|
77 |
}
|
app/code/community/Aplazame/Aplazame/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Aplazame_Aplazame>
|
5 |
-
<version>0.4.
|
6 |
</Aplazame_Aplazame>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Aplazame_Aplazame>
|
5 |
+
<version>0.4.4</version>
|
6 |
</Aplazame_Aplazame>
|
7 |
</modules>
|
8 |
<global>
|
lib/Aplazame/Sdk/Serializer/Date.php
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
use DateTime;
|
4 |
-
|
5 |
/**
|
6 |
* DateTime Type.
|
7 |
*/
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
/**
|
4 |
* DateTime Type.
|
5 |
*/
|
package.xml
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Aplazame_Aplazame</name>
|
4 |
-
<version>0.4.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Aplazame, a consumer credit company, offers a payment system that can be used by online buyers to receive funding for their purchases.</summary>
|
10 |
<description>Aplazame, a consumer credit company, offers a payment system that can be used by online buyers to receive funding for their purchases.</description>
|
11 |
-
<notes>*
|
12 |
</notes>
|
13 |
<authors><author><name>Aplazame</name><user>aplazame</user><email>dev@aplazame.com</email></author></authors>
|
14 |
-
<date>2017-
|
15 |
-
<time>
|
16 |
-
<contents><target name="magecommunity"><dir name="Aplazame"><dir name="Aplazame"><dir name="Block"><dir name="AdminHtml"><file name="ProductCampaigns.php" hash="cc4007bf8a21b0beee3f26fb7a50291b"/><file name="ProductsCampaigns.php" hash="4e654f2a4b65979229e2adcedda2f287"/></dir><dir name="Checkout"><dir name="Cart"><file name="Widget.php" hash="c3f29d9e78412d952e2ecc355e71e4af"/></dir><dir name="Onepage"><file name="Billing.php" hash="d908bf39c8555f436f8841ff30b520f1"/><file name="Shipping.php" hash="8968979cc9140f2f6236ee9f2fbafc98"/></dir></dir><dir name="Payment"><file name="Form.php" hash="b23f141b2b8dc37edee3eecbc5f9f589"/><file name="Info.php" hash="eeadafff816256593595d261c9e3b5f8"/><file name="Redirect.php" hash="b585f3542b421e1034a1593a49541bd3"/></dir><dir name="Product"><file name="Widget.php" hash="c3cf7af0e593d8d35283238b0e73d624"/></dir></dir><dir name="Helper"><file name="Cart.php" hash="f95a90db86fb4732f7d3ef1fb6a2322a"/><file name="Data.php" hash="35cc7eb331ff48912492cce397918270"/></dir><dir name="Model"><dir name="Api"><file name="Client.php" hash="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Aplazame_Aplazame</name>
|
4 |
+
<version>0.4.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Aplazame, a consumer credit company, offers a payment system that can be used by online buyers to receive funding for their purchases.</summary>
|
10 |
<description>Aplazame, a consumer credit company, offers a payment system that can be used by online buyers to receive funding for their purchases.</description>
|
11 |
+
<notes>* Fix for order ids with special characters
|
12 |
</notes>
|
13 |
<authors><author><name>Aplazame</name><user>aplazame</user><email>dev@aplazame.com</email></author></authors>
|
14 |
+
<date>2017-07-03</date>
|
15 |
+
<time>17:36:45</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Aplazame"><dir name="Aplazame"><dir name="Block"><dir name="AdminHtml"><file name="ProductCampaigns.php" hash="cc4007bf8a21b0beee3f26fb7a50291b"/><file name="ProductsCampaigns.php" hash="4e654f2a4b65979229e2adcedda2f287"/></dir><dir name="Checkout"><dir name="Cart"><file name="Widget.php" hash="c3f29d9e78412d952e2ecc355e71e4af"/></dir><dir name="Onepage"><file name="Billing.php" hash="d908bf39c8555f436f8841ff30b520f1"/><file name="Shipping.php" hash="8968979cc9140f2f6236ee9f2fbafc98"/></dir></dir><dir name="Payment"><file name="Form.php" hash="b23f141b2b8dc37edee3eecbc5f9f589"/><file name="Info.php" hash="eeadafff816256593595d261c9e3b5f8"/><file name="Redirect.php" hash="b585f3542b421e1034a1593a49541bd3"/></dir><dir name="Product"><file name="Widget.php" hash="c3cf7af0e593d8d35283238b0e73d624"/></dir></dir><dir name="Helper"><file name="Cart.php" hash="f95a90db86fb4732f7d3ef1fb6a2322a"/><file name="Data.php" hash="35cc7eb331ff48912492cce397918270"/></dir><dir name="Model"><dir name="Api"><file name="Client.php" hash="9079e77ab6a056a69cf3fa97d709723f"/></dir><file name="CampaignsObserver.php" hash="a24df9a5b2c241a25c5c2578e04c2aab"/><file name="Observer.php" hash="44825f169bd6c5c85d284cf1fd0fdf28"/><file name="Payment.php" hash="d338cae16fc3a1124ce53a731f74412a"/></dir><dir name="controllers"><dir name="AdminHtml"><file name="AplazameController.php" hash="31a80d33439c5c2d36701347556ea2e9"/></dir><file name="ApiController.php" hash="3d37b650de9731d8e2b6556dadb63e98"/><file name="PaymentController.php" hash="d62bacd625b4cc9a4d2ae0af28d447a4"/></dir><dir name="etc"><file name="config.xml" hash="91a2e0d6b6f7acabd1e6e94ba4679c41"/><file name="system.xml" hash="390ded5bc6e8866c9b1541acd20c16b8"/></dir></dir></dir></target><target name="magelib"><dir name="Aplazame"><dir name="Aplazame"><dir name="Api"><file name="Article.php" hash="f88b4e4d0e472f5e70f10df77d923504"/><dir name="BusinessModel"><file name="Article.php" hash="b2620ae2f806f61feb94a29ffa0f8ef9"/><file name="HistoricalOrder.php" hash="5c86021841845c3af4b8e20b06310989"/></dir><file name="Order.php" hash="2f73b330a8df3a41f925c6b721f69957"/></dir><dir name="BusinessModel"><file name="Address.php" hash="0d59592092e08dfb4d3a8fd08de4ac57"/><file name="Article.php" hash="a34660c185b9808ae84488031b4ef504"/><file name="Checkout.php" hash="97b13eb130bdf15a38a4aeb04e239034"/><file name="Customer.php" hash="4e3b255e589bde0ca6f97c3b35fac80c"/><file name="Order.php" hash="e66fa54a1ca4203abef33be1c7712076"/><file name="ShippingInfo.php" hash="e5f1b9a91b0839094a30c04ec9d8ed86"/></dir><dir name="Http"><file name="ZendClient.php" hash="605e0739e74ad75540c0cb8963a64e88"/></dir></dir><dir name="Sdk"><dir name="Api"><file name="ApiClientException.php" hash="96792d448d909366049192c2a37556ae"/><file name="ApiCommunicationException.php" hash="2f46d905ad859291aa204bdbef4153bc"/><file name="ApiRequest.php" hash="c060290dfa790d2b2b38d120e7abf534"/><file name="ApiServerException.php" hash="90821aed9204104da1983137129bbb16"/><file name="AplazameExceptionInterface.php" hash="ed0cfbeda38fd29403c916418716eb02"/><file name="Client.php" hash="c8bcd8d2a0c410e0b82ea4c0359f308c"/><file name="DeserializeException.php" hash="155f2f9c7af08c89401bd74fd4d95c56"/></dir><dir name="Http"><file name="ClientInterface.php" hash="ea3fe4fa5fe82da131521d84ab4fea22"/><file name="CurlClient.php" hash="28150b98ff950b2e1fcc1b048d637bdc"/><file name="Request.php" hash="a910df86e3c92328b59e7922a4bb1481"/><file name="RequestInterface.php" hash="deb097c359796fdbb08e8a3041728f33"/><file name="Response.php" hash="85e49bf8b02fc7f0174db3bf4dcace94"/><file name="ResponseInterface.php" hash="f21ac2bb3969a54015089718c3652e15"/></dir><dir name="Serializer"><file name="Date.php" hash="ed0c984fe8c7eeab19edecf1ab4997f9"/><file name="Decimal.php" hash="677664df2610ad6e0374d8629ea6d68a"/><file name="JsonSerializable.php" hash="baf92f09f79e92bf9c1df90b324be5b0"/><file name="JsonSerializer.php" hash="95f308cad5cab0a7765246bd156ffe50"/></dir><file name="json_polyfill.php" hash="8472b84afc7fc1c7ea4e1d9c2b5d0343"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="aplazame.xml" hash="79024c230729c2757d9b372278411308"/></dir><dir name="template"><dir name="aplazame"><file name="productCampaigns.phtml" hash="2ece400970d9efe2d2282056edc79580"/><file name="productsCampaigns.phtml" hash="284b706a86df213d6a4c56b1706d2716"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="aplazame.xml" hash="2f2be6631b96114622fbd824d1df12fd"/></dir><dir name="template"><dir name="aplazame"><dir name="checkout"><dir name="cart"><file name="widget.phtml" hash="b7df941791e4f1e1d3cd5a346406c061"/></dir></dir><dir name="payment"><file name="common.phtml" hash="128898cf9895997954ea62da3ce091c9"/><file name="form.phtml" hash="d575ccfb07826f7b5f6f00e36d052c03"/></dir><dir name="product"><file name="widget.phtml" hash="a85abf1173928e94e75808770df9ad4b"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="es_ES"><file name="Aplazame_Aplazame.csv" hash="e3b2c78dc85275bd807e089a0b50f5b9"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Aplazame_Aplazame.xml" hash="d816c618a1829401ca0314c3406482a1"/></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
|
19 |
</package>
|