Skip to content

Commit b901299

Browse files
committed
Only save the option if we also have the email
1 parent e8ea08e commit b901299

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

paypal/helpers/FrmPayPalLiteConnectHelper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ private static function render_seller_status( $mode ) {
7373
}
7474

7575
// TODO: Only render when we visit the PayPal tab.
76-
// TODO: If all 3 validate, we should be able to save this to an option and stop making requests.
7776
$status = self::get_seller_status( $mode );
7877

7978
/*
@@ -106,9 +105,11 @@ private static function render_seller_status( $mode ) {
106105
return;
107106
}
108107

109-
update_option( self::get_paypal_seller_status_option_name( $mode ), $status, false );
108+
$email = $status->primary_email ?? '';
110109

111-
$email = ! empty( $status->primary_email ) ? $status->primary_email : '';
110+
if ( $email ) {
111+
update_option( self::get_paypal_seller_status_option_name( $mode ), $status, false );
112+
}
112113

113114
echo '<div class="frm_message">';
114115
esc_html_e( 'Your seller status is valid', 'formidable' );

0 commit comments

Comments
 (0)