• Resolved indreshyadav

    (@indreshyadav)


    Hello Team,
    we are making stripe plugin compatibility with others plugin
    so we need some filters in following places to handle handle payment option.
    In your plugin file /include/class-wc-stripe-upe-payment-gateway.php

    1. we need a filter withing ‘get_upe_enabled_at_checkout_payment_method_ids’ function
    like return apply_filters(‘wc_stripe_upe_enable_payment_method’, $available_method_ids, $order_id );
    For Example,

    public function get_upe_enabled_at_checkout_payment_method_ids( $order_id = null ) {
    		$is_automatic_capture_enabled = $this->is_automatic_capture_enabled();
    		$available_method_ids         = [];
    		foreach ( $this->get_upe_enabled_payment_method_ids() as $payment_method_id ) {
    			if ( ! isset( $this->payment_methods[ $payment_method_id ] ) ) {
    				continue;
    			}
    
    			$method = $this->payment_methods[ $payment_method_id ];
    			if ( $method->is_enabled_at_checkout( $order_id ) === false ) {
    				continue;
    			}
    
    			if ( ! $is_automatic_capture_enabled && $method->requires_automatic_capture() ) {
    				continue;
    			}
    
    			$available_method_ids[] = $payment_method_id;
    		}
    
    		return apply_filters('wc_stripe_upe_enable_payment_method', $available_method_ids, $order_id );
    	}

    2. Also in process_payment function after line no 496.
    $save_payment_method = apply_filters('wc_stripe_upe_force_save_source', $save_payment_method, $order );

    Please review this and provide the filter, if you have any alternate solution please provide.

    • This topic was modified 4 years, 4 months ago by indreshyadav.
Viewing 1 replies (of 1 total)
  • Hello @indreshyadav ,

    If I understand correctly, you are suggesting two filters that would help you to integrate with another plugin that you are creating.

    While we are unable to guarantee if additional filters will be added to the extension, feel free to suggest these changes directly to Stripe’s GitHub Repository as an enhancement request: https://github.com/woocommerce/woocommerce-gateway-stripe/issues

    Our developers will review the request and will give feedback based on the current goals and priorities for the extension.

    I’ll mark this thread as resolved because this discussion suits better in the GitHub repository.

Viewing 1 replies (of 1 total)

The topic ‘plugin compatibility’ is closed to new replies.