Change Vendor Country after account has been created

Hello.

Almost all my users are from Norway, so I have implemented an automatic process of selecting the country when an account is created.

add_action(
	'hivepress/v1/models/vendor/create',
	function ($vendor_id) {
		if (get_option('hp_payout_system') === 'stripe') {
			update_post_meta($vendor_id, 'hp_country', 'NO');
		}
	},
	1000
);
// Removes the field from the front end
add_filter(
	'hivepress/v1/forms/vendor_update',
	function ($form) {
		if (isset($form['fields']['country'])) {
			$form['fields']['country'] = [
				'type' => 'hidden',
			];
		}

		return $form;
	},
	1000
);

However, on occasions, I have a user the rescide outside of Norway, that cannot move on with the Stripe Onboarding process because Norway was auto-selected. Now, when the damage is done, how can I change that users country from NO to a different country? There is no field in the back-end, and the hp_country field in the database has some user ID’s linked to them, but the IDs are not the same as the vendor draft ID nor the User ID. I have even tryed to change it in the Stripe Dashboard, but it seemes to only accept inputs from the API.

How can I fix this for the user?

Any idea how this could be done? Would appreciate some guidance.

Thank you for waiting. Please try this PHP code snippet. It changes vendor Stripe country on your website when you refresh any page on your website

add_action(
	'template_redirect',
	function(){
		update_post_meta(vendor id, 'hp_country', 'country code');
	}
);

But unfortunately, it is necessary to create a new vendor’s connected account to change the vendor country on Stripe. Here is a topic from Stripe documentation Change the country a Stripe account was registered in : Stripe: Help & Support

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.