diff --git a/modules/ppcp-api-client/src/Endpoint/IdentityToken.php b/modules/ppcp-api-client/src/Endpoint/IdentityToken.php index ae12fdfca..ee43106ac 100644 --- a/modules/ppcp-api-client/src/Endpoint/IdentityToken.php +++ b/modules/ppcp-api-client/src/Endpoint/IdentityToken.php @@ -103,7 +103,7 @@ class IdentityToken { WC()->session->set( 'ppcp_guest_customer_id', $customer_id ); } - $args['body'] = wp_json_encode( array( 'customer_id' => $this->prefix . $customer_id ) ); + $args['body'] = wp_json_encode( array( 'customer_id' => $this->prefix . (string) $customer_id ) ); } $response = $this->request( $url, $args ); diff --git a/modules/ppcp-vaulting/src/VaultingModule.php b/modules/ppcp-vaulting/src/VaultingModule.php index bedaec1bc..d74dfc86e 100644 --- a/modules/ppcp-vaulting/src/VaultingModule.php +++ b/modules/ppcp-vaulting/src/VaultingModule.php @@ -101,10 +101,10 @@ class VaultingModule implements ModuleInterface { $subscription_helper = $container->get( 'subscription.helper' ); add_action( 'woocommerce_created_customer', - function( $customer_id ) use ( $subscription_helper ) { + function( int $customer_id ) use ( $subscription_helper ) { $guest_customer_id = WC()->session->get( 'ppcp_guest_customer_id' ); if ( $guest_customer_id && $subscription_helper->cart_contains_subscription() ) { - update_user_meta( $customer_id, 'ppcp_guest_customer_id', WC()->session->get( 'ppcp_guest_customer_id' ) ); + update_user_meta( $customer_id, 'ppcp_guest_customer_id', $guest_customer_id ); } } );