Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
change shipment cost to itens
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Matsuoka committed Nov 30, 2018
1 parent 8e8adc5 commit 520d83f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"type": "magento2-component",
"version": "2.2.1",
"version": "2.2.2",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
16 changes: 13 additions & 3 deletions src/MercadoPago/Core/Model/Standard/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,21 @@ public function makePreference()
$shipping = $shippingAddress->getData();

$arr['payer']['phone'] = [
"area_code" => "-",
"number" => $shipping['telephone']
"area_code" => "-",
"number" => $shipping['telephone']
];

$arr['shipments'] = array();
$arr['shipments']['receiver_address'] = $this->getReceiverAddress($shippingAddress);

$arr['items'][] = [
"title" => "Shipment cost",
"description" => "Shipment cost",
"category_id" => $this->_scopeConfig->getValue('payment/mercadopago/category_id', \Magento\Store\Model\ScopeInterface::SCOPE_STORE),
"quantity" => 1,
"unit_price" => (float)$order->getBaseShippingAmount()
];

$arr['shipments'] = $this->_getParamShipment($paramsShipment, $order, $shippingAddress);
}

$billingAddress = $order->getBillingAddress()->getData();
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mercadopago/module-core",
"description": "Mercado Pago payment method module",
"type": "magento2-module",
"version": "2.2.1",
"version": "2.2.2",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MercadoPago_Core" setup_version="2.2.1">
<module name="MercadoPago_Core" setup_version="2.2.2">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/MercadoEnvios/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"type": "magento2-module",
"version": "2.2.1",
"version": "2.2.2",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/MercadoEnvios/etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MercadoPago_MercadoEnvios" setup_version="2.2.1">
<module name="MercadoPago_MercadoEnvios" setup_version="2.2.2">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down

0 comments on commit 520d83f

Please sign in to comment.