Skip to content

Commit 92b3163

Browse files
committed
Merge branch 'ACP2E-296' of https://github.com/magento-l3/magento2ce into PR1-21-01-2022
2 parents e1bfbe2 + 1ac3838 commit 92b3163

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

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

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ class Checkout
3030
*
3131
* @var string
3232
*/
33-
const PAL_CACHE_ID = 'paypal_express_checkout_pal';
33+
public const PAL_CACHE_ID = 'paypal_express_checkout_pal';
3434

3535
/**
3636
* Keys for passthrough variables in sales/quote_payment and sales/order_payment
3737
* Uses additional_information as storage
3838
*/
39-
const PAYMENT_INFO_TRANSPORT_TOKEN = 'paypal_express_checkout_token';
40-
const PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDDEN = 'paypal_express_checkout_shipping_overridden';
41-
const PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD = 'paypal_express_checkout_shipping_method';
42-
const PAYMENT_INFO_TRANSPORT_PAYER_ID = 'paypal_express_checkout_payer_id';
43-
const PAYMENT_INFO_TRANSPORT_REDIRECT = 'paypal_express_checkout_redirect_required';
44-
const PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT = 'paypal_ec_create_ba';
39+
public const PAYMENT_INFO_TRANSPORT_TOKEN = 'paypal_express_checkout_token';
40+
public const PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDDEN = 'paypal_express_checkout_shipping_overridden';
41+
public const PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD = 'paypal_express_checkout_shipping_method';
42+
public const PAYMENT_INFO_TRANSPORT_PAYER_ID = 'paypal_express_checkout_payer_id';
43+
public const PAYMENT_INFO_TRANSPORT_REDIRECT = 'paypal_express_checkout_redirect_required';
44+
public const PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT = 'paypal_ec_create_ba';
4545

4646
/**
4747
* Flag which says that was used PayPal Express Checkout button for checkout
4848
* Uses additional_information as storage
4949
* @var string
5050
*/
51-
const PAYMENT_INFO_BUTTON = 'button';
51+
public const PAYMENT_INFO_BUTTON = 'button';
5252

5353
/**
5454
* @var \Magento\Quote\Model\Quote
@@ -131,8 +131,6 @@ class Checkout
131131
protected $_isBml = false;
132132

133133
/**
134-
* Customer ID
135-
*
136134
* @var int
137135
*/
138136
protected $_customerId;
@@ -145,8 +143,6 @@ class Checkout
145143
protected $_billingAgreement;
146144

147145
/**
148-
* Order
149-
*
150146
* @var \Magento\Sales\Model\Order
151147
*/
152148
protected $_order;
@@ -157,15 +153,11 @@ class Checkout
157153
protected $_configCacheType;
158154

159155
/**
160-
* Checkout data
161-
*
162156
* @var \Magento\Checkout\Helper\Data
163157
*/
164158
protected $_checkoutData;
165159

166160
/**
167-
* Tax data
168-
*
169161
* @var \Magento\Tax\Helper\Data
170162
*/
171163
protected $_taxData;
@@ -1167,6 +1159,8 @@ protected function prepareGuestQuote()
11671159

11681160
$quote->setCustomerId(null)
11691161
->setCustomerEmail($email)
1162+
->setCustomerFirstname($billingAddress->getFirstname())
1163+
->setCustomerLastname($billingAddress->getLastname())
11701164
->setCustomerIsGuest(true)
11711165
->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID);
11721166
return $this;

dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,14 @@ public function testPlaceGuestQuote($accountEmail, $expected)
220220
$this->assertEquals($expected, $quote->getCustomerEmail());
221221
$this->assertNotEmpty($quote->getBillingAddress());
222222
$this->assertNotEmpty($quote->getShippingAddress());
223+
$this->assertEquals($quote->getBillingAddress()->getFirstname(), $quote->getCustomerFirstname());
224+
$this->assertEquals($quote->getBillingAddress()->getLastname(), $quote->getCustomerLastname());
223225

224226
$order = $checkout->getOrder();
225227
$this->assertNotEmpty($order->getBillingAddress());
226228
$this->assertNotEmpty($order->getShippingAddress());
229+
$this->assertEquals($quote->getBillingAddress()->getFirstname(), $order->getCustomerFirstname());
230+
$this->assertEquals($quote->getBillingAddress()->getLastname(), $order->getCustomerLastname());
227231
}
228232

229233
/**

0 commit comments

Comments
 (0)