Skip to content

Commit 0fa7d4c

Browse files
committed
Merge pull request #527 from magento-mpi/MPI-BUGFIX-S69
[MPI] Bugfixes s69
2 parents dd47569 + 6964eef commit 0fa7d4c

File tree

8 files changed

+41
-7
lines changed

8 files changed

+41
-7
lines changed

app/code/Magento/Authorizenet/Block/Transparent/Iframe.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,29 @@ class Iframe extends TransparentIframe
1717
*/
1818
protected $dataFactory;
1919

20+
/**
21+
* @var \Magento\Framework\Message\ManagerInterface
22+
*/
23+
private $messageManager;
24+
2025
/**
2126
* Constructor
2227
*
2328
* @param \Magento\Framework\View\Element\Template\Context $context
2429
* @param \Magento\Framework\Registry $registry
2530
* @param \Magento\Authorizenet\Helper\DataFactory $dataFactory
31+
* @param \Magento\Framework\Message\ManagerInterface $messageManager
2632
* @param array $data
2733
*/
2834
public function __construct(
2935
\Magento\Framework\View\Element\Template\Context $context,
3036
\Magento\Framework\Registry $registry,
3137
\Magento\Authorizenet\Helper\DataFactory $dataFactory,
38+
\Magento\Framework\Message\ManagerInterface $messageManager,
3239
array $data = []
3340
) {
3441
$this->dataFactory = $dataFactory;
42+
$this->messageManager = $messageManager;
3543
parent::__construct($context, $registry, $data);
3644
}
3745

@@ -45,4 +53,26 @@ public function getHelper($area)
4553
{
4654
return $this->dataFactory->create($area);
4755
}
56+
57+
/**
58+
* {inheritdoc}
59+
*/
60+
protected function _beforeToHtml()
61+
{
62+
$this->addSuccessMessage();
63+
return parent::_beforeToHtml();
64+
}
65+
66+
/**
67+
* Add success message
68+
*
69+
* @return void
70+
*/
71+
private function addSuccessMessage()
72+
{
73+
$params = $this->getParams();
74+
if (isset($params['redirect_parent'])) {
75+
$this->messageManager->addSuccess(__('You created the order.'));
76+
}
77+
}
4878
}

app/code/Magento/Braintree/Block/PayPal/Shortcut.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ public function getContainerId()
183183
{
184184
if ($this->isInMiniCart()) {
185185
return 'braintree_paypal_container_minicart';
186-
187186
} else {
188187
return 'braintree_paypal_container' . $this->mathRandom->getRandomString(5);
189188
}

app/code/Magento/Braintree/Model/Checkout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function populateQuoteAddress($quote, $details)
8484
$billingAddress->setFirstname($details['firstName']);
8585
$billingAddress->setLastname($details['lastName']);
8686
$billingAddress->setEmail($details['email']);
87-
} elseif ($billingAddress->getEmail() == null) {
87+
} elseif ($exportedShippingAddress) {
8888
$this->importAddressData($billingAddress, $exportedShippingAddress);
8989
$billingAddress->setFirstname($details['firstName']);
9090
$billingAddress->setLastname($details['lastName']);

app/code/Magento/Braintree/etc/adminhtml/system.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@
4949
<label>Merchant ID</label>
5050
<config_path>payment/braintree/merchant_id</config_path>
5151
</field>
52-
<field id="public_key" translate="label" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
52+
<field id="public_key" translate="label" type="obscure" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
5353
<label>Public Key</label>
5454
<config_path>payment/braintree/public_key</config_path>
55+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
5556
</field>
56-
<field id="private_key" translate="label" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
57+
<field id="private_key" translate="label" type="obscure" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
5758
<label>Private Key</label>
5859
<config_path>payment/braintree/private_key</config_path>
60+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
5961
</field>
6062
<field id="sort_order" translate="label" type="text" sortOrder="230" showInDefault="1" showInWebsite="1" showInStore="0">
6163
<label>Sort Order</label>

app/code/Magento/Braintree/etc/config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<fraudprotection>0</fraudprotection>
2323
<capture_action>invoice</capture_action>
2424
<data_js><![CDATA[https://js.braintreegateway.com/v1/braintree-data.js]]></data_js>
25+
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
26+
<private_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
2527
<duplicate_card>0</duplicate_card>
2628
<masked_fields>cvv,number</masked_fields>
2729
<usecache>0</usecache>

app/code/Magento/Braintree/view/frontend/web/js/braintree-paypal-shortcut.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ define([
2929
var paymentDetailsId = this.options.paymentDetailsId;
3030
var submitFormId = this.options.submitFormId;
3131
var self = this;
32-
$('#'.concat(this.container)).empty();
32+
$('#'.concat(this.options.container)).empty();
3333
braintree.setup(clientToken, "paypal", {
3434
container: this.options.container,
3535
singleUse: true,
@@ -52,4 +52,4 @@ define([
5252
});
5353

5454
return $.mage.braintreePayPalShortcut;
55-
});
55+
});

app/code/Magento/Payment/view/adminhtml/templates/transparent/iframe.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $params = $block->getParams();
1717
<?php elseif (isset($params['redirect_parent'])): ?>
1818
window.top.location="<?php echo $block->escapeUrl($params['redirect_parent']) ?>";
1919
<?php elseif (isset($params['error_msg'])): ?>
20-
window.top.alert(<?php echo $block->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($params['error_msg']) ?>);
20+
window.top.alert(<?php echo $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($params['error_msg']) ?>);
2121
<?php elseif (isset($params['order_success'])): ?>
2222
window.top.location = "<?php echo $params['order_success'] ?>";
2323
<?php else: ?>

app/code/Magento/Paypal/etc/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
<avs_zip>0</avs_zip>
9090
<avs_international>0</avs_international>
9191
<avs_security_code>1</avs_security_code>
92+
<cc_year_length>2</cc_year_length>
9293
</payflowpro>
9394
<paypal_billing_agreement>
9495
<active>1</active>

0 commit comments

Comments
 (0)