mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Refactoring
This commit is contained in:
parent
65b97f63c5
commit
96d154a856
3 changed files with 6 additions and 6 deletions
|
@ -90,7 +90,7 @@ class IdentityToken {
|
|||
* @return Token
|
||||
* @throws RuntimeException If the request fails.
|
||||
*/
|
||||
public function generate_for_customer( int $user_id ): Token {
|
||||
public function generate_for_user( int $user_id ): Token {
|
||||
|
||||
$bearer = $this->bearer->bearer();
|
||||
$url = trailingslashit( $this->host ) . 'v1/identity/generate-token';
|
||||
|
@ -105,7 +105,7 @@ class IdentityToken {
|
|||
( $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ) )
|
||||
&& defined( 'PPCP_FLAG_SUBSCRIPTION' ) && PPCP_FLAG_SUBSCRIPTION
|
||||
) {
|
||||
$customer_id = $this->customer_repository->customer_id_for_user(($user_id));
|
||||
$customer_id = $this->customer_repository->customer_id_for_user( ( $user_id ) );
|
||||
|
||||
if ( 0 === $user_id ) {
|
||||
$customer_id = uniqid();
|
||||
|
|
|
@ -80,7 +80,7 @@ class DataClientIdEndpoint implements EndpointInterface {
|
|||
try {
|
||||
$this->request_data->read_request( $this->nonce() );
|
||||
$user_id = get_current_user_id();
|
||||
$token = $this->identity_token->generate_for_customer( $user_id );
|
||||
$token = $this->identity_token->generate_for_user( $user_id );
|
||||
wp_send_json(
|
||||
array(
|
||||
'token' => $token->token(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue