);
}
```
## Step 3: Handle Payment Confirmation
### Option A: Webhooks (Recommended)
```javascript theme={null}
// /api/webhooks/gale
app.post('/webhooks/gale', async (req, res) => {
const event = req.body;
// Verify webhook signature
const isValid = verifyGaleSignature(
req.headers['x-gale-signature'],
req.body
);
if (!isValid) {
return res.status(401).send('Invalid signature');
}
switch (event.type) {
case 'order.created':
// Order was created successfully
const { id, customer, line_items } = event.data;
await fulfillOrder(id, line_items);
await sendConfirmationEmail(customer.email);
break;
case 'checkout.failed':
// Payment failed
await handlePaymentFailure(event.data.checkout_id);
break;
}
res.status(200).send('OK');
});
```
[Learn more about Webhooks →](/developer-manual/webhooks)
### Option B: PostMessage Events
Listen for iframe postMessage events:
```javascript theme={null}
window.addEventListener('message', (event) => {
if (event.origin !== 'https://checkout.withgale.com') return;
switch (event.data.type) {
case 'checkout.completed':
// Payment successful
console.log('Checkout ID:', event.data.checkout_id);
console.log('Order ID:', event.data.order_id);
// Show success message or redirect
window.location.href = '/success';
break;
case 'checkout.cancelled':
// Customer cancelled
window.location.href = '/checkout';
break;
case 'checkout.error':
// Error occurred
console.error('Checkout error:', event.data.error);
break;
}
});
```
### Option C: Polling (Not Recommended)
Check order status via webhooks instead of polling. If you must poll, use the Order API:
```javascript theme={null}
const checkOrderStatus = async (orderId) => {
const response = await fetch(
`https://api.withgale.com/api/v2/orders/${orderId}`,
{
headers: {
'Authorization': `Bearer ${API_KEY}`
}
}
);
const order = await response.json();
if (order.status === 'completed') {
// Payment completed
return true;
}
return false;
};
```
## Subscription Support
Embedded checkout fully supports subscriptions:
```json theme={null}
{
"line_items": [
{
"product_id": "MONTHLY_VITAMINS",
"name": "Monthly Vitamin Subscription",
"quantity": 1,
"price": 2999,
"currency": "USD"
}
],
"payment_type": "subscription",
"subscription": {
"interval": "monthly",
"interval_count": 1,
"trial_period_days": 7
}
}
```
Customers will see subscription terms in the checkout and agree to recurring billing.
## Customization
### Iframe Styling
```css theme={null}
#gale-checkout {
width: 100%;
max-width: 800px;
height: 650px;
border: 1px solid #e5e7eb;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
/* Responsive */
@media (max-width: 768px) {
#gale-checkout {
height: 700px;
}
}
```
### Success/Failure URLs
Customize where customers land after checkout:
```json theme={null}
{
"success_url": "https://yoursite.com/thank-you?session_id={CHECKOUT_SESSION_ID}",
"failure_url": "https://yoursite.com/checkout/cancel"
}
```
Variables available:
* `{CHECKOUT_SESSION_ID}` - Checkout session identifier
* `{ORDER_ID}` - Order identifier (after payment)
* `{CUSTOMER_EMAIL}` - Customer's email
## Platform Integration Examples
### Multi-Tenant Platform
```javascript theme={null}
// Create checkout for specific merchant/store
const createMerchantCheckout = async (merchantId, storeId, checkoutData) => {
const response = await fetch('https://api.withgale.com/api/v2/checkout', {
method: 'POST',
headers: {
'Authorization': `Bearer ${getMerchantApiKey(merchantId)}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
...checkoutData,
metadata: {
merchant_id: merchantId,
store_id: storeId,
platform: 'your_platform_name'
}
})
});
return response.json();
};
```
### Shopify App Example
```javascript theme={null}
// Shopify app creating embedded checkout
app.post('/shopify/create-checkout', async (req, res) => {
const { shop, cart } = req.body;
// Create Gale checkout session
const galeCheckout = await fetch('https://api.withgale.com/api/v2/checkout', {
method: 'POST',
headers: {
'Authorization': `Bearer ${getShopApiKey(shop)}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer: {
email: cart.customer.email,
first_name: cart.customer.firstName,
last_name: cart.customer.lastName,
phone: cart.customer.phone
},
line_items: cart.lineItems.map(item => ({
product_id: item.id,
name: item.title,
price: Math.round(item.price * 100), // Convert to cents
quantity: item.quantity,
currency: 'USD'
})),
metadata: {
shop: shop
}
})
});
const checkout = await galeCheckout.json();
res.json({ checkout_url: checkout.checkout_url });
});
```
## Security Best Practices
Always verify webhook signatures before processing
Only embed checkout on HTTPS pages
Check event.origin in postMessage listeners
Never expose API keys in frontend code
## Testing
### Test Mode
Use test API keys for development:
```bash theme={null}
Authorization: Bearer glm_test_YOUR_TEST_KEY
```
### Test the Flow
1. Create a test cart
2. Embed checkout iframe
3. Use test HSA card: `4111111111111111`
4. Complete payment
5. Verify webhook received
[See all test cards →](/resources/test-cards)
## Troubleshooting
**Possible causes:**
* Incorrect checkout\_url
* Missing `allow="payment"` attribute
* HTTPS required
* Content Security Policy blocking iframe
**Solution:** Check browser console for errors, ensure HTTPS, add CSP exception
**Solution:** Verify origin check matches `https://checkout.withgale.com` exactly
**Solution:** Checkout sessions expire after 24 hours. Create a new checkout session.
**Solution:** Some mobile browsers have iframe limitations. Consider using redirect flow (payment links) for mobile.
## API Reference
Complete API documentation:
* [Create Checkout Session](/api-reference/endpoint/create-checkout-v2)
* [Get Order](/api-reference/endpoint/get-order)
* [Order Object](/api-reference/objects/order)
## Next Steps
Configure real-time payment notifications
Need more control? Try custom API integration
Learn about subscription management
Test your integration with test HSA cards
## Support
Questions about embedded checkout?
* 📧 Email: [support@withgale.com](mailto:support@withgale.com)
* 📚 [API Reference](/api-reference/introduction)
* 💬 [Contact Support](https://www.withgale.com/contact/support)
# Accept HSA/FSA Payments
Source: https://docs.withgale.com/integration/introduction
Enable your customers to pay with their Health Savings Accounts (HSA) and Flexible Spending Accounts (FSA) in just a few steps.
# Accept HSA/FSA Payments with Gale
Gale makes it simple for healthcare and wellness merchants to accept tax-advantaged payments from HSA and FSA accounts, unlocking access to the \$175B+ contributed to these accounts annually.
## Why Gale?
Real-time SIGIS verification ensures products are HSA/FSA eligible
From no-code payment links to full custom API control
Built-in recurring billing for wellness subscriptions
We handle LMN submissions and eligibility documentation
## How It Works
1. **Products**: Add your products to Gale with automatic eligibility detection
2. **Integration**: Choose your integration method (payment link, embedded, or custom API)
3. **Checkout**: Customers pay with HSA/FSA cards on Gale's secure checkout
4. **Fulfillment**: Receive payment confirmation via webhook and fulfill the order
## Integration Methods
Choose the integration that fits your technical needs:
**Most Common** - Redirect to Gale's hosted checkout
Perfect for: E-commerce sites, membership platforms, existing checkouts
Gale handles: Card collection, eligibility detection, LMN flow
**Off-Platform** - Shareable payment URLs
Perfect for: Email invoices, SMS payments, manual billing
Generate via: API or Dashboard
**Seamless** - iframe integration for branded experience
Perfect for: Platform merchants, white-label solutions
Same as Checkout, embedded in your page
**Advanced** - Build your own payment UI
Perfect for: Mobile apps, custom experiences
Full API control over payment flow
## What You'll Need
Before you start, make sure you have:
* [ ] A Gale merchant account ([Sign up](https://www.withgale.com))
* [ ] API keys (available in your dashboard)
* [ ] Products to sell (we'll help verify eligibility)
## Quick Start Paths
Use **Checkout (Hosted Page)** - most common integration
1. Create checkout session via API with products and customer info
2. Redirect customer to Gale's hosted checkout URL
3. Handle payment confirmation via webhook
[Get Started with Checkout →](/integration/checkout)
Use **Payment Links** - shareable URLs for off-platform payments
1. Add products in your Gale dashboard
2. Generate a payment link via API or Dashboard
3. Share with customers via email, SMS, or messaging
[Get Started with Payment Links →](/integration/payment-links)
Use **Embedded Checkout** - iframe integration
1. Create checkout session via API
2. Embed the checkout iframe on your site
3. Handle payment confirmation webhooks
[Get Started with Embedded Checkout →](/integration/embedded-checkout)
Use **Custom API Integration** - full control
1. Integrate Checkout and Product APIs
2. Build your own payment collection UI
3. Use Gale for payment processing and eligibility
[Get Started with Custom API →](/integration/custom-api)
## Next Steps
Select the method that matches your use case above
Add products to Gale and verify HSA/FSA eligibility
Follow the guide for your chosen integration method
Test with sandbox environment, then switch to production
## Support
Need help getting started?
* 📧 Email: [support@withgale.com](mailto:support@withgale.com)
* 📚 Full API Reference: [/api-reference](/api-reference/introduction)
* 📊 Status Page: [status.withgale.com](https://status.withgale.com)
# Payment Links
Source: https://docs.withgale.com/integration/payment-links
Generate shareable payment URLs for off-platform payments via email, SMS, or messaging
# Payment Links Integration
Generate shareable payment URLs for off-platform payments. Perfect for sending invoices via email, SMS payments, social media distribution, or manual billing scenarios.
## When to Use Payment Links
Perfect for:
* Sending invoices to customers via email or SMS
* Sharing payment URLs through messaging apps
* Social media bio links or posts
* Manual billing and one-off purchases
* Off-platform payment collection
## How It Works
1. **Create payment link** via dashboard or API
2. **Gale returns** a payment URL
3. **Share the link** with customer via email, SMS, or QR code
4. **Customer clicks** link and completes checkout on Gale's secure page
5. **Gale sends** webhook notification to your system
6. **You fulfill** the order
## Setup Methods
You can create payment links in two ways:
### Create via Dashboard
1. **Log in** to your [Gale Dashboard](https://dashboard.withgale.com)
2. Navigate to **Products** → **Add Product**
3. Enter product details (name, price, description)
4. Click **Generate Payment Link**
5. Copy the link and share it!
**That's it!** Your payment link is ready to use.
### Share Your Link
**Via Email:**
```
Subject: Complete Your Purchase
Click here to complete your purchase with your HSA/FSA card:
https://checkout.withgale.com/pay/pl_abc123xyz
```
**Embed on Website:**
```html theme={null}
Pay with HSA/FSA
```
**QR Code:**
Generate a QR code from your link using any QR code generator, then print or display it.
### Create via API
Generate payment links programmatically for dynamic scenarios.
**Endpoint:** `POST /api/v2/payment-links`
```bash theme={null}
curl -X POST https://api.withgale.com/api/v2/payment-links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_id": "prod_abc123",
"amount": 4999,
"currency": "USD",
"metadata": {
"customer_email": "customer@example.com",
"order_id": "ORDER-12345"
}
}'
```
**Response:**
```json theme={null}
{
"id": "pl_abc123xyz",
"url": "https://checkout.withgale.com/pay/pl_abc123xyz",
"amount": 4999,
"currency": "USD",
"expires_at": "2025-11-01T00:00:00Z",
"active": true
}
```
## Subscription Support
Payment links support recurring payments automatically.
### Creating Subscription Links
1. Create a **Subscription Product** in your dashboard
2. Set billing frequency (monthly, quarterly, annually)
3. Generate payment link
4. Customer agrees to recurring billing at checkout
```bash theme={null}
curl -X POST https://api.withgale.com/api/v2/payment-links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_id": "prod_monthly_vitamins",
"amount": 2999,
"currency": "USD",
"subscription": {
"interval": "monthly",
"interval_count": 1
},
"metadata": {
"customer_email": "customer@example.com"
}
}'
```
**Response includes subscription details:**
```json theme={null}
{
"id": "pl_sub_xyz789",
"url": "https://checkout.withgale.com/pay/pl_sub_xyz789",
"subscription": {
"interval": "monthly",
"amount": 2999,
"trial_days": 0
}
}
```
## Customization Options
### Link Expiration
Set when payment links expire:
```json theme={null}
{
"expires_at": "2025-12-31T23:59:59Z"
}
```
### Success/Failure URLs
Redirect customers after payment:
```json theme={null}
{
"success_url": "https://yourdomain.com/success?session_id={CHECKOUT_SESSION_ID}",
"cancel_url": "https://yourdomain.com/cancel"
}
```
### Metadata
Store custom data with the link:
```json theme={null}
{
"metadata": {
"customer_id": "cust_123",
"campaign": "email_nov_2025",
"referral_code": "FRIEND20"
}
}
```
## Handling Payment Confirmation
### Webhooks (Recommended)
Receive real-time notifications when payment is completed. Subscribe to `order.completed` on your webhook endpoint — this fires for every successful payment regardless of how the customer paid.
[Learn more about Webhooks →](/developer-manual/webhooks)
### Polling (Alternative)
If your server missed a webhook or you need to check status on demand, poll the checkout status endpoint using the checkout ID (`cs_xxx`) returned when the cart was created:
```bash theme={null}
GET /api/v2/checkout/{checkout_id}
```
[See the endpoint reference →](/api-reference/endpoint/get-checkout)
## Best Practices
Set reasonable expiration dates (7-30 days) to keep links fresh
Store order IDs, customer info for easy reconciliation
Use test API keys to verify flow before going live
Set up webhook endpoints for reliable order fulfillment
## Common Use Cases
* **Membership Sign-Up**: Generate link when user selects tier, email to customer
* **Email Campaigns**: Include payment link in promotional emails
* **Social Media**: Add to Instagram bio, Facebook posts, or Twitter links
* **Manual Billing**: Send invoices to customers via email or SMS
## Testing
### Test Mode Links
Use test API keys to create test links:
```bash theme={null}
curl -X POST https://api.withgale.com/api/v2/payment-links \
-H "Authorization: Bearer glm_test_YOUR_TEST_KEY" \
...
```
### Test Cards
Use these test HSA cards on checkout:
| Card Number | Scenario |
| ------------------ | ------------------ |
| `4111111111111111` | Successful payment |
| `4000000000000002` | Card declined |
| `4000000000000069` | Expired card |
[See all test cards →](/resources/test-cards)
## Going Live
Create test payment links and complete test checkouts
Configure webhook endpoints for payment notifications
Replace test API keys with live keys
Watch for successful payments in your dashboard
## Troubleshooting
**Solution:** Check the `expires_at` date. Create a new link or update the expiration via API.
**Possible causes:**
* Product not HSA/FSA eligible → Check eligibility in dashboard
* Card declined → Customer should contact their HSA/FSA provider
* Link expired → Generate new link
**Solution:**
1. Verify webhook URL is publicly accessible
2. Check webhook delivery logs in dashboard under **Settings → Webhooks**
3. Ensure HTTPS endpoint
4. Confirm the `Authorization: Bearer` token in your handler matches the secret shown when you created the endpoint
[Webhook setup guide →](/developer-manual/webhooks)
**Solution:** Payment links are immutable once created. Generate a new link with updated price.
## API Reference
For complete API documentation:
* [Create Payment Link](/api-reference/endpoint/create-payment-link)
* [Get Payment Link](/api-reference/endpoint/get-payment-link)
* [List Payment Links](/api-reference/endpoint/list-payment-links)
## Next Steps
Configure real-time payment notifications
Test your integration with test HSA cards
Upgrade to embedded checkout for branded experience
Explore the full API
## Support
Need help with payment links?
* 📧 Email: [support@withgale.com](mailto:support@withgale.com)
* 💬 [Contact Support](https://www.withgale.com/contact/support)
# Introduction
Source: https://docs.withgale.com/introduction
Learn about Gale Payments and how it helps your business accept HSA and FSA payments.
Gale is a modern payment platform designed to help merchants accept HSA (Health Savings Account) and FSA (Flexible Spending Account) cards — effortlessly and compliantly.
Our mission is to simplify healthcare-related commerce by enabling smarter, tax-advantaged payments for eligible products.
***
## What is Gale Payments?
Gale helps merchants:
* Accept HSA/FSA cards online with ease
* Automatically validate product eligibility
* Reduce payment friction at checkout
* Meet compliance requirements like SIGIS and HIPAA
Whether you're on Shopify, WooCommerce, BigCommerce, or using a custom-built setup — Gale Payments makes integration fast and seamless.
***
## Why accept HSA/FSA cards?
HSA and FSA accounts are pre-tax benefit accounts that millions of Americans use for healthcare-related purchases. By accepting these cards, your store can:
* Increase average order value (AOV)
* Improve checkout conversion
* Enable smarter spending for your customers
***
## Learn more
Learn about the different types of Product Eligibility.
Get a personalized walkthrough and assistance tailored to your business.
***
## Need Help?
You can reach out to our support team at any time for assistance.
[Contact Support](mailto:support@withgale.com)
# BigCommerce
Source: https://docs.withgale.com/onboarding/bigcommerce/installation
This guide will walk you through installing and configuring Gale HSA/FSA Payments on your BigCommerce store.
***
## Prerequisites
Before starting, make sure you have access to:
* **BigCommerce Store**
* **Gale Merchant Dashboard**
***
## Installation Steps
1. In your bigcommerce admin panel Navigate to **Settings**
2. Scroll down to **API Section** > **Store-level API Accounts** > \*\*Create API Account. \*\*
3. Select Token type : **V2/V3 API token**
1. Select the following scopes :
| Scope | Type |
| ------------------- | --------- |
| Content | Modify |
| Checkout Content | Modify |
| Checkouts | Modify |
| Metafield Ownership | Manage |
| Metafield Acess | Standard |
| Customers | Read Only |
| Orders | Modify |
| Products | Modify |
| Order Transactions | Read Only |
4. Click Save & Copy the generated API Credentials.
1. Login to **Gale Merchant Dashboard**
2. In Left Sidebar navigate to **Integrations** Page > **Bigcommerce**
3. Enter **Store Hash and Access Token** generated in previous step and hit **Connect**.
1. Go to **Storefront → Page Builder**.
2. Look for the **HSA & FSA Accepted** widget.
3. Drag and drop it onto any product page.
4. Click **Publish** to make it live.
1. Go to your storefront and add a synced product to the cart.
2. Proceed to checkout and select **Gale HSA & FSA Payment**.
3. You will be redirected to a secure hosted Gale checkout page.
4. Use the test cards to complete payment (Only works if Test Mode is Enabled).
5. After payment, you’ll be redirected back to your store’s order confirmation page.
***
## Resources
Use these cards only during testing mode.
***
***
## Need Help?
If you have questions or need assistance, reach out to us at [support@withgale.com](mailto:support@withgale.com). We're happy to help!
# Custom Integration
Source: https://docs.withgale.com/onboarding/custom
Learn how to integrate Gale into your custom platform using our APIs.
If you're building your own storefront or platform, you can fully integrate Gale using our REST APIs. This gives you complete control over how products are synced, how checkout sessions are initiated, and how your system responds to real-time updates from Gale.
***
## How It Works
The custom integration flow:
1. **Sync your product catalog** — Send products to Gale via the Products API. Gale determines HSA/FSA eligibility automatically.
2. **Create a checkout session** — When a customer checks out, create a session via the Checkout API. You get back a `checkout_url` to redirect the customer to.
3. **Customer pays** — On Gale's hosted checkout page, the customer enters payment details. Gale handles HSA/FSA card detection, eligibility verification, and LMN flow for dual-purpose items.
4. **Receive confirmation** — Gale sends an `order.created` webhook when payment succeeds. You can also poll the Orders API.
5. **Fulfill the order** — Use the `reference_id` you passed during checkout creation to match the order back to your system.
***
## Get Started
Create your first checkout session in minutes with curl examples.
Full end-to-end walkthrough: product sync, eligibility, checkout, payment, webhooks, and refunds.
Complete endpoint documentation for products, checkout, orders, and more.
Receive real-time notifications for payments, orders, and product updates.
# Product Eligibility
Source: https://docs.withgale.com/onboarding/hsafsa
Gale offers a hosted payment page to integrate HSA and FSA payments into your checkout.
Gale offers two powerful solutions to help your eCommerce store accept HSA and FSA cards seamlessly and compliantly.
***
## Our Products
Automatically approve HSA/FSA cards for eligible items — no paperwork required. Powered by IIAS and SIGIS.
Accept HSA/FSA cards for dual-purpose products via provider-issued LMNs, initiated during checkout.
***
## SIGIS-Eligible Products
### Auto-Substantiation with Inventory Approval
If your store sells products that are pre-approved by SIGIS (Special Interest Group for IIAS Standards), Gale can instantly approve HSA/FSA payments with no user documentation required.
> These products are classified using our built-in **Inventory Information Approval System (IIAS)** — a requirement from the IRS.
#### Benefits
* Instant card approval at checkout
* No surveys, uploads, or manual reviews
* Fully compliant with IRS and SIGIS standards
***
## Letter of Medical Necessity (LMN)
### Unlock HSA/FSA for Dual-Purpose Products
Some products — such as fitness, sleep, or wellness-related items — are only HSA/FSA-eligible if supported by a **Letter of Medical Necessity (LMN)** from a licensed provider.
With Gale, customers can go through a short survey during checkout. A licensed healthcare provider reviews their responses and issues the LMN if medically justified — unlocking payment approval.
#### How it works
1. Customer chooses **Gale Payments** at checkout
2. Gale presents a guided eligibility survey
3. Licensed medical provider reviews it asynchronously
4. LMN is issued and payment is processed — all handled within the flow
> Gale handles the provider network, survey logic, and LMN documentation — so you stay compliant without any overhead.
***
## Why This Matters
### Ensure Compliance, Maximize Coverage
> Whether you sell SIGIS-approved products or dual-purpose items, Gale ensures every HSA/FSA transaction meets IRS and healthcare compliance — while keeping the customer experience smooth and fast.
***
## Want help classifying your product catalog?
Our team can review your catalog and help you determine which items qualify under SIGIS and which require LMNs.
[Talk to Sales →](https://www.withgale.com/contact/sales)
# Guide to Integrations
Source: https://docs.withgale.com/onboarding/introduction
Learn about Gale’s no-code integration options, supported platforms, and how to prepare before integrating.
Gale supports no-code integrations with the most popular eCommerce platforms. Our plugins and apps make it simple to start accepting HSA and FSA cards with just a few configuration steps.
***
## Supported Platforms
You can integrate Gale without writing code using the following platforms:
Use our official Shopify app to accept HSA/FSA payments during checkout.
Install our plugin and start accepting compliant payments in your WooCommerce store.
Enable Gale through BigCommerce using our embedded app and custom payment method.
> **Note:** For custom implementations, see our [Custom Integration Guide](/onboarding/custom).
***
## Before You Start
To integrate Gale with any platform, ensure the following steps are completed:
### Prerequisites
* You are **onboarded with Gale**
* You have received your **API Credentials (Public & Secret Key)**
* You have defined your **eligible product catalog** (SIGIS or LMN-based)
> If you're not yet onboarded, [contact our team](https://www.withgale.com/contact/sales) to get started.
***
## What You’ll Need
| Requirement | Description |
| ------------------------ | -------------------------------------------------------------------------- |
| Gale API Credentials | Issued after onboarding. Used for secure communication. |
| Eligible Products List | Ensure your catalog is tagged correctly as SIGIS-eligible or dual-purpose. |
| Access to Store Settings | You’ll need admin access to install apps and configure payment methods. |
***
## Choose Your Integration Path
For Shopify, WooCommerce, and BigCommerce, we have official apps ready for you.
Need more control? Use our API to build a fully custom HSA/FSA payment experience.
***
## Need Help?
Our support team can walk you through installation and answer integration-specific questions.
[Contact Support →](mailto:support@withgale.com)
# Onsite messaging using Custom Code
Source: https://docs.withgale.com/onboarding/shopify/customcode
Copy-paste the appropriate widget snippet into your Shopify theme based on your design choice.
Merchants using **custom themes** can integrate the Gale HSA/FSA widget manually using the snippets below. Choose the version that best fits your store’s design and copy it into your product template (like `product.liquid` or `main-product.liquid`).
## Steps to add Widgets using Custom Code
1. In Shopify Admin, go to **Online Store** > Go to Activated Theme and Click **Edit Code.**
From Sidebar choose approproate file \_(e.g product.liquid / product\_details.liquid) \_and open it.
Copy any of following code snippets according to your preferences and paste code anywhere in file.
```
{% comment %} Gale HSA/FSA Widget {% endcomment %}
{%- assign first_variant = product.selected_or_first_available_variant -%}
{%- assign type = first_variant.metafields.gale_payments.gale_product_type -%}
{%- if type == "medical_mcc" -%}
HSA/FSA Accepted.
{%- elsif type == "dual_purpose" -%}
HSA/FSA Eligible for qualified customers.
{%- else -%}
HSA/FSA Eligible.
{%- endif -%}
{%- assign first_variant = product.selected_or_first_available_variant -%}
{%- assign type = first_variant.metafields.gale_payments.gale_product_type -%}
{%- if type == "medical_mcc" -%}
HSA/FSA Accepted.
{%- elsif type == "dual_purpose" -%}
HSA/FSA Eligible for qualified customers.
{%- else -%}
HSA/FSA Eligible.
{%- endif -%}
Pay with
Maximize your savings. Pay with FSA & HSA.
Here’s how to use your HSA/FSA funds.
Step 1
Checkout as guest
Step 2
Select Gale at Checkout
{%- assign first_variant = product.selected_or_first_available_variant -%}
{%- assign type = first_variant.metafields.gale_payments.gale_product_type -%}
{%- if type == "dual_purpose" -%}
Step 3
Complete a health assessment
{%- endif -%}
{%- if type == "dual_purpose" -%}
Step 4
{%- else -%}
Step 3
{%- endif -%}
Pay with HSA/FSA or credit card
```
***Once code is added save your code and publish. You should be able to see HSA/FSA ELigibility messaging on ELigible Product Pages.***
### Disclaimer
* We strongly recommend that you **take a full backup of your theme** before implementing any custom code.
* These snippets are intended for use by **developers or technically experienced users**.
* Always test changes in a **duplicate or unpublished theme** before going live.
# Onsite Messaging - Shopify
Source: https://docs.withgale.com/onboarding/shopify/eligibilityinstallation
This guide will walk you through the process of installing and configuring Gale Eligibility app on your Shopify store, enabling onsite messaging for HSA/FSA Eligible Products
***
## Prerequisites
Before you begin, ensure the following:
* **Shopify Admin Access** : You have administrative access to your Shopify store.
* **Gale Payments API Key** : You received your API Key during the Gale Payments onboarding process.
## Installation
1. Install [Gale HSA & FSA Eligibility ](https://apps.shopify.com/gale-hsa-fsa-eligibility) app.
1. Go to **Shopify Admin** > Open **Gale HSA & FSA Eligibility App**
2. Click **Configure API Key**
3. Enter **Gale API Key** provided during onboarding process and Click **Save** .
1. Click **Go to Products Edit Page** → and enter GTIN/UPC Code in the **Barcode (ISBN, UPC, GTIN, etc.)** field.
You only need to enter GTIN/UPC codes **if you are SIGIS approved and using IIAS**. If you're using the **LMN (Letter of Medical Necessity)** flow, this step is **not required**. Please reach out to support for more questions.
Repeat the same process for all **HSA/FSA Eligible** products and add **GTIN/UPC Codes**.
1. Open **Gale HSA & FSA Eligibility** App in store admin.
Click **Go to Sync Products** > and Hit Sync Products Button so start product sync process.
Click Add Widget to Theme or go to your theme editor page and select Default **Product Page**Template.
Add a section/block under the Product Price or Product Title and choose from one of these two options.
* HSA/FSA Eligible (Icon)
* HSA/FSA Eligible (Text)
***
## Custom Code for Widgets
If you are using a custom theme , you can paste code snippets provided at approriate locations (product page template preferred.)
***
## Troubleshooting
* **Eligibility Messaging not Visible**: Ensure that you have synced products and added messaging widget to **Default Product** Template using theme editor.
* **Product not Eligible**: Ensure that you have added correct **GTIN/UPC** Codes for relevant products and have synced products after doing so.
***
## Need Help?
If you encounter any issues, contact our support team at [support@withgale.com](mailto:support@withgale.com). We're here to help!
***
**By completing these steps, you will be able to see HSA/FSA Eligibility messaging on your store for eligible products.**
# Shopify
Source: https://docs.withgale.com/onboarding/shopify/installation
This guide will walk you through the process of installing and configuring Gale Payments on your Shopify store, enabling HSA/FSA payments for your customers.
***
## Prerequisites
Before you begin, ensure the following:
* **Shopify Admin Access**: You have administrative access to your Shopify store.
* **API Key**: You can generate your API Key in your [Gale Dashboard](https://dashboard.withgale.com/).
***
## Installation Steps
1. Install the [HSA & FSA Payments – Gale](https://apps.shopify.com/gale-hsa-fsa-payments)
2. Follow the prompts to add the payments app to your store.
1. After installing the app, you will be redirected to Configure Gale Payments App
2. Enter your **Store Name** and **API Key** provided during onboarding.
1. **Save** your settings.
1. Click **Return to Shopify**.
1. Go to **Shopify Admin > Settings > Payments**.
2. Click **Add Payment Method**.
3. Select **Search by Provider** and type **"hsa"**.
1. Choose **Pay with HSA/FSA** from the list.
1. Enable **Test Mode** and click **Activate**.
1. Go to **Shopify Admin > Settings > Customer Events**.
2. Click **Add Custom Pixel**.
3. Enter Pixel Name **"Gale Pixel"**.
1. Enter the following **Pixel Code** and click **Connect** to save.
```javascript theme={null}
analytics.subscribe('payment_info_submitted', (event) => {
const checkout = event.data.checkout;
const payload = event.data.checkout;
fetch('https://checkoutv1.withgale.com/app/order_information', {
method: 'POST',
body: JSON.stringify(payload),
keepalive: true,
});
});
```
In the **Customer privacy** section, configure the settings as follows:
1. **Permission**
* Select **Not required**
2. **Data sale**
* Select **Data collected does not qualify as data sale**
1. Make sure the Pixel status is **Connected**.
1. Go to your store and add a product to the cart.
2. Proceed to checkout and select **Pay with FSA/HSA** as the payment method.
1. Use one of the [Test Cards](/resources/test-cards) for the transaction.
1. Verify the **order** and **payment status** in your Shopify Admin to ensure that test transaction is successful.
1. Return to the Gale Payments app in your Shopify Admin.
2. Disable **Test Mode** in the settings.
1. **Save** your changes and you are ready to accept **HSA & FSA** cards using Gale Payments.
***
## Resources
Use these cards only when **Test Mode** is enabled.
Install **Gale HSA & FSA Eligibility** app for onsite product messaging.
***
## Troubleshooting
* **App Not Visible**: Ensure the Gale Payments app is installed and activated in your Shopify Admin.
* **API Key Issues**: Double-check your API Key for accuracy.
* **Test Transactions Failing**: Confirm you are using valid [ Test Cards](/resources/test-cards).
***
## Need Help?
If you encounter any issues, contact our support team at [support@withgale.com](mailto:support@withgale.com). We're here to help!
***
By completing these steps, your Shopify store is now fully equipped to accept HSA/FSA payments with Gale Payments!
# Woocommerce
Source: https://docs.withgale.com/onboarding/woocommerce/installation
This guide will walk you through the process of installing and configuring Gale Payments on your WooCommerce store, enabling HSA/FSA payments for your customers.
## Prerequisites
Before you begin, ensure the following:
* **WooCommerce Plugin Installed** : Your WordPress store must have the WooCommerce plugin installed and activated.
***
## Installation Steps
1. Install [Gale HSA & FSA Payments ](https://wordpress.org/plugins/gale-hsa-fsa-payments/) Wordpress Plugin
2. Once the installation is complete, **Activate** the Plugin.
1. Navigate to `WooCommerce > Settings > Payments`
2. Locate the **Gale Payments** option and click `Manage`
1. Enter your **API Key** provided during signup.
2. Enable **Test Mode** to verify functionality before going live.
3. Please select the order status from the dropdown menu after a successful payment — we recommend choosing **Processing**.
1. Go to **Products** Section in WooCommerce.
2. **Add** or **Edit** a New Product.
Once you're in the **Product Editor Page**, go to the **Inventory** section and add the **GTIN/UPC Code** in the field, then **Save**.
You only need to enter the GTIN/UPC code **if you are SIGIS approved and using IIAS**. If you are using the **LMN (Letter of Medical Necessity)** flow, you can skip this step.
Go to the **Gale Products** page in your WordPress Dashboard Sidebar and click the **Sync Products** button.
**Once all of the products are synced, you can see a list of HSA/FSA Eligible Products on this page.**
1. Add a product to your WooCommerce store.
2. Proceed to checkout and select **Gale - Pay with FSA or HSA**.
3. Complete a test transaction using these [Test Cards ](/resources/test-cards)
4. Verify the transaction appears in your WooCommerce orders.
1. Once testing is successful, go back to the Gale Payments settings.
2. Uncheck the **Test Mode** option.
1. **Save your changes.** Your customers can now make payments using their HSA/FSA cards!
## Next Step
Learn how to add **HSA/FSA Eligible** product messaging widgets to WooCommerce using short codes.
***
## Test Cards
Use these cards only when **Test Mode** is enabled.
***
## Troubleshooting
* **Plugin Not Visible** : Ensure WooCommerce is installed and updated to the latest version.
* **API Key Issues** : Double-check your API Key for accuracy.
* **Test Mode Transactions Failing** : Ensure you are using valid test credentials provided by Gale Payments.
***
## Need Help?
If you encounter any issues, contact our support team at [support@withgale.com](mailto:support@withgale.com). We're here to help!
***
By completing these steps, your WooCommerce store is now fully equipped to accept HSA/FSA payments with Gale Payments!
# Onsite Messaging - WooCommerce
Source: https://docs.withgale.com/onboarding/woocommerce/onsitemessaging
Our plugin automatically determines if a product is eligible and displays the correct messaging. Instead of adding the eligibility messaging manually to each product, you only need to add it once in your **single product page template**.
## Prerequisites
Before you begin, ensure the following:
* **Woocommerce Admin Access** : You have administrative access to your Woocommerce store.
* **Products Synced** : You have already synced your products and atleast one of your products is HSA/FSA eligible.
## How to Add the Shortcode to the Single Product Page Template
You need to place this shortcode inside the **single product page template** so that it automatically applies to all products.
### Using the Default WordPress Editor (Site Editor)
If your theme supports **Full Site Editing (FSE)**, follow these steps:
1. Go to **Appearance** → **Editor** (Site Editor).
2. Select **Templates** → **Single Product**.
3. Click **Edit** and find the area where you want the eligibility message to appear (e.g., below the price or product description).
4. Click the **+** button to add a new block.
5. Search for **Shortcode** and select the **Shortcode block**
6. Enter the shortcode:
```plaintext theme={null}
[gale_hsa_fsa_ts_product_widget style='1']
```
7. Click **Save** to apply changes.
Now, every product page will dynamically display HSA/FSA eligibility information if applicable.
If you are using **Elementor** to customize your WooCommerce product pages:
1. Navigate to **Templates** → **Theme Builder** in Elementor.
2. Click **Single Product** and **Edit** the product page template.
3. Add a new **Shortcode** widget to the desired location (e.g., below the price).
4. Paste the shortcode:
```plaintext theme={null}
[gale_hsa_fsa_ts_product_widget style='1']
```
5. Click **Update** to apply changes.
Now, all products will automatically show the eligibility widget if they qualify.
For stores using **WPBakery Page Builder**:
1. Go to **WPBakery Page Builder** → **Templates**.
2. Edit the **Single Product** template.
3. Click **Add Element** and select the **Shortcode** block.
4. Insert the shortcode:
```plaintext theme={null}
[gale_hsa_fsa_ts_product_widget style='1']
```
5. Save the template and update your changes.
This ensures that the eligibility message appears across all WooCommerce product pages dynamically.
By adding the shortcode **once** to the WooCommerce **single product page template**, you ensure that the HSA/FSA eligibility widget automatically appears on all eligible products. There's no need to edit individual product pages—our plugin handles the logic to determine eligibility.
## Available Widget Shortcodes
There are five different widget styles that you can add to your WooCommerce product pages. Use the appropriate shortcode on product pages.
### 1. **Eligibility Widget Style 1**
```javascript theme={null}
[gale_hsa_fsa_ts_product_widget style='1']
```
Displays Eligibility Status with learn more anchor.
### 2. **Eligibility Widget Style 2**
```php theme={null}
[gale_hsa_fsa_ts_product_widget style='2']
```
Displays Eligibility Status with Gale Logo and Info icon.
### 3. **Eligibility Widget Style 3**
```php theme={null}
[gale_hsa_fsa_ts_product_widget style='3']
```
Displays a clickable message that opens a pop-up with more details about HSA/FSA eligibility.
### 4. **Eligibility Widget Style 4**
```php theme={null}
[gale_hsa_fsa_ts_product_widget style='4']
```
Displays a clickable message that opens a pop-up with more details about HSA/FSA eligibility without Gale Logo.
### 5. **Eligibility Widget Style 5**
```php theme={null}
[gale_hsa_fsa_ts_product_widget style='5']
```
## Troubleshooting
If the shortcode is not displaying correctly, ensure that your WooCommerce theme supports shortcodes
For further assistance, contact our support team at [support@withgale.com](mailto:support@withgale.com).