DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsCheckoutPayment Processing
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Create OrderPayment ProcessingOrder ConfirmationFreestyle Bundle Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

Payment Processing

Handle Stripe and Authorize.net payment flows.

Updated March 29, 2026

On this page
  • Overview
  • Load the Payment Processor
  • Tokenize Card Data
  • Complete Checkout with Payment
  • Direct Charge (Advanced)
  • Payment Flow Diagram
  • Supported Processors
  • REST API
  • Next Steps

Overview

DashForDevs supports multiple payment processors. The SDK handles loading the processor's client library and tokenizing card data so sensitive card numbers never touch your server.

Load the Payment Processor

typescript
import dash from "@/lib/dash"

// Load the active processor's client library
const processor = await dash.payment.load()
// processor = { slug: "authorize-net", name: "Authorize.net", environment: "production" }

// Or just check which processor is active
const info = await dash.payment.getProcessor()

Tokenize Card Data

Convert card details into a secure token (client-side only):

typescript
const { token, descriptor } = await dash.payment.tokenize({
  cardNumber: "4111111111111111",
  expDate: "12/26",    // MM/YY format
  cvv: "123",
})
Security: Never send raw card numbers to your backend. Always tokenize on the client side first. The token is safe to transmit and can only be used once.

Complete Checkout with Payment

Pass the token to the checkout complete step:

typescript
const { order } = await dash.checkout.complete({
  cartId: dash.cart.cartId,
  shipping: { ... },
  payment_token: {
    token: token,
    descriptor: descriptor,
  },
})

Direct Charge (Advanced)

For custom payment flows, you can charge a token directly:

typescript
const { success, transaction } = await dash.payment.charge({
  token: "tok_abc123",
  descriptor: "Authorize.net",
  amount: "77.73",
  currency: "USD",
  invoiceNumber: "INV-1042",
  description: "Order #1042",
  billing: {
    firstName: "Jane",
    lastName: "Doe",
    address: "123 Main St",
    city: "Austin",
    state: "TX",
    zip: "78701",
    country: "US",
  },
})

Payment Flow Diagram

Customer enters card details
  ↓
dash.payment.tokenize() → token (client-side, secure)
  ↓
dash.checkout.complete({ payment_token: { token, descriptor } })
  ↓
Server charges the token via payment processor
  ↓
Order created → confirmation page

Supported Processors

ProcessorSlugSetup
StripestripeSee Stripe Integration
Authorize.netauthorize-netSee Authorize.net

Configure your payment processor in the dashboard under Settings → Payments.

REST API

shell
# Get processor info
GET /storefront/payment/processor
X-API-Key: pk_live_your_key

# Get client config (public key, etc.)
GET /storefront/payment/client-config
X-API-Key: pk_live_your_key

# Process charge
POST /storefront/payment/charge
X-API-Key: pk_live_your_key
Content-Type: application/json

{
  "amount": "77.73",
  "token": "tok_abc123",
  "descriptor": "Authorize.net"
}

Next Steps

  • Order Confirmation — Building the success page
  • Stripe Integration — Setting up Stripe
  • Authorize.net — Setting up Authorize.net
  • API Key Security — Keeping payment flows secure
PreviousCreate OrderNextOrder Confirmation

On this page

  • Overview
  • Load the Payment Processor
  • Tokenize Card Data
  • Complete Checkout with Payment
  • Direct Charge (Advanced)
  • Payment Flow Diagram
  • Supported Processors
  • REST API
  • Next Steps