How the Flex for WooCommerce Plugin Works
Learn how the Flex WooCommerce plugin processes HSA/FSA payments and handles different cart eligibility scenarios.
Checking out with Flex
Once the plugin is installed and the payment method is enabled, “Flex | Pay with HSA/FSA” will show up as one of the payment options during checkout. When selected, the plugin will send a request to Flex to generate a checkout session to redirect the user to. As part of generating the checkout session, Flex will check all the items in the customer’s cart and determine its eligibility.
The items in the cart can fall under one of the following:
All items are HSA/FSA eligible
All items in their cart are HSA/FSA eligible either through Auto Substantiation or a Letter of Medical Necessity. The customer will be presented with a banner informing them that all items are eligible and to proceed with the HSA/FSA card.
Some items are HSA/FSA eligible
Some of the items in their cart are HSA/FSA eligible and the remaining items are not. We refer to this scenario as a split cart. In a split cart the customer is presented with a banner informing them that some items are eligible while the remaining are not. They will be prompted for their HSA/FSA card to pay for the items that are eligible and their credit card for the items that are not eligible.
The steps for a split cart are:
- Place a temporary hold on the HSA/FSA payment for the HSA/FSA eligible amount.
- Process the credit/debit card for the non eligible amount.
- Capture the HSA/FSA funds that were placed on hold.
- Redirect to the WooCommerce order completion page.
On the WooCommerce side, this appears as a single order.
Not eligible
None of the customer’s items in the cart have been deemed as HSA/FSA eligible. A banner is presented to the customer informing them that none of the items in their cart are HSA/FSA eligible and they will be prompted to proceed with their credit card to complete their purchase.
Flex optimizes for conversion which is why we prompt the user to proceed with their credit card. Our research indicates directing the customer to start the checkout session process all over again does not convert as well as prompting them for a credit card.
Fulfillment
When a customer checks out with Flex you’ll see the order processed just as it would be for any other payment method. The only difference is in the order details page, the payment gateway specified will be “Flex”.
Plugin dependencies
PHP
This plugin only supports the versions of PHP that are receiving at least security fixes.
WooCommerce
Only the latest version of WooCommerce is supported.
WordPress
Only the latest major release of WordPress is supported by this plugin.
Plugin behavior
Test mode
The plugin uses whatever API Key is provided. If the API Key is a live mode key, everything will be done in live mode, if the API Key is a test mode key, everything will be done in test mode. Switching between live mode and test mode is supported, however, it is highly recommended to disable the payment method before changing the API key. Doing so allows webhooks to be removed and products & prices to be re-synced.
Products & prices
Products and Prices are continuously synced with Flex as soon as the payment gateway is enabled. When a product in WooCommerce is created, updated, or deleted, the change is pushed to Flex. The specific behavior depends on the WooCommerce product type:
Simple products
For Simple Products, a Product is created in Flex as well as a Price for the “Regular” price.
Variable products
Since a Variable Product cannot be added to the cart directly, a Product will be created in Flex, but no Prices will be. For each “Variation”, a Price will be created for the “Regular” price that is attached to the parent Variable Product.
Group products
The Grouped Product cannot be added to the cart directly and consists of Simple Products. Therefore, this product type is ignored by the plugin. ≈
External/affiliate products
Likewise, External/Affiliate Products cannot be added to the cart and are ignored by the plugin.