mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +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';
|
||||
|
||||
/**
|
||||
* Get PayPal account email.
|
||||
*
|
||||
* @return string PayPal account email.
|
||||
*/
|
||||
public function get_email() {
|
||||
return $this->get_meta( 'email' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set PayPal account email.
|
||||
*
|
||||
* @param string $email PayPal account email.
|
||||
*/
|
||||
public function set_email( $email ) {
|
||||
$this->add_meta_data( 'email', $email, true );
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ class VaultingModule implements ModuleInterface {
|
|||
}
|
||||
|
||||
assert( $payment_token instanceof PaymentTokenPayPal );
|
||||
$item['method']['brand'] = $payment_token->get_email() ?? 'PayPal';
|
||||
$item['method']['brand'] = $payment_token->get_email();
|
||||
|
||||
return $item;
|
||||
},
|
||||
|
@ -168,6 +168,8 @@ class VaultingModule implements ModuleInterface {
|
|||
add_action(
|
||||
'woocommerce_paypal_payments_gateway_migrate_on_update',
|
||||
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(
|
||||
array(
|
||||
'fields' => 'ID',
|
||||
|
@ -181,6 +183,7 @@ class VaultingModule implements ModuleInterface {
|
|||
),
|
||||
)
|
||||
);
|
||||
// phpcs:enable
|
||||
|
||||
$migrate = $container->get( 'vaulting.payment-tokens-migration' );
|
||||
assert( $migrate instanceof PaymentTokensMigration );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue