Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @poglaa

    So the questions here are. Are you planning to improve this in the future and add more payment gateways on the payment methods page?

    There is a specific reason that the customer can’t add every payment method type on the Add Payment Method page. PayPal is a wallet based payment method, meaning it already stores the customer’s payment method for easy access and use.

    Cards are a logical option for adding to the customer’s account because they require manual entry and thus take up time on the checkout page.

    In our opinion, it’s redundant to have a customer add a payment method on the WooCommerce shop when it’s already saved in the wallet.

    Can you provide a business case on why that would be important functionality to have on your site?

    Kind Regards,

    Thread Starter poglaa

    (@poglaa)

    Hi @mrclayton

    Thanks for your quick reply. Here is one of our cases:

    1. Customer have plenty active subscriptions. They used different PayPal accounts for each of them.
    2. Customer wants to change PayPal payment method on a subscription. Let’s say they want to start paying subscription from their business account.
    3. Customer adds a new PayPal method to their account via the “Add Payment Method” page.
    4. Customer updates their payment method on one or all of their subscriptions.

    In your plugin currently, the only way I see that the customer can do such thing is to create a new subscription so the new PayPal method gets saved. (I did not test this yet. I’m assuming.)

    I personally do not se any reason why limiting gateways on the “Add Payment Method” page.

    Cheers!

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @poglaa

    There is a much easier way to accomplish the process you just outlined. The whole reason the WooCommerce Subscriptions plugin provides the “Change Payment Method” page is for this exact scenario.

    Your customers don’t need to go to the Add Payment Method page, add a payment method, then update their subscription.

    They can do all of that from the Change Payment Method page for the subscription. On that page they can select any payment method they want, including PayPal, which will then update the subscription payment method.

    Thanks

    Thread Starter poglaa

    (@poglaa)

    Hi @mrclayton

    You are right but we are not using the default “Change payment method” WooCommerce Subscriptions functionality. We have a custom implementation for that.

    Thread Starter poglaa

    (@poglaa)

    Also, could you please add a filter inside the “\WC_Braintree_Payment_Gateway::available_payment_gateways” method? We’d like to be able to filter the list of gateways that are being unset there.

    Something like this would be great:

    	public static function available_payment_gateways( $gateways ) {
    		global $wp;
    		if ( is_add_payment_method_page() && isset( $wp->query_vars['add-payment-method'] ) ) {
    			$unset_gateways = apply_filters(
    				'wcs_braintree_unset_payment_gateways_on_add_method_page',
    				[
    					'braintree_paypal',
    					'braintree_applepay',
    					'braintree_googlepay',
    					'braintree_venmo',
    				]
    			);
    
    			foreach ( $unset_gateways as $unset_gateway ) {
    				unset( $gateways[ $unset_gateway ] );
    			}
    		}
    
    		return $gateways;
    	}
    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @poglaa

    Instead of a custom filter, why not just remove that action since it’s a static method? You could do:

    add_action('init', function(){
       remove_filter('woocommerce_available_payment_gateways', 'WC_Braintree_Payment_Gateway::available_payment_gateways'
    });

    You can use the WooCommerce filter woocommerce_available_payment_gateways to control the gateways.

    Kind Regards,

    Thread Starter poglaa

    (@poglaa)

    Hi @mrclayton

    That makes sense. Thanks for your quick replies! It’s just not that future proof solution. If in the future, you will add more gateways to the list, it will affect our site. But I think that’s not going to happen often.

    • This reply was modified 1 year, 8 months ago by poglaa.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Customers can’t add PayPal on the payment methods page’ is closed to new replies.