Plugin Directory

Changeset 3264257


Ignore:
Timestamp:
03/31/2025 07:03:43 AM (12 months ago)
Author:
inspireui
Message:

version 4.17.2

Location:
mstore-api
Files:
539 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • mstore-api/trunk/controllers/flutter-home.php

    r3227477 r3264257  
    1818    protected $namespace = 'wc/v2/flutter';//prefix must be wc/ or wc- to reuse check permission function in woo commerce
    1919    protected $namespace_v3 = 'wc/v3/flutter';
    20     private $whilelist = ['id','name','slug', 'permalink','date_created','date_created_gmt','date_modified','date_modified_gmt','type','status','featured','catalog_visibility','description','short_description','sku','price','regular_price','sale_price','date_on_sale_from','date_on_sale_from_gmt','date_on_sale_to','date_on_sale_to_gmt','price_html','on_sale','purchasable','total_sales','virtual','downloadable','downloads','download_limit','download_expiry','external_url','button_text','tax_status','tax_class','manage_stock','stock_quantity','stock_status','backorders','backorders_allowed','backordered','sold_individually','weight','dimensions','shipping_required','shipping_taxable','shipping_class','shipping_class_id','reviews_allowed','average_rating','rating_count','related_ids','upsell_ids','cross_sell_ids','parent_id','purchase_note','categories','tags','images','attributes','default_attributes','variations','grouped_products','menu_order','meta_data','store','attributesData', 'variation_products'];
     20    private $whilelist = ['id','name','slug', 'permalink','date_created','date_created_gmt','date_modified','date_modified_gmt','type','status','featured','catalog_visibility','description','short_description','sku','price','regular_price','sale_price','date_on_sale_from','date_on_sale_from_gmt','date_on_sale_to','date_on_sale_to_gmt','price_html','on_sale','purchasable','total_sales','virtual','downloadable','downloads','download_limit','download_expiry','external_url','button_text','tax_status','tax_class','manage_stock','stock_quantity','stock_status','backorders','backorders_allowed','backordered','sold_individually','weight','dimensions','shipping_required','shipping_taxable','shipping_class','shipping_class_id','reviews_allowed','average_rating','rating_count','related_ids','upsell_ids','cross_sell_ids','parent_id','purchase_note','categories','tags','images','attributes','default_attributes','variations','grouped_products','menu_order','meta_data','store','attributesData', 'variation_products', 'min_price','max_price'];
    2121    private $metaDataWhilelist = ['wc_appointments_','_aftership_', '_wcfmd_','_orddd_','_minmax_product_','product_id','order_id','staff_ids','_video_url','_woofv_video_embed','_product_addons','_wholesale_price','_have_wholesale_price'];
    2222    private $supportedLayouts = ["fourColumn","threeColumn","twoColumn","staggered","saleOff","card","listTile","largeCardHorizontalListItems","largeCard","simpleVerticalListItems","simpleList"];
  • mstore-api/trunk/controllers/flutter-stripe.php

    r3132501 r3264257  
    6767        $return_url = sanitize_text_field($body['returnUrl']);
    6868        $email = sanitize_text_field($body['email']);
     69        $payment_method_types = sanitize_text_field($body['payment_method_types']);
    6970
    7071        $order  = wc_get_order( $order_id );
     
    7778            'amount'               => WC_Stripe_Helper::get_stripe_amount( $amount, strtolower( $currency ) ),
    7879            'currency'             => strtolower( $currency ),
    79             'payment_method_types' => ['card'],
     80            'payment_method_types' => isset($payment_method_types) && !empty($payment_method_types) ? $payment_method_types : ['card'],
    8081            'capture_method'       => $capture_method == 'automatic' ? 'automatic' : 'manual',
    8182            'metadata'             => ['order_id'=>$order_id],
  • mstore-api/trunk/controllers/flutter-user.php

    r3234382 r3264257  
    22require_once(__DIR__ . '/flutter-base.php');
    33require_once(__DIR__ . '/helpers/apple-sign-in-helper.php');
     4require_once(__DIR__ . '/helpers/facebook-jwt-helper.php');
    45
    56class FlutterUserController extends FlutterBaseController
     
    698699            return parent::sendError("invalid_login", "You must include a 'access_token' variable. Get the valid access_token for this app from Facebook API.", 400);
    699700        }
    700         $url = 'https://graph.facebook.com/me/?fields=' . $fields . '&access_token=' . $access_token;
    701 
    702         $result = wp_remote_retrieve_body(wp_remote_get($url));
    703 
    704         $result = json_decode($result, true);
     701
     702        $result = [];
     703
     704        // If token is an AuthenticationToken (in case of limited login for
     705        // iOS), validate the JWT and return the payload
     706        $jwt = FacebookJWTHelper::validateJWT($access_token);
     707
     708        if ($jwt['success']) {
     709            $decodedPayload = $jwt['decoded']['payload'];
     710            $result["email"] = $decodedPayload->email;
     711            $result["name"] = $decodedPayload->name;
     712            $result["first_name"] = $decodedPayload->given_name;
     713            $result["last_name"] = $decodedPayload->family_name;
     714        } else {
     715            $url = 'https://graph.facebook.com/me/?fields=' . $fields . '&access_token=' . $access_token;
     716            $payload = wp_remote_retrieve_body(wp_remote_get($url));
     717            $result = json_decode($payload, true);
     718        }
    705719
    706720        if (isset($result["email"])) {
  • mstore-api/trunk/controllers/listing-rest-api/class.api.fields.php

    r3246917 r3264257  
    1717    public function __construct()
    1818    {
    19 
    20         $theme = wp_get_theme(get_template());
    21         $this->_template = strtolower($theme->get('Name'));
    22 
    23         if (strpos($this->_template, $this->_listeo) !== false)
    24         {
    25             $this->_isListeo = 1;
    26         }
    27         if (strpos($this->_template, $this->_myListing) !== false)
    28         {
    29             $this->_isMyListing = 1;
    30         }
    31         if (strpos($this->_template, $this->_listingPro) !== false)
    32         {
    33             $this->_isListingPro = 1;
    34         }
    35         if (strpos($this->_template, $this->_listable) !== false)
    36         {
    37             $this->_isListable = 1;
    38         }
    39         if (strpos($this->_template, $this->_listify) !== false)
    40         {
    41             $this->_isListify = 1;
    42         }
    43 
    44         if($this->_isListeo != 1 && $this->_isListingPro != 1 && $this->_isListable != 1 && $this->_isListify != 1){
    45             $this->_isMyListing = 1;
    46         }
     19        // Delay theme detection to init hook to avoid premature textdomain loading
     20        add_action('init', array($this, 'detect_theme'));
    4721
    4822        add_action('init', array(
     
    5024            'add_custom_type_to_rest_api'
    5125        ));
     26       
    5227        add_action('rest_api_init', array(
    5328            $this,
    5429            'register_add_more_fields_to_rest_api'
    5530        ));
     31    }
     32   
     33    /**
     34     * Detect the theme and set related properties
     35     */
     36    public function detect_theme()
     37    {
     38        $theme = wp_get_theme(get_template());
     39        $this->_template = strtolower($theme->get('Name'));
     40
     41        if (strpos($this->_template, $this->_listeo) !== false)
     42        {
     43            $this->_isListeo = 1;
     44        }
     45        if (strpos($this->_template, $this->_myListing) !== false)
     46        {
     47            $this->_isMyListing = 1;
     48        }
     49        if (strpos($this->_template, $this->_listingPro) !== false)
     50        {
     51            $this->_isListingPro = 1;
     52        }
     53        if (strpos($this->_template, $this->_listable) !== false)
     54        {
     55            $this->_isListable = 1;
     56        }
     57        if (strpos($this->_template, $this->_listify) !== false)
     58        {
     59            $this->_isListify = 1;
     60        }
     61
     62        if($this->_isListeo != 1 && $this->_isListingPro != 1 && $this->_isListable != 1 && $this->_isListify != 1){
     63            $this->_isMyListing = 1;
     64        }
    5665
    5766        if($this->_isListeo){
     
    21642173            }
    21652174
     2175            // Delay theme detection to init hook to avoid premature textdomain loading
     2176            add_action('init', array($this, 'detect_theme'));
     2177
     2178            // Register REST API endpoints
     2179            add_action('rest_api_init', array(
     2180                $this,
     2181                'register_add_more_fields_to_rest_api_listing'
     2182            ));
     2183        }
     2184
     2185        /**
     2186         * Detect the theme and set related properties
     2187         */
     2188        public function detect_theme()
     2189        {
    21662190            $isChild = strstr(strtolower(wp_get_theme()), "child");
    21672191            if ($isChild == 'child') {
     
    21792203            $this->_isListify = $this->_template == $this->_listify ? 1 : 0;
    21802204            $this->_isMyListing = $this->_template == $this->_myListing ? 1 : 0;
    2181 
    2182             add_action('rest_api_init', array(
    2183                 $this,
    2184                 'register_add_more_fields_to_rest_api_listing'
    2185             ));
    21862205        }
    21872206
     
    23062325        public function __construct()
    23072326        {
    2308             /* extends from parent */
    2309             parent::__construct($this->_isListingPro ? 'listing' : 'job_listing');
     2327            // Initialize rest_api_init hook immediately
    23102328            add_action('rest_api_init', array(
    23112329                $this,
    23122330                'register_fields_for_search_advance'
    23132331            ));
     2332           
     2333            // Call parent constructor to ensure proper initialization
     2334            parent::__construct();
    23142335        }
    23152336
  • mstore-api/trunk/functions/index.php

    r3234382 r3264257  
    10261026                $attributes = [];
    10271027                if (isset($item["meta_data"])) {
    1028                     foreach ($item["meta_data"] as $item) {
    1029                         if($item["value"] != null){
    1030                             $attributes[strtolower($item["key"])] = $item["value"];
     1028                    foreach ($item["meta_data"] as $meta_data_item) {
     1029                        if($meta_data_item["value"] != null){
     1030                            $attributes[strtolower($meta_data_item["key"])] = $meta_data_item["value"];
    10311031                        }
    10321032                    }
  • mstore-api/trunk/mstore-api.php

    r3246917 r3264257  
    44 * Plugin URI: https://github.com/inspireui/mstore-api
    55 * Description: The MStore API Plugin which is used for the FluxBuilder and FluxStore Mobile App
    6  * Version: 4.17.1
     6 * Version: 4.17.2
    77 * Author: FluxBuilder
    88 * Author URI: https://fluxbuilder.com
     
    6262class MstoreCheckOut
    6363{
    64     public $version = '4.17.1';
     64    public $version = '4.17.2';
    6565
    6666    public function __construct()
  • mstore-api/trunk/readme.txt

    r3246917 r3264257  
    44Requires at least: 4.4
    55Tested up to:      6.5.3
    6 Stable tag:        4.17.1
     6Stable tag:        4.17.2
    77License:           GPL-2.0
    88License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    4949
    5050== Changelog ==
     51= 4.17.2 =
     52  * fix addons in webview
     53  * fix(HomeCache): not show min max price
     54  * feat(Facebook): support limited login in ios
     55  * feat(Stripe): support payment method types
     56
    5157= 4.17.1 =
    5258  * Support WP REST Cache for WooCommerce Api
Note: See TracChangeset for help on using the changeset viewer.