mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
Fix CI errors
This commit is contained in:
parent
2c0a7596e5
commit
d33ca00ac7
6 changed files with 33 additions and 15 deletions
|
@ -98,12 +98,12 @@ class IdentityToken {
|
|||
( $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ) )
|
||||
&& defined( 'PPCP_FLAG_SUBSCRIPTION' ) && PPCP_FLAG_SUBSCRIPTION
|
||||
) {
|
||||
if($customer_id === 0) {
|
||||
if ( 0 === $customer_id ) {
|
||||
$customer_id = uniqid();
|
||||
WC()->session->set('ppcp_guest_customer_id', $customer_id);
|
||||
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 . $customer_id ) );
|
||||
}
|
||||
|
||||
$response = $this->request( $url, $args );
|
||||
|
|
|
@ -92,14 +92,14 @@ class PaymentTokenEndpoint {
|
|||
public function for_user( int $id ): array {
|
||||
$bearer = $this->bearer->bearer();
|
||||
|
||||
$customer_id = $this->prefix . $id;
|
||||
$guest_customer_id_meta = get_user_meta( $id, 'ppcp_guest_customer_id', true );
|
||||
if($guest_customer_id_meta) {
|
||||
$customer_id = $this->prefix . $guest_customer_id_meta;
|
||||
$customer_id = $this->prefix . $id;
|
||||
$guest_customer_id = get_user_meta( $id, 'ppcp_guest_customer_id', true );
|
||||
if ( $guest_customer_id ) {
|
||||
$customer_id = $this->prefix . $guest_customer_id;
|
||||
}
|
||||
|
||||
$url = trailingslashit( $this->host ) . 'v2/vault/payment-tokens/?customer_id=' . $customer_id;
|
||||
$args = array(
|
||||
$url = trailingslashit( $this->host ) . 'v2/vault/payment-tokens/?customer_id=' . $customer_id;
|
||||
$args = array(
|
||||
'method' => 'GET',
|
||||
'headers' => array(
|
||||
'Authorization' => 'Bearer ' . $bearer->token(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue