Make setting up Stripe Connect optional

Hi there,

Is it possible to add a php code snippet to make Stripe Set up Optional for vendors who want to publish a free listing ? :

  • A vendor come for the first time on the platform > He wants to publish a listing > If the “price” filed is either empty or equal to 0 > the “go to Stripe Button” is replaced by “publish”.

To make it clear : Everyone can freely publish listings as long as the price field is empty or free.
When they want to put a price for the first time, then they have to set up their Stripe Account (which will not have to be done afterwards of course).

Thank you

Unfortunately there’s no easy way to do this at the moment, it may be possible to disable the redirect completely (leaving only the Set up Stripe link on the account page), but vendors adding premium listings may forget to set it up.

Thanks, we’ll try to improve this workflow.

Thanks ihor.

Do you know how could I remove the redirection when creating a listing ?
I will find a way to warn sellers to configure stripe if the amount is greater than 0.

Please try this PHP snippet but please note that it can require further customization and additional testing

remove_filter( 'hivepress/v1/forms/user_update_profile', [ hivepress()->payout, 'alter_user_update_profile_form' ], 10, 2 );
remove_filter( 'hivepress/v1/forms/vendor_update', [ hivepress()->payout, 'alter_vendor_update_form' ], 10, 2 );

add_filter( 
	'hivepress/v1/models/vendor/attributes',
	function($attributes){
		if(isset($attributes['stripe_id'])){
			$attributes['stripe_id']['edit_field']['required'] = false;
		}
		
		if(isset($attributes['stripe_setup'])){
			$attributes['stripe_setup']['edit_field']['required'] = false;
		}
		
		return $attributes;
	},
	1000
);
add_filter( 
	'hivepress/v1/models/vendor', 
	function($model){
		if(isset($model['fields']['stripe_setup'])){
			$model['fields']['stripe_setup']['required'] = false;
		}
		
		return $model;
	},
	1000
);

Thank you yevhen for this snippet, it works perfectly for me !
Indeed vendors can forget to register their Stripe Account so I take that risk :slight_smile:

Before closing this topic I have an additional question regarding Stripe, is it normal that the loading time for acceding Stripe after clicking “Manage your Stripe Account” is pretty long ? Or even inaccessible because of multiple redirects?

This is the same if you want to “return to the platform”.

It should be pretty fast, but you can try disabling plugins and customizations to detect the reason. When you click the Manage Stripe Account link, HivePress sends an API request to Stripe to generate a login link for a user, waits for this link to be returned from Stripe and redirects to it.

Last one :

If a vendor forget to set up his Stripe account and sell products, where do the money go ? Is it send to admins in totality ?

Hi,

In any case, all initial payments are transferred to the administrator, but an error will most likely be displayed when the order receives the Completed status.

Thanks andrii,

I thought that by going through Stripe Connect, vendors receive already their part of money (Product price minus commission fee) directly on their Stripe account, it doesn’t work that way ?

Hi,

Unfortunately, there’s no such feature.

Everything works like an escrow. All payments are transferred to the site owner and then (if you use stripe connect) automatically transferred to the vendor’s account from the site owner’s stripe connect.

​I hope this is helpful to you.

Hi andrii,

Absolutely, everything’s clear.
It facilitates the processing of payments.

Thanks to you all :slight_smile: