/**
* When a formidable form submitted, add form's connected product to cart.
*/
add_action('frm_after_create_entry', 'ff_take_user_to_wc_checkout_for_payment', 20, 2);
function ff_take_user_to_wc_checkout_for_payment($entry_id, $form_id) {
$linked_products = get_posts([
'post_type' => 'product',
'post_status' => 'publish',
'numberposts' => 1,
'meta_key' => '_attached_formidable_form',
'meta_value' => $form_id,
'cache_results' => false,
]);
if (empty($linked_products)) {
return;
}
$product_id = $linked_products[0]->ID;
if (!function_exists('WC') || !WC()->session) {
return;
}
if (method_exists(WC()->session, 'set_customer_session_cookie')) {
WC()->session->set_customer_session_cookie(true);
}
WC()->cart->empty_cart();
$entry = FrmEntry::getOne($entry_id, true);
$form_data = $entry->metas;
$addon_total = 0;
foreach ($form_data as $value) {
if (is_string($value) && strpos(trim($value), '$') === 0) {
$price = floatval(str_replace(['$', ','], '', $value));
$addon_total += $price;
}
}
WC()->session->set('addon_total', $addon_total);
WC()->cart->add_to_cart($product_id, 1, 0, [], ['addon_total' => $addon_total]);
if (empty($_POST['frm_ajax'])) {
wp_safe_redirect(wc_get_checkout_url());
exit;
}
}
/**
* When an item is added to the cart, remove other products.
*/
add_filter( 'woocommerce_add_to_cart_validation', 'ff_keep_only_one_product_in_the_cart', 10, 3 );
function ff_keep_only_one_product_in_the_cart( $valid, $product_id, $quantity ) {
if( ! empty ( WC()->cart->get_cart() ) && $valid ) {
WC()->cart->empty_cart();
}
return $valid;
}
/**
* Disable add to cart confirmation message.
*/
add_filter( 'wc_add_to_cart_message_html', '__return_false' );
/**
* Redirect user to checkout page after adding a product to cart.
*/
add_filter ('add_to_cart_redirect', 'ff_redirect_to_checkout');
function ff_redirect_to_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
/**
* Calculate formidable add-on prices and add them to the total price in WC checkout.
*/
add_action('woocommerce_before_calculate_totals', 'ff_apply_addon_total_to_cart_price', 10, 1);
function ff_apply_addon_total_to_cart_price($cart) {
if (is_admin() && !defined('DOING_AJAX')) {
return;
}
foreach ($cart->get_cart() as $cart_item) {
if (!empty($cart_item['addon_total'])) {
$base_price = $cart_item['data']->get_price();
$addon_price = floatval($cart_item['addon_total']);
$cart_item['data']->set_price($base_price + $addon_price);
}
}
}
/**
* Use different Authorize.net accounts in checkout.
*/
add_filter( 'option_woocommerce_authorizeaim_settings', function( $woocommerce_authorizeaim_settings ) {
global $woocommerce;
if ( function_exists( 'is_checkout' ) && function_exists( 'get_field' ) && is_checkout() ) {
foreach ( $woocommerce->cart->get_cart() as $cart_item ) {
$product_id = $cart_item['product_id'];
$api_login_id = get_post_meta( $product_id, 'api_login_id', true );
$transaction_key = get_post_meta( $product_id, 'transaction_key', true );
if ( !empty( $api_login_id ) && !empty( $transaction_key ) ) {
$woocommerce_authorizeaim_settings['login_id'] = $api_login_id;
$woocommerce_authorizeaim_settings['transaction_key'] = $transaction_key;
break;
}
}
}
return $woocommerce_authorizeaim_settings;
} );
/**
* When placing a new WC order by submitting formidable,
* set order's customer detail according to the submitted information.
*/
add_action( 'woocommerce_new_order', 'ff_update_customer_data', 10, 2 );
function ff_update_customer_data($order_id,$order){
$postdata = $_POST;
$email = $postdata['la_email'];
$username = $postdata['la_email'];
$args = array(
'user_email' => $email,
'display_name' => $postdata['la_first_name'],
'first_name' => $postdata['la_first_name'],
'last_name' => $postdata['la_last_name']
);
$userdata = wc_create_new_customer($email,$username,'',$args);
$userdata = json_decode(json_encode($userdata), true);
if(isset($userdata['errors'])){
$customer = get_user_by('email',$email);
if($customer){
$user_id = $customer->ID;
}
}else{
$user_id = $userdata;
update_user_meta($user_id, "first_name",$postdata['la_first_name']);
update_user_meta($user_id, "last_name",$postdata['la_last_name']);
}
$address = array(
'first_name' => $postdata['la_first_name'],
'last_name' => $postdata['la_last_name'],
'email' => $email,
'phone' => $postdata['la_ower_phone'],
'address_1' => $postdata['la_buisiness_adddress_1'],
'address_2' => $postdata['la_buisiness_adddress_2'],
'city' => $postdata['la_buisiness_adddress_city'],
'state' => $postdata['la_buisiness_adddress_state'],
'postcode' => $postdata['la_buisiness_adddress_zipcode'],
'country' => 'US'
);
$order = new WC_Order($order_id);
$order->set_customer_id($user_id);
$order->set_address($address, 'billing');
$order->set_address($address, 'shipping');
$order->save();
}
/**
* Link formidable entry with woocommerce order. -- ⇩⇩⇩ --
*/
// 1. Store formidable entry ID in the customer session.
add_action( 'frm_after_create_entry', function( $entry_id, $form_id ) {
WC()->session->set( 'frm_entry_id', $entry_id );
}, 20, 2 );
// 2. Set formidable entry id from session to the order as an order meta.
add_action( 'woocommerce_checkout_create_order', function( $order, $data ) {
if ( $entry_id = WC()->session->get( 'frm_entry_id' ) ) {
$order->update_meta_data( '_frm_entry_id', $entry_id );
}
}, 10, 2 );
// 3. Display the link to the formidable entry on the order details page.
add_filter( 'woocommerce_order_item_display_meta_key', function( $display_value, $meta ) {
if ( $meta->key == '_formidable_form_data' ) {
$display_value = __( 'Formidable Entry', 'formidable-woocommerce' );
}
return $display_value;
}, 10, 2 );
How to Get a Massachusetts Resale Certificate - Fastfilings
Skip to content
How To Get Aresale certificatein massachusetts.
When purchasing goods from a business in the state of Massachusetts, the buyer customarily has to pay a sales tax as part of the total purchase price. There are exceptions to this, however. If a business buys goods from another business on a wholesale basis, the transaction will be exempt from the usual sales tax if the purchaser provides the vendor with a valid resale certificate.
In this article we dive into the process of obtaining and using resale certificates in Massachusetts.
What Is a Resale Certificate?
A Massachusetts resale certificate exempts a business from the obligation to pay sales tax when purchasing goods for resale. When a buyer presents a resale certificate during a wholesale transaction, it proves that they are a registered business that intends to resell the items they purchase.
When reselling, the business is obligated to collect sales tax from the customers at that time. These taxes are passed along to the Massachusetts Department of Revenue.
Although most states allow the use of out-of-state resale certificates, Massachusetts is not among them. In Massachusetts, a business can use only a Massachusetts-issued resale certificate. Otherwise, the business buying goods on a wholesale basis has to pay sales tax.
The official name for a Massachusetts resale certificate is “Form ST-4, Sales Tax Resale Certificate.”
Apply for a Massachusetts Resale Certificate!
Need help filing your resale certificate in Massachusetts?
Anyone operating a business in Massachusetts or selling taxable goods to the residents of Massachusetts is required to use a resale certificate to avoid paying taxes on goods purchased for resale purposes. They must present this certificate to the vendor at the time of the transaction.
How Do I Get a Resale Certificate in Massachusetts
Before you can legally use an MA resale certificate, you must get a Massachusetts vendor registration. After registering your business, Massachusetts assigns you a sales tax ID number, which you should print on the resale certificate.
To fill out the resale certificate:
Download Form ST-4, the Massachusetts resale certificate
Enter your business name and address
Fill out a description of your business
Enter your Federal Employer Identification Number (EIN)
Describe the items being purchased
Include the name and address of the seller
State that you, the buyer, is a registered Massachusetts vendor and will resell the goods being purchased
Is a Resale Certificate the Same as a Sales Tax Permit?
No, a resale certificate is not the same as a sales tax permit. A sales tax permit gives a registered business the legal authorization to collect taxes on taxable goods in Massachusetts. When you have obtained a sales tax permit, you also get an ID number that you can use to fill out the resale certificate.
Other Names for a Massachusetts Resale Certificate
Although resale certificates in Massachusetts are officially called Sales Tax Resale Certificates, they are sometimes informally referred to by other names, including:
Tax exemption certificate
Sales and use tax certificate
Wholesale certificate
Sales tax certification
Reseller’s certificate
All these names refer to the same type of certificate and have the same legal status.
Do Massachusetts Resale Certificates Expire?
No, Massachusetts resale certificates do not expire. A vendor that accepts a resale certificate is expected to retain it in their usual tax records and make it available for auditing purposes if necessary.
What Steps Should a Business Take to Accept a Resale Certificate?
When a business is presented with a resale certificate, they have to verify its authenticity:
Check to confirm that the sales and use tax number on the resale certificate is valid
Verify that the certificate is filled out correctly
Confirm that the goods are related to the nature of the business
The vendor that accepts the resale certificate is expected to act in good faith and take reasonable steps to ensure that it is accurate—for example, the certificate must not be unsigned. In addition, the vendor has an obligation to reject the certificate if they know that the buyer does not make these kinds of purchases for their business. Resale certificates cannot be used to purchase items for personal use or for non-resale purposes (such as office supplies for employees).
A vendor that fails to exercise good faith in accepting a resale certificate can be held liable for uncollected sales tax. But a vendor that acts correctly in accepting a resale certificate will not be held liable even if the purchaser is later proven to have acted fraudulently.
Purchasers that fill out a fraudulent resale certificate can be subject to penalties up to a year in prison and $10,000 in fines ($50,000 for corporations).
How to Get a Massachusetts Business License Using FastFilings
With FastFilings, registering your business with the state of Massachusetts is super simple. All you have to do is spend a few minutes filling out our online form. You will have to provide some basic information about your business, such as:
Business name
Business address and phone number
Social security number or Federal EIN
Type of business entity
Projected monthly sales
When you work with FastFilings, you get access to benefits like:
Easy application process
Excellent customer service
Expedited orders delivered as soon as possible
FastFilings is a trusted company for business filings in Massachusetts. Our customers have left over 3,000 reviews attesting to the excellence of our services. Fill out our online form today to get started.