Skip to content

Commit 6dedae2

Browse files
committed
Read common data earlier.
1 parent 2022f5f commit 6dedae2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

includes/class-wc-gateway-amazon-payments-advanced.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,12 @@ public function handle_account_registration( $customer_id ) {
265265

266266
// FROM: WC_Checkout->process_customer
267267
if ( ! is_user_logged_in() && ( $checkout->is_registration_required() || ! empty( $data['createaccount'] ) ) ) {
268+
$checkout_session = $this->get_checkout_session();
269+
$buyer_id = $checkout_session->buyer->buyerId;
270+
$buyer_email = $checkout_session->buyer->email;
271+
$buyer_user_id = $this->get_customer_id_from_buyer( $buyer_id );
268272

269273
if ( isset( $data['amazon_validate'] ) ) {
270-
$checkout_session = $this->get_checkout_session();
271-
$buyer_id = $checkout_session->buyer->buyerId;
272-
$buyer_email = $checkout_session->buyer->email;
273-
274-
$buyer_user_id = $this->get_customer_id_from_buyer( $buyer_id );
275-
276274
if ( is_user_logged_in() ) {
277275
return; // We shouldn't be here anyways
278276
}

0 commit comments

Comments
 (0)