mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Merge branch 'PCP-591-save-and-display-vaulted-payment-methods-in-woo-commerce-native-endpoint' into PCP-991-detach-vaulting-from-wc-subscriptions-support
This commit is contained in:
commit
95695dabab
2 changed files with 14 additions and 1 deletions
|
@ -22,10 +22,20 @@ class PaymentTokenPayPal extends WC_Payment_Token {
|
||||||
*/
|
*/
|
||||||
protected $type = 'PayPal';
|
protected $type = 'PayPal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get PayPal account email.
|
||||||
|
*
|
||||||
|
* @return string PayPal account email.
|
||||||
|
*/
|
||||||
public function get_email() {
|
public function get_email() {
|
||||||
return $this->get_meta( 'email' );
|
return $this->get_meta( 'email' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set PayPal account email.
|
||||||
|
*
|
||||||
|
* @param string $email PayPal account email.
|
||||||
|
*/
|
||||||
public function set_email( $email ) {
|
public function set_email( $email ) {
|
||||||
$this->add_meta_data( 'email', $email, true );
|
$this->add_meta_data( 'email', $email, true );
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ class VaultingModule implements ModuleInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
assert( $payment_token instanceof PaymentTokenPayPal );
|
assert( $payment_token instanceof PaymentTokenPayPal );
|
||||||
$item['method']['brand'] = $payment_token->get_email() ?? 'PayPal';
|
$item['method']['brand'] = $payment_token->get_email();
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
},
|
},
|
||||||
|
@ -168,6 +168,8 @@ class VaultingModule implements ModuleInterface {
|
||||||
add_action(
|
add_action(
|
||||||
'woocommerce_paypal_payments_gateway_migrate_on_update',
|
'woocommerce_paypal_payments_gateway_migrate_on_update',
|
||||||
function () use ( $container ) {
|
function () use ( $container ) {
|
||||||
|
// phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_key
|
||||||
|
// phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_query
|
||||||
$customers = new WP_User_Query(
|
$customers = new WP_User_Query(
|
||||||
array(
|
array(
|
||||||
'fields' => 'ID',
|
'fields' => 'ID',
|
||||||
|
@ -181,6 +183,7 @@ class VaultingModule implements ModuleInterface {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
// phpcs:enable
|
||||||
|
|
||||||
$migrate = $container->get( 'vaulting.payment-tokens-migration' );
|
$migrate = $container->get( 'vaulting.payment-tokens-migration' );
|
||||||
assert( $migrate instanceof PaymentTokensMigration );
|
assert( $migrate instanceof PaymentTokensMigration );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue