Skip to content

Commit 5017aee

Browse files
author
Serhiy Shkolyarenko
committed
Merge remote-tracking branch 'origin/remove_candidate_removal' into bugs
2 parents 7a20e8b + 174c26a commit 5017aee

File tree

115 files changed

+2524
-4566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2524
-4566
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use \Braintree_Transaction;
1212
use \Braintree_Result_Successful;
1313
use Magento\Framework\Exception\LocalizedException;
14+
use Magento\Sales\Model\Order\Payment\Transaction;
1415
use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
1516
use Magento\Sales\Model\Order\Payment\Transaction as PaymentTransaction;
1617
use Magento\Payment\Model\InfoInterface;
@@ -648,13 +649,15 @@ public function refund(InfoInterface $payment, $amount)
648649
}
649650
}
650651

652+
// transaction should be voided if it not settled
651653
$canVoid = ($transaction->status === \Braintree_Transaction::AUTHORIZED
652654
|| $transaction->status === \Braintree_Transaction::SUBMITTED_FOR_SETTLEMENT);
653655
$result = $canVoid
654656
? $this->braintreeTransaction->void($transactionId)
655657
: $this->braintreeTransaction->refund($transactionId, $amount);
656658
$this->_debug($this->_convertObjToArray($result));
657659
if ($result->success) {
660+
$payment->setTransactionId($transactionId . '-' . Transaction::TYPE_REFUND);
658661
$payment->setIsTransactionClosed(true);
659662
} else {
660663
throw new LocalizedException($this->errorHelper->parseBraintreeError($result));

app/code/Magento/Braintree/Test/Unit/Model/PaymentMethodTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Braintree\Model\PaymentMethod;
1010
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
11+
use Magento\Sales\Model\Order\Payment\Transaction;
1112
use \Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory as TransactionCollectionFactory;
1213
use Magento\Framework\Exception\LocalizedException;
1314
use \Braintree_Result_Successful;
@@ -2378,6 +2379,7 @@ public function testRefund()
23782379

23792380
$this->model->refund($paymentObject, $amount);
23802381
$this->assertEquals(1, $paymentObject->getIsTransactionClosed());
2382+
$this->assertEquals($refundTransactionId . '-' .Transaction::TYPE_REFUND, $paymentObject->getTransactionId());
23812383
}
23822384

23832385
/**

app/code/Magento/Braintree/view/adminhtml/templates/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
133133
</div>
134134
</fieldset>
135135
<?php endif; ?>
136-
<?php if($_useVault): ?>
136+
<?php if($useVault): ?>
137137
<fieldset class="admin__fieldset hide_if_token_selected">
138138
<div id="<?php /* @noEscape */ echo $code; ?>_store_in_vault_div" style="text-align:left;" class="">
139139
<input type="checkbox" title="<?php echo $block->escapeHtml(__('Save this card for future use')); ?>"

app/code/Magento/Braintree/view/frontend/layout/braintree_paypal_review.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<block class="Magento\Framework\View\Element\Text\ListText" name="paypal.additional.actions"/>
2525
<block class="Magento\Paypal\Block\Express\Review\Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml">
2626
<block class="Magento\Framework\View\Element\RendererList" name="checkout.onepage.review.item.renderers" as="renderer.list"/>
27-
<block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="onepage/review/totals.phtml"/>
27+
<block class="Magento\Checkout\Block\Cart\Totals" name="paypal.express.review.details.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
2828
</block>
2929
<block class="Magento\CheckoutAgreements\Block\Agreements" name="paypal.express.review.details.agreements" as="agreements" template="Magento_CheckoutAgreements::additional_agreements.phtml"/>
3030
</block>

app/code/Magento/Braintree/view/frontend/templates/creditcard/index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $storedCards = $block->getCurrentCustomerStoredCards();
1919
<?php endif; ?>
2020
</div>
2121
<?php echo $block->getLayout()->getMessagesBlock()->getGroupedHtml(); ?>
22-
<?php if (count($_storedCards)): ?>
22+
<?php if (count($storedCards)): ?>
2323
<table class="data-table" id="my-quotes-table">
2424
<col width="1" />
2525
<col width="1" />

app/code/Magento/Checkout/Block/Onepage.php

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55
*/
66
namespace Magento\Checkout\Block;
77

8-
use Magento\Checkout\Block\Checkout\LayoutProcessorInterface;
9-
use Magento\Customer\Api\CustomerRepositoryInterface;
10-
use Magento\Customer\Model\Address\Config as AddressConfig;
11-
128
/**
139
* Onepage checkout block
1410
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1511
*/
16-
class Onepage extends \Magento\Checkout\Block\Onepage\AbstractOnepage
12+
class Onepage extends \Magento\Framework\View\Element\Template
1713
{
1814
/**
1915
* @var \Magento\Framework\Data\Form\FormKey
@@ -36,60 +32,25 @@ class Onepage extends \Magento\Checkout\Block\Onepage\AbstractOnepage
3632
protected $configProvider;
3733

3834
/**
39-
* @var array|Checkout\LayoutProcessorInterface[]
35+
* @var array|\Magento\Checkout\Block\Checkout\LayoutProcessorInterface[]
4036
*/
4137
protected $layoutProcessors;
4238

4339
/**
4440
* @param \Magento\Framework\View\Element\Template\Context $context
45-
* @param \Magento\Directory\Helper\Data $directoryHelper
46-
* @param \Magento\Framework\App\Cache\Type\Config $configCacheType
47-
* @param \Magento\Customer\Model\Session $customerSession
48-
* @param \Magento\Checkout\Model\Session $resourceSession
49-
* @param \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory
50-
* @param \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory
51-
* @param CustomerRepositoryInterface $customerRepository
52-
* @param AddressConfig $addressConfig
53-
* @param \Magento\Framework\App\Http\Context $httpContext
54-
* @param \Magento\Customer\Model\Address\Mapper $addressMapper
5541
* @param \Magento\Framework\Data\Form\FormKey $formKey
5642
* @param \Magento\Checkout\Model\CompositeConfigProvider $configProvider
57-
* @param LayoutProcessorInterface[] $layoutProcessors
43+
* @param array $layoutProcessors
5844
* @param array $data
59-
* @codeCoverageIgnore
60-
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
6145
*/
6246
public function __construct(
6347
\Magento\Framework\View\Element\Template\Context $context,
64-
\Magento\Directory\Helper\Data $directoryHelper,
65-
\Magento\Framework\App\Cache\Type\Config $configCacheType,
66-
\Magento\Customer\Model\Session $customerSession,
67-
\Magento\Checkout\Model\Session $resourceSession,
68-
\Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory,
69-
\Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory,
70-
CustomerRepositoryInterface $customerRepository,
71-
AddressConfig $addressConfig,
72-
\Magento\Framework\App\Http\Context $httpContext,
73-
\Magento\Customer\Model\Address\Mapper $addressMapper,
7448
\Magento\Framework\Data\Form\FormKey $formKey,
7549
\Magento\Checkout\Model\CompositeConfigProvider $configProvider,
7650
array $layoutProcessors = [],
7751
array $data = []
7852
) {
79-
parent::__construct(
80-
$context,
81-
$directoryHelper,
82-
$configCacheType,
83-
$customerSession,
84-
$resourceSession,
85-
$countryCollectionFactory,
86-
$regionCollectionFactory,
87-
$customerRepository,
88-
$addressConfig,
89-
$httpContext,
90-
$addressMapper,
91-
$data
92-
);
53+
parent::__construct($context, $data);
9354
$this->formKey = $formKey;
9455
$this->_isScopePrivate = true;
9556
$this->jsLayout = isset($data['jsLayout']) && is_array($data['jsLayout']) ? $data['jsLayout'] : [];

0 commit comments

Comments
 (0)