mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +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;
|
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(
|
$fields['paypal_email'] = array(
|
||||||
'label' => __( 'PayPal email address', 'woocommerce-paypal-payments' ),
|
'label' => __( 'PayPal email address', 'woocommerce-paypal-payments' ),
|
||||||
'value' => $email,
|
'value' => $email,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue