Skip to content

Commit d1bb26d

Browse files
Chetan.s.patilChetan.s.patil
authored andcommitted
AC2093: Fixed code review changes
1 parent 0de6681 commit d1bb26d

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

app/code/Magento/Paypal/Block/Express/Review.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Paypal\Block\Express;
88

99
use Magento\Framework\Pricing\PriceCurrencyInterface;
10+
use Magento\Paypal\Model\Express\Checkout;
1011
use Magento\Quote\Model\Quote\Address\Rate;
1112

1213
/**
@@ -314,8 +315,8 @@ protected function _beforeToHtml()
314315
*/
315316
public function getPaypalFundingSource()
316317
{
317-
if ($this->_quote->getPayment()->getPaypalFundingSource()) {
318-
return ucfirst($this->_quote->getPayment()->getPaypalFundingSource());
318+
if ($this->_quote->getPayment()->getAdditionalInformation(Checkout::PAYMENT_INFO_FUNDING_SOURCE)) {
319+
return ucfirst($this->_quote->getPayment()->getAdditionalInformation(Checkout::PAYMENT_INFO_FUNDING_SOURCE));
319320
}
320321
return null;
321322
}

app/code/Magento/Paypal/Controller/Express/OnAuthorization.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ public function execute(): ResultInterface
129129

130130
/** Populate checkout object with new data */
131131
$this->_initCheckout($quote);
132+
$quote->getPayment()->setAdditionalInformation(PayPalCheckout::PAYMENT_INFO_FUNDING_SOURCE, $fundingSource);
132133
/** Populate quote with information about billing and shipping addresses*/
133-
$this->_checkout->returnFromPaypal($tokenId, $payerId, $fundingSource);
134+
$this->_checkout->returnFromPaypal($tokenId, $payerId);
134135
if ($this->_checkout->canSkipOrderReviewStep()) {
135136
$this->_checkout->place($tokenId);
136137
$order = $this->_checkout->getOrder();

app/code/Magento/Paypal/Model/Express/Checkout.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Checkout
4242
public const PAYMENT_INFO_TRANSPORT_PAYER_ID = 'paypal_express_checkout_payer_id';
4343
public const PAYMENT_INFO_TRANSPORT_REDIRECT = 'paypal_express_checkout_redirect_required';
4444
public const PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT = 'paypal_ec_create_ba';
45+
public const PAYMENT_INFO_FUNDING_SOURCE = 'paypal_funding_source';
4546

4647
/**
4748
* Flag which says that was used PayPal Express Checkout button for checkout
@@ -602,12 +603,11 @@ public function canSkipOrderReviewStep()
602603
*
603604
* @param string $token
604605
* @param string|null $payerIdentifier
605-
* @param string|null $fundingSource
606606
* @return void
607607
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
608608
* @SuppressWarnings(PHPMD.NPathComplexity)
609609
*/
610-
public function returnFromPaypal($token, string $payerIdentifier = null, $fundingSource = null)
610+
public function returnFromPaypal($token, string $payerIdentifier = null)
611611
{
612612
$this->_getApi()
613613
->setToken($token)
@@ -682,9 +682,6 @@ public function returnFromPaypal($token, string $payerIdentifier = null, $fundin
682682
$payment = $quote->getPayment();
683683
$payment->setMethod($this->_methodType);
684684
$this->_paypalInfo->importToPayment($this->_getApi(), $payment);
685-
if ($fundingSource) {
686-
$payment->setPaypalFundingSource($fundingSource);
687-
}
688685
$payerId = $payerIdentifier ? : $this->_getApi()->getPayerId();
689686
$payment->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_ID, $payerId)
690687
->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_TOKEN, $token);

app/code/Magento/Quote/etc/db_schema.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@
456456
<column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
457457
<column xsi:type="varchar" name="cc_ss_issue" nullable="true" length="255" comment="Cc Ss Issue"/>
458458
<column xsi:type="text" name="additional_information" nullable="true" comment="Additional Information"/>
459-
<column xsi:type="varchar" name="paypal_funding_source" nullable="true" length="255" comment="Funding source"/>
460459
<constraint xsi:type="primary" referenceId="PRIMARY">
461460
<column name="payment_id"/>
462461
</constraint>

0 commit comments

Comments
 (0)