Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › Stripe split payment – stripe connect not configured
Tagged: disable sales, stripe connect
- This topic has 6 replies, 3 voices, and was last updated 5 years ago by WCFM Forum.
- AuthorPosts
- December 8, 2019 at 11:36 pm #96620aemr45Participant
Hi guys,
In testing mode, I just configured a new vendor but skipped the Store configuration, then I published a new product and I buy it with a customer user. All worked correctly but since the vendor had no Stripe Connect configured, the total amount was sent to my administrator stripe account.
In order to prevent this to happen, Is there a way to disable sales from the seller who has not set up stripe connect? or, Make it mandatory to set up the stripe connect account before you can publish products or accept payments from customers by credit or debit card?
Thanks
- December 8, 2019 at 11:40 pm #96621sdel_nevoParticipant
Hi
i had the same question ages ago, i purchased some code via a custom job
this works for me really well, it prevents the vendor publishing products until the stripe account has been connected
// vendors can import them and assign a category, but products must not be published until a stripe account is connected add_action( 'after_wcfm_products_manage_meta_save', function( $new_product_id, $wcfm_products_manage_form_data ) { global $WCFM; if( wcfm_is_vendor() ) { $vendor_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() ); $vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true ); $payment_mode = isset( $vendor_data['payment']['method'] ) ? esc_attr( $vendor_data['payment']['method'] ) : '' ; $stripe_user_id = get_user_meta( $vendor_id, 'stripe_user_id', true ); if( !$payment_mode || !$stripe_user_id ) { wcfm_staging_site_set_product_status( $new_product_id ); } } }, 550, 2 ); function wcfm_staging_site_set_product_status( $new_product_id, $status = 'draft' ) { if( !wcfm_is_vendor() ) return; $update_product = array( 'ID' => $new_product_id, 'post_status' => $status, 'post_type' => 'product', ); wp_update_post( $update_product, true ); }
hope this helps
Steve
- December 8, 2019 at 11:50 pm #96622aemr45Participant
You’re the man Steve! thank you! I’ll test it and let you know.
- December 8, 2019 at 11:52 pm #96624sdel_nevoParticipant
you’re more than welcome mate
it works well for me,
hope you’re able to make use of it
Steve
- December 9, 2019 at 1:40 am #96635aemr45Participant
It works really well! It was a success in all the tests I did!
Thank you so much, this solves many of the problems I had anticipated.
- December 9, 2019 at 1:41 am #96636sdel_nevoParticipant
That’s great
you’re most welcome
Steve
- December 9, 2019 at 2:11 pm #96729WCFM ForumMember
Thanks @Steve
- AuthorPosts
- The topic ‘Stripe split payment – stripe connect not configured’ is closed to new replies.