Implementation Guide v1.0

Checkout & Payment Integration

Everything you need to build a complete e-commerce checkout for PetalsWings Iris Farm — from Stripe to Synchrony BNPL.

5
Payment Methods
4–7
Weeks to Launch
$0
Setup Cost
Overview

What We're Building

A full e-commerce checkout system that replaces Shopify's built-in cart — giving PetalsWings complete control over the buying experience, payment processing, and customer data.

🛒

Custom Cart

A beautiful, iris-themed shopping cart with real-time updates, quantity management, and shipping calculation — all under our domain.

Frontend
💳

Multi-Payment

Accept credit cards, Apple Pay, Google Pay, PayPal, and Buy Now Pay Later — meeting customers wherever they prefer to pay.

Integration
🔒

PCI Compliant

Stripe Elements handles all card data — no sensitive numbers ever touch our servers. PCI-DSS Level 1 certified out of the box.

Security

📋 Current State

PetalsWings currently runs on Shopify, which handles the entire checkout experience. We're building our own to gain full control over branding, reduce platform fees, own the customer relationship, and integrate unique features like Synchrony financing — something Shopify can't do natively.


Payment Processors

Accepted Payment Methods

Five ways for customers to pay, all working together through a unified checkout experience.

💜 Stripe

Primary Processor
2.9% + $0.30
per transaction

What It Handles

Credit cards, debit cards, and serves as the backbone for Apple Pay and Google Pay integration.

Card Form

Stripe Elements — a pre-built, customizable card input that's PCI-DSS Level 1 certified. Card numbers never touch our server.

Features

Real-time card validation, 3D Secure authentication, fraud detection via Radar, webhook events for order management.

Payout

Funds deposited to your bank account on a 2-day rolling basis. No monthly fees or minimums.

🍎 Apple Pay

Via Stripe
No extra cost
same Stripe rate applies

Integration

Handled entirely through Stripe's Payment Request API — no separate Apple merchant account needed.

Requirement

Domain verification required — upload a verification file to petalswings.com/.well-known/

Compatibility

Safari on macOS, iOS Safari, and in-app browsers. Works with Face ID and Touch ID for instant checkout.

UX Benefit

One-tap checkout — no typing card numbers. Average 2x faster checkout completion vs. manual entry.

🔵 Google Pay

Via Stripe
No extra cost
same Stripe rate applies

Integration

Same Payment Request API as Apple Pay — one integration covers both. Stripe detects the user's platform automatically.

Compatibility

Chrome on Android and desktop. Works with any card saved in Google Wallet.

Setup

No domain verification needed (unlike Apple Pay). Works immediately once Stripe is configured.

🅿️ PayPal

Separate Integration
2.89% + $0.49
standard rate

Integration Method

PayPal JavaScript SDK — Smart Payment Buttons that automatically show the most relevant payment options (PayPal, Venmo, Pay Later).

Advanced Pricing

2.59% + $0.49 per transaction with PayPal Advanced — includes custom card fields within your checkout page.

Buyer Protection

PayPal's Purchase Protection covers eligible purchases — builds customer confidence for first-time iris buyers.

Why Include It

~30% of online shoppers prefer PayPal. For a niche product like iris rhizomes, reducing friction = more conversions.

🏦 Synchrony / BNPL

Buy Now Pay Later
Varies
merchant discount rate

Synchrony HOME

Garden/outdoor category credit card. Customers get 6-12 month promotional financing on qualifying purchases. Perfect for bulk iris orders ($200+).

SetPay

Synchrony's installment plan option — fixed monthly payments over 3-48 months. Lower barrier for larger collections.

Alternatives

Afterpay: 4 interest-free payments. Klarna: Pay in 4 or monthly financing. Affirm: 3-36 month plans. All have merchant APIs.

Setup

Requires merchant application — Chris works at Synchrony, which may streamline the process. Application takes 2-4 weeks.

⚡ Chris's Edge

As a VP at Synchrony leading payment integrations, Chris has insider knowledge of how these APIs work. The Synchrony HOME card in the garden/outdoor category is a natural fit for an iris farm selling rhizomes and garden collections.

Side-by-Side Comparison

Feature Stripe Apple Pay Google Pay PayPal Synchrony
Setup Cost Free Free Free Free Application
Per-Transaction 2.9% + $0.30 Via Stripe Via Stripe 2.89% + $0.49 MDR varies
Monthly Fees None None None None Possible
Card Support Visa, MC, Amex, Discover All cards in Wallet All cards in GPay PayPal balance + cards Synchrony card
Mobile UX Good Excellent Excellent Good Fair
Buyer Protection Via card network Via card network Via card network PayPal Protection Via Synchrony
Financing Pay Later option 6-48 mo promo
Integration Stripe.js + API Payment Request API Payment Request API PayPal JS SDK Synchrony API
PCI Burden Minimal (Elements) None None None (redirect) None (hosted)

Architecture

System Design

Three layers working together — a static frontend, serverless backend, and managed database.

Frontend

🛒 Cart UI
📝 Checkout Form
💳 Payment Selector
🎨 Stripe Elements

Backend (Workers)

🔐 Payment Intents
✅ Order Validation
📦 Inventory Mgmt
📧 Email Triggers

Data Layer

🗃️ Product Catalog
📋 Orders
👤 Customer Info
📊 Analytics
🖥️

Frontend — Cloudflare Pages

Static HTML/CSS/JS served from Cloudflare's edge network. The cart UI, checkout forms, and Stripe Elements all run client-side. Fast, free, globally distributed.

Free hosting

Backend — Cloudflare Workers

Serverless functions that handle Stripe payment intents, validate orders, check inventory, and trigger confirmation emails. No server to manage.

Free tier: 100K req/day
🗄️

Database — D1 or KV

Cloudflare D1 (SQLite) for product catalog and orders, or Workers KV for simpler key-value storage. Both serverless, both on Cloudflare.

Free tier available

🔒 Security Model

HTTPS is mandatory (Cloudflare provides this automatically). Stripe Elements means card numbers never touch our servers — they go directly from the customer's browser to Stripe's PCI-certified infrastructure. Our server only sees a token. This gives us SAQ-A level PCI compliance — the simplest and most secure level.


Checkout Flow

The Customer Journey

Six steps from browsing to confirmation — each one designed to minimize friction.

Step 1
🛒
Cart
Step 2
📦
Shipping
Step 3
💳
Payment
Step 4
👁️
Review
Step 5
Process
Step 6
Confirm

🛒 Step 1: Cart Review

Customer reviews items, adjusts quantities, sees subtotal. Cart persists in localStorage. Shows estimated shipping and tax preview.

📦 Step 2: Shipping Info

Name, address, email, phone. Address validation via USPS API (or manual entry). Calculate shipping rates based on zone + weight. Show delivery estimate.

💳 Step 3: Payment Selection

Choose: Credit card (Stripe Elements), Apple Pay, Google Pay, PayPal, or Synchrony Financing. Payment buttons appear based on device/browser capability.

👁️ Step 4: Order Review

Final summary — items, shipping address, shipping cost, tax, payment method, total. Last chance to edit before committing.

⚡ Step 5: Payment Processing

Backend creates Stripe PaymentIntent (or PayPal order), confirms payment, validates inventory, creates order record, decrements stock.

✅ Step 6: Confirmation

Success page with order number. Confirmation email sent via Cloudflare Workers + Resend/SendGrid. Order appears in admin dashboard.


Implementation

Code Examples

Key integration snippets to show how the pieces fit together.

checkout.js JavaScript
// Initialize Stripe Elements
const stripe = Stripe('pk_live_your_publishable_key');
const elements = stripe.elements({
  appearance: {
    theme: 'night',
    variables: {
      colorPrimary: '#7c3aed',
      colorBackground: '#12121a',
      fontFamily: 'Inter, sans-serif',
    }
  }
});

// Mount the Payment Element (cards + wallets in one)
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');

// Handle form submission
async function handleSubmit() {
  const { error } = await stripe.confirmPayment({
    elements,
    confirmParams: {
      return_url: 'https://petalswings.com/order-confirmed',
    },
  });

  if (error) {
    // Show error to customer
    document.getElementById('error-message').textContent = error.message;
  }
}
worker/payment.js Cloudflare Worker
// Cloudflare Worker — Create Payment Intent
export default {
  async fetch(request, env) {
    const { items, shipping } = await request.json();

    // Calculate total server-side (never trust the client!)
    const total = calculateTotal(items, shipping);

    // Create Stripe PaymentIntent
    const response = await fetch('https://api.stripe.com/v1/payment_intents', {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${env.STRIPE_SECRET_KEY}`,
        'Content-Type': 'application/x-www-form-urlencoded',
      },
      body: new URLSearchParams({
        amount: Math.round(total * 100), // Stripe uses cents
        currency: 'usd',
        automatic_payment_methods: '{"enabled": true}',
        metadata: JSON.stringify({
          order_items: items.map(i => i.sku).join(','),
        }),
      }),
    });

    const paymentIntent = await response.json();

    return new Response(JSON.stringify({
      clientSecret: paymentIntent.client_secret,
    }));
  }
};
paypal-buttons.js JavaScript
// PayPal Smart Payment Buttons
paypal.Buttons({
  style: {
    layout: 'vertical',
    color: 'black',
    shape: 'rect',
    label: 'paypal',
  },

  async createOrder() {
    const res = await fetch('/api/paypal/create-order', {
      method: 'POST',
      body: JSON.stringify({ cart: getCartItems() }),
    });
    const data = await res.json();
    return data.id;
  },

  async onApprove(data) {
    const res = await fetch(`/api/paypal/capture/${data.orderID}`, {
      method: 'POST',
    });
    const order = await res.json();
    showConfirmation(order);
  },
}).render('#paypal-button-container');

💡 One Payment Element, Multiple Methods

Stripe's Payment Element automatically shows Apple Pay and Google Pay buttons when available on the customer's device — no extra code needed. It adapts to show the most relevant payment options.


Action Items

What Chris Needs to Do

Your checklist — complete these before we start building.


Timeline

Estimated Build Schedule

A phased approach — start accepting payments in weeks, not months.

Phase 1

Stripe + Apple Pay + Google Pay

⏱ 1–2 weeks

Set up Stripe account, build cart UI, integrate Stripe Payment Element (covers cards + Apple Pay + Google Pay in one component), create backend payment intent endpoint, build order confirmation flow. This gets us 80% of payment methods in one shot.

Phase 2

PayPal Integration

⏱ 1 week

Add PayPal JS SDK, implement Smart Payment Buttons, build backend order creation and capture endpoints. Test PayPal sandbox. Deploy alongside existing Stripe checkout.

Phase 3

Synchrony BNPL / Financing

⏱ 2–4 weeks

Apply for Synchrony merchant account (2-4 week approval). Integrate Synchrony promotional messaging. Add financing option to checkout. This phase depends on merchant application timeline. Can also evaluate Afterpay/Klarna as faster alternatives.

Phase 4 — Polish

Testing, SEO & Launch

⏱ 1 week

End-to-end testing with real cards (Stripe test mode), mobile testing, accessibility audit, SEO optimization, analytics setup, email template design. Go live! 🚀


Cost Breakdown

What This Costs

Spoiler: setup is free. You only pay per transaction.

$0
Stripe Setup
Free to create account. 2.9% + $0.30 per successful transaction. No monthly fee.
$0
Apple Pay & Google Pay
No additional cost — included with Stripe. Same per-transaction rate applies.
$0
PayPal Setup
Free to create account. 2.89% + $0.49 per transaction (standard). No monthly fee.
$0
Hosting
Cloudflare Pages (frontend) + Workers (backend) — free tier covers everything we need.
$0
Domain & SSL
petalswings.com already registered. Cloudflare provides free SSL/TLS automatically.
~3%
Per Sale
Example: $50 iris order → ~$1.75 in fees (Stripe) or ~$1.94 (PayPal). Standard e-commerce rates.

💰 Shopify Comparison

Shopify Basic: $39/month + 2.9% + $0.30 per transaction + 2% fee for non-Shopify Payments. Our setup: $0/month + same ~3% per transaction. At 50 orders/month, you'd save ~$500/year in platform fees alone — plus you own the code, the data, and the customer relationship.