mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix display of paypal email when funding source is not paypal.
This commit is contained in:
parent
585c4e76cf
commit
48f9efbfd4
1 changed files with 8 additions and 0 deletions
|
@ -473,6 +473,14 @@ class WCGatewayModule implements ModuleInterface {
|
|||
return $fields;
|
||||
}
|
||||
|
||||
// Is payment source is paypal exclude all non paypal funding sources.
|
||||
$payment_source = $theorder->get_meta( PayPalGateway::ORDER_PAYMENT_SOURCE_META_KEY ) ?: '';
|
||||
$is_paypal_funding_source = ( strpos( $theorder->get_payment_method_title(), '(via PayPal)' ) === false );
|
||||
|
||||
if ( $payment_source === 'paypal' && ! $is_paypal_funding_source ) {
|
||||
return $fields;
|
||||
}
|
||||
|
||||
$fields['paypal_email'] = array(
|
||||
'label' => __( 'PayPal email address', 'woocommerce-paypal-payments' ),
|
||||
'value' => $email,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue