Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter toddwdavis

    (@toddwdavis)

    Thanks for the update and fair warning!

    Thread Starter toddwdavis

    (@toddwdavis)

    Yes I got it working on that page, but I had to include some localized variables from WC and I also rewrote the JS files, and while I was in there I upgraded Stripe.JS to use V3 elements.

    Thread Starter toddwdavis

    (@toddwdavis)

    I’m using it in the WC Lovers Marketplace Frontend Manager. Being able to filter the Stripe Client Headers would be great too. I can send you the filters I’ve already added for my personal use.

    /**
         * Generate request headers.
         *
         * @param  string $processed_method The uppercase HTTP method.
         * @param  Config $config           Request configuration.
         * @return array                    Associative array of headers.
         */
        private function generate_request_headers( $processed_method, $config ) {
            $headers = [];
    
            if ( $config->api_version ) {
                $headers['Stripe-Version'] = $config->api_version;
            }
    
            if ( $config->secret_key ) {
                $headers['Authorization'] = "Bearer $config->secret_key";
            }
    
            if ( $processed_method === 'POST' ) {
                $headers['Idempotency-Key'] = $config->idempotency_key ?: bin2hex( random_bytes( 16 ) );
            }
    
            $headers = $config->headers + $headers;
    
            return apply_filters( 'woo_mp_stripe_request_headers', $headers ) ;
        }
    /**
         * Output a template.
         *
         * @param  string $name The name of the template.
         * @return void
         */
        private function template( $name ) {
            $directories = array_merge(
                $this->gateway_template_directories,
                [ WOO_MP_PATH . '/templates' ],
                Woo_MP::is_pro() ? [ WOO_MP_PRO_PATH . '/templates' ] : []
            );
    
            foreach ( $directories as $directory ) {
                $path = apply_filters( 'woo_mp_payment_meta_box_template', "$directory/$name.php", $name ) ;
    
                if ( is_readable( $path ) ) {
                    require $path;
    
                    break;
                }
            }
        }

    //main plugin file
    if ( ( ! is_admin() && ( ! defined( ‘DOING_CRON’ ) || ! DOING_CRON ) ) || is_network_admin() || ! apply_filters( ‘woo_mp_force_load’, false ) ) {
    return;
    }

Viewing 3 replies - 1 through 3 (of 3 total)