Plugin Directory

Changeset 3012481


Ignore:
Timestamp:
12/20/2023 01:55:43 PM (2 years ago)
Author:
ocasait
Message:

Fix assets

Location:
ocasa-ecommerce
Files:
4 added
10 edited

Legend:

Unmodified
Added
Removed
  • ocasa-ecommerce/tags/1.0.0/src/api/class-ocasa-woo-api.php

    r3010017 r3012481  
    1515class OcasaWooApi extends \Conexa\Woo\ApiWoo\ApiConnector implements \Conexa\Woo\ApiWoo\ApiInterface {
    1616
    17     // const API_BASE_URL = 'https://ocasa-woocommerce-api.conexa.ai';
    18     const API_BASE_URL = 'https://ocasa-woocommerce-api-stage.conexa.ai';
     17    const API_BASE_URL = 'https://ocasa-woocommerce-api.conexa.ai';
     18    // const API_BASE_URL = 'https://ocasa-woocommerce-api-stage.conexa.ai';
    1919
    2020    /**
  • ocasa-ecommerce/tags/1.0.0/src/panel/class-main.php

    r3010017 r3012481  
    3131            array( __CLASS__, 'page_content' )
    3232        );
     33
     34        return true;
    3335    }
    3436
     
    3840    public static function page_content() {
    3941
     42
    4043        if ( ! is_admin() && ! current_user_can( 'manage_options' ) && ! current_user_can( 'manage_woocommerce' ) ) {
    4144            die( __( 'what are you doing here?', 'ocasawootextdomain' ) );
    4245        }
    43 
     46               
    4447        $userId = get_option( 'ocasawoo_user' );
    4548
     
    5457        $res = $sdk->register_or_login( $userId );
    5558
    56         if ( $res['response'] ) {
    57            
     59        if ( $res != false) {
    5860            $data           = array();
    5961            $data['userId'] = $userId;
    6062            $data['token']  = $res['token'];
    61             // $data['url']    = ( $res['userOnboard'] ) ? 'https://ocasa-woocommerce.conexa.ai/woocommerce/panel/orders?userId=' . $data['token'] : 'https://ocasa-woocommerce.conexa.ai/woocommerce/onboarding?userId=' . $data['token'];
    62             $data['url']    = ( $res['userOnboard'] ) ? 'https://ocasa-integrations-frontend.vercel.app/woocommerce/panel/orders?userId=' . $data['token'] : 'https://ocasa-integrations-frontend.vercel.app/woocommerce/onboarding?userId=' . $data['token'];
     63            $data['url']    = ( $res['userOnboard'] ) ? 'https://ocasa-woocommerce.conexa.ai/woocommerce/panel/orders?userId=' . $data['token'] : 'https://ocasa-woocommerce.conexa.ai/woocommerce/onboarding?userId=' . $data['token'];
     64            // $data['url']    = ( $res['userOnboard'] ) ? 'https://ocasa-integrations-frontend.vercel.app/woocommerce/panel/orders?userId=' . $data['token'] : 'https://ocasa-integrations-frontend.vercel.app/woocommerce/onboarding?userId=' . $data['token'];
    6365            helper::get_template_part( 'panel', 'content', $data );
    64 
     66            return true;
    6567        }
    6668
  • ocasa-ecommerce/tags/1.0.0/src/sdk/class-ocasa-woo-sdk.php

    r3010017 r3012481  
    4848                $headers
    4949            );
    50             $response = $this->handle_response( $response, __FUNCTION__ );
     50        } catch ( \Exception $e ) {
     51            Helper::log_error( __FUNCTION__ . ': ' . $e->getMessage() );
     52            return false;
     53        }
     54        $response = $this->handle_response( $response, __FUNCTION__ );
     55        if($response){
    5156            update_option( 'ocasawoo_token', $response['token'] );
    5257            return array(
    53                 'response'       => true,
    5458                'token'       => $response['token'],
    5559                'userOnboard' => $response['userOnboard'],
    5660            );
    57 
    58         } catch ( \Exception $e ) {
    59             Helper::log_error( __FUNCTION__ . ': ' . $e->getMessage() );
    60             return array(
    61                 'response'       => false,
    62             );
    63         }
    64 
     61        }
     62        return false;
    6563    }
    6664
  • ocasa-ecommerce/trunk/src/api/class-ocasa-woo-api.php

    r3010017 r3012481  
    1515class OcasaWooApi extends \Conexa\Woo\ApiWoo\ApiConnector implements \Conexa\Woo\ApiWoo\ApiInterface {
    1616
    17     // const API_BASE_URL = 'https://ocasa-woocommerce-api.conexa.ai';
    18     const API_BASE_URL = 'https://ocasa-woocommerce-api-stage.conexa.ai';
     17    const API_BASE_URL = 'https://ocasa-woocommerce-api.conexa.ai';
     18    // const API_BASE_URL = 'https://ocasa-woocommerce-api-stage.conexa.ai';
    1919
    2020    /**
  • ocasa-ecommerce/trunk/src/panel/class-main.php

    r3010017 r3012481  
    3131            array( __CLASS__, 'page_content' )
    3232        );
     33
     34        return true;
    3335    }
    3436
     
    3840    public static function page_content() {
    3941
     42
    4043        if ( ! is_admin() && ! current_user_can( 'manage_options' ) && ! current_user_can( 'manage_woocommerce' ) ) {
    4144            die( __( 'what are you doing here?', 'ocasawootextdomain' ) );
    4245        }
    43 
     46               
    4447        $userId = get_option( 'ocasawoo_user' );
    4548
     
    5457        $res = $sdk->register_or_login( $userId );
    5558
    56         if ( $res['response'] ) {
    57            
     59        if ( $res != false) {
    5860            $data           = array();
    5961            $data['userId'] = $userId;
    6062            $data['token']  = $res['token'];
    61             // $data['url']    = ( $res['userOnboard'] ) ? 'https://ocasa-woocommerce.conexa.ai/woocommerce/panel/orders?userId=' . $data['token'] : 'https://ocasa-woocommerce.conexa.ai/woocommerce/onboarding?userId=' . $data['token'];
    62             $data['url']    = ( $res['userOnboard'] ) ? 'https://ocasa-integrations-frontend.vercel.app/woocommerce/panel/orders?userId=' . $data['token'] : 'https://ocasa-integrations-frontend.vercel.app/woocommerce/onboarding?userId=' . $data['token'];
     63            $data['url']    = ( $res['userOnboard'] ) ? 'https://ocasa-woocommerce.conexa.ai/woocommerce/panel/orders?userId=' . $data['token'] : 'https://ocasa-woocommerce.conexa.ai/woocommerce/onboarding?userId=' . $data['token'];
     64            // $data['url']    = ( $res['userOnboard'] ) ? 'https://ocasa-integrations-frontend.vercel.app/woocommerce/panel/orders?userId=' . $data['token'] : 'https://ocasa-integrations-frontend.vercel.app/woocommerce/onboarding?userId=' . $data['token'];
    6365            helper::get_template_part( 'panel', 'content', $data );
    64 
     66            return true;
    6567        }
    6668
  • ocasa-ecommerce/trunk/src/sdk/class-ocasa-woo-sdk.php

    r3010017 r3012481  
    4848                $headers
    4949            );
    50             $response = $this->handle_response( $response, __FUNCTION__ );
     50        } catch ( \Exception $e ) {
     51            Helper::log_error( __FUNCTION__ . ': ' . $e->getMessage() );
     52            return false;
     53        }
     54        $response = $this->handle_response( $response, __FUNCTION__ );
     55        if($response){
    5156            update_option( 'ocasawoo_token', $response['token'] );
    5257            return array(
    53                 'response'       => true,
    5458                'token'       => $response['token'],
    5559                'userOnboard' => $response['userOnboard'],
    5660            );
    57 
    58         } catch ( \Exception $e ) {
    59             Helper::log_error( __FUNCTION__ . ': ' . $e->getMessage() );
    60             return array(
    61                 'response'       => false,
    62             );
    63         }
    64 
     61        }
     62        return false;
    6563    }
    6664
Note: See TracChangeset for help on using the changeset viewer.