Skip to content

Commit fa93027

Browse files
committed
MAGETWO-71759: Impossible place order from admin using saved PayPal Pro credit card
1 parent c9fdb47 commit fa93027

File tree

2 files changed

+55
-1
lines changed
  • app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method
  • dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method

2 files changed

+55
-1
lines changed

app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
</dl>
4040
</div>
4141
<script>
42-
require(["Magento_Sales/order/create/form"], function(){
42+
require([
43+
'mage/apply/main',
44+
'Magento_Sales/order/create/form'
45+
], function(mage) {
46+
mage.apply();
4347
<?php if ($_methodsCount != 1):?>
4448
order.setPaymentMethod('<?= /* @escapeNotVerified */ $block->getSelectedMethodCode() ?>');
4549
<?php endif; ?>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Sales\Block\Adminhtml\Order\Create\Billing\Method;
7+
8+
use Magento\Framework\ObjectManagerInterface;
9+
use Magento\Framework\View\LayoutInterface;
10+
use Magento\TestFramework\Helper\Bootstrap;
11+
12+
/**
13+
* Test for order billing method form.
14+
*
15+
* @magentoAppArea adminhtml
16+
*/
17+
class FormTest extends \PHPUnit\Framework\TestCase
18+
{
19+
/**
20+
* @var ObjectManagerInterface
21+
*/
22+
private $objectManager;
23+
24+
/**
25+
* @var LayoutInterface
26+
*/
27+
private $layout;
28+
29+
/**
30+
* @inheritdoc
31+
*/
32+
protected function setUp()
33+
{
34+
$this->objectManager = Bootstrap::getObjectManager();
35+
$this->layout = $this->objectManager->get(LayoutInterface::class);
36+
}
37+
38+
/**
39+
* Checks if billing method form generates contentUpdated event
40+
* to parse elements with data-mage-init attributes.
41+
*/
42+
public function testContentUpdated()
43+
{
44+
/** @var Form $block */
45+
$block = $this->layout->createBlock(Form::class, 'order_billing_method');
46+
$block->setTemplate('Magento_Sales::order/create/billing/method/form.phtml');
47+
48+
$this->assertContains('mage.apply()', $block->toHtml());
49+
}
50+
}

0 commit comments

Comments
 (0)