Home / Admin / WP Simple Pay: Allow Customers to Exempt from Tax
Duplicate Snippet

Embed Snippet on Your Site

WP Simple Pay: Allow Customers to Exempt from Tax

Add a "Checkbox" field with the "Stripe Metadata Label" set to "Tax Exempt"

Code Preview
php
<?php
add_filter(
	'simpay_get_customer_args_from_payment_form_request',
	function( $customer_args, $form, $deprecated, $form_values ) {
		$exempt = isset( $form_values['simpay_field']['Tax Exempt'] );
	
		if ( $exempt ) {
			$customer_args['tax_exempt'] = 'exempt';
		}
		
		return $customer_args;
	},
	10,
	4
);

Comments

Add a Comment