Stripe Payments Workflow Explained (Cross Border Payouts Included)

Hello HivePress Team!

I don’t think there is anyone who figured out stripe payment workflow for all the countries available on stripe. The First issue is recipient agreement for the countries some countries ask for full recipient agreement and If we want to enable HivePress to have cross border payouts. Then we must add the recipient service agreement as well. However when we add recipient agreement with code snippet like I will share then other countries that requires full service agreement won’t be able to set up their payouts on Stripe. Don’t forget cross-border payouts are only enabled if your company is located in US. The other issue is the countries that has recipient service agreement will not accept card payments instead they will use transfer payments so the code must enables both depends on the country chosen. The currency issue can be solved by adding the code snippet that I will share as well but we need a function where it applies all. Ihor it would be amazing if you provide us a code and instructions to how to add this to our platforms. Here are all the codes available from the Hivepress Community.

"$account = hivepress()->payout->stripe()->accounts->create(
					apply_filters(
						'hivepress/v1/components/stripe/create_account',
						[
							'type'             => 'custom',
							'country'          => $vendor->get_country(),
							'email'            => $vendor->get_user__email(),
							//'default_currency' => get_woocommerce_currency(),

							'capabilities'     => [
								//'card_payments' => [ 'requested' => true ],
								'transfers'     => [ 'requested' => true ],
							],
							
							'tos_acceptance' => ['service_agreement' => 'recipient'],
							
							'business_profile' => [
								'name' => $vendor->get_name(),
								'url'  => hivepress()->router->get_url( 'vendor_view_page', [ 'vendor_id' => $vendor->get_id() ] ),
							],
						]
					)
				);" 
add_filter(
	'hivepress/v1/components/stripe/create_account',
	function($args){
		unset($args['default_currency']);

		return $args;
	},
	1000
); 
add_filter(
	'hivepress/v1/components/stripe/create_account',
	function($args){
		$args['tos_acceptance']['service_agreement'] = 'recipient';
		return $args;
	},
	1000
); 

The problems will occur anyways since the service agreement, and payment type will not be according the country chosen. Honestly, if we can solve this officially we can say that hivepress is a fully integrated platform with Stripe.

Hope to hear you soon guys!

Hi,

Thank you for your feedback; we’ve added this information to a feature about better integration for Stripe that we plan to add in future updates. Currently, there is no easy solution for this or the PHP snippet, as it would require custom integration.

Hello Andrii and HivePress Community!

Here is the temporary solution for stripe to make it available for all countries possible.

First for the service agreements you must added the countries who needs service recipient agreement

add_filter(
    'hivepress/v1/components/stripe/create_account',
    function($args){
        $country = $args['country'];
        // Define the default service agreement
        $service_agreement = 'full';

        // Define the list of countries requiring recipient service agreement
        $countries_requiring_recipient = [
            'AL', // Albania
            'AG', // Antigua & Barbuda
            'AR', // Argentina
            'AM', // Armenia
            'AZ', // Azerbaijan
            'BS', // Bahamas
            'BH', // Bahrain
            'BO', // Bolivia
            'BA', // Bosnia & Herzegovina
            'BW', // Botswana
            'BN', // Brunei
            'KH', // Cambodia
            'CL', // Chile
            'CO', // Colombia
            'CR', // Costa Rica
            'CI', // Côte d’Ivoire
            'DO', // Dominican Republic
            'EC', // Ecuador
            'EG', // Egypt
            'SV', // El Salvador
            'ET', // Ethiopia
            'GM', // Gambia
            'GH', // Ghana
            'GT', // Guatemala
            'GY', // Guyana
            'IS', // Iceland
            'IN', // India
            'ID', // Indonesia
            'IL', // Israel
            'JM', // Jamaica
            'JO', // Jordan
            'KE', // Kenya
            'KW', // Kuwait
            'MO', // Macao SAR China
            'MG', // Madagascar
            'MY', // Malaysia
            'MU', // Mauritius
            'MD', // Moldova
            'MC', // Monaco
            'MN', // Mongolia
            'MA', // Morocco
            'NA', // Namibia
            'NE', // Niger
            'NG', // Nigeria
            'MK', // North Macedonia
            'OM', // Oman
            'PK', // Pakistan
            'PA', // Panama
            'PY', // Paraguay
            'PE', // Peru
            'PH', // Philippines
            'QA', // Qatar
            'RW', // Rwanda
            'SA', // Saudi Arabia
            'SN', // Senegal
            'RS', // Serbia
            'ZA', // South Africa
            'KR', // South Korea
            'LK', // Sri Lanka
            'LC', // St. Lucia
            'TW', // Taiwan
            'TZ', // Tanzania
            'TT', // Trinidad & Tobago
            'TN', // Tunisia
            'TR', // Turkey
            'UY', // Uruguay
            'UZ', // Uzbekistan
            'VN', // Vietnam
        ];

        // Check if the country requires recipient service agreement
        if (in_array($country, $countries_requiring_recipient)) {
            $service_agreement = 'recipient';
        }

        // Set the 'tos_acceptance' parameter based on the determined service agreement
        $args['tos_acceptance'] = ['service_agreement' => $service_agreement];

        return $args;
    },
    1000
);

Now you need to make this countries transfers instead card payments

add_filter(
    'hivepress/v1/components/stripe/create_account',
    function($args){
        $country = $args['country'];
        // Define the default capability
        $capability = 'card_payments';

        // Define the list of countries requiring transfers
        $countries_requiring_transfers = [
            'AL', // Albania
            'AG', // Antigua & Barbuda
            'AR', // Argentina
            'AM', // Armenia
            'AZ', // Azerbaijan
            'BS', // Bahamas
            'BH', // Bahrain
            'BO', // Bolivia
            'BA', // Bosnia & Herzegovina
            'BW', // Botswana
            'BN', // Brunei
            'KH', // Cambodia
            'CL', // Chile
            'CO', // Colombia
            'CR', // Costa Rica
            'CI', // Côte d’Ivoire
            'DO', // Dominican Republic
            'EC', // Ecuador
            'EG', // Egypt
            'SV', // El Salvador
            'ET', // Ethiopia
            'GM', // Gambia
            'GH', // Ghana
            'GT', // Guatemala
            'GY', // Guyana
            'IS', // Iceland
            'IN', // India
            'ID', // Indonesia
            'IL', // Israel
            'JM', // Jamaica
            'JO', // Jordan
            'KE', // Kenya
            'KW', // Kuwait
            'MO', // Macao SAR China
            'MG', // Madagascar
            'MY', // Malaysia
            'MU', // Mauritius
            'MD', // Moldova
            'MC', // Monaco
            'MN', // Mongolia
            'MA', // Morocco
            'NA', // Namibia
            'NE', // Niger
            'NG', // Nigeria
            'MK', // North Macedonia
            'OM', // Oman
            'PK', // Pakistan
            'PA', // Panama
            'PY', // Paraguay
            'PE', // Peru
            'PH', // Philippines
            'QA', // Qatar
            'RW', // Rwanda
            'SA', // Saudi Arabia
            'SN', // Senegal
            'RS', // Serbia
            'ZA', // South Africa
            'KR', // South Korea
            'LK', // Sri Lanka
            'LC', // St. Lucia
            'TW', // Taiwan
            'TZ', // Tanzania
            'TT', // Trinidad & Tobago
            'TN', // Tunisia
            'TR', // Turkey
            'UY', // Uruguay
            'UZ', // Uzbekistan
            'VN'  // Vietnam
        ];

        // Check if the country requires transfers
        if (in_array($country, $countries_requiring_transfers)) {
            $capability = 'transfers';
        }

        // Set the 'capabilities' parameter based on the determined capability
        $args['capabilities'] = [
            $capability => [ 'requested' => true ]
        ];

        return $args;
    },
    1000
);

Also, make sure that its used default currency

add_filter(
	'hivepress/v1/components/stripe/create_account',
	function($args){
		unset($args['default_currency']);

		return $args;
	},
	1000
);

I hope this will help our community. Now, with this snippets you can use stripe for all the countries that is available on Stripe. Good luck guys!

1 Like