Skip to content

Commit 941dc21

Browse files
authored
fix(email-change): typo in variable name (#3941)
* fix(email-change): typo in variable name * fix: add some logging when no update made * docs: update user ID to email in log
1 parent df53541 commit 941dc21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

includes/reader-revenue/my-account/class-woocommerce-my-account.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,13 +1030,16 @@ public static function handle_cancel_email_change() {
10301030
* @param string $email New email.
10311031
*/
10321032
public static function maybe_sync_email_change_with_stripe( $user_id, $email ) {
1033-
$request = Stripe_Connection::update_customer_data(
1033+
$result = Stripe_Connection::update_customer_data(
10341034
$user_id,
10351035
[
10361036
'email' => $email,
10371037
]
10381038
);
1039-
if ( \is_wp_error( $request ) ) {
1039+
if ( false === $result ) {
1040+
Logger::log( 'Skipping Stripe email update: no Stripe customer found for user ' . $email );
1041+
}
1042+
if ( \is_wp_error( $result ) ) {
10401043
Logger::error( 'Error updating Stripe customer email: ' . $result->get_error_message() );
10411044
}
10421045
}

0 commit comments

Comments
 (0)