A test iOS e-commerce app built with SwiftUI, integrating Stripe for payment processing.
If this is your first time using Embrace and you want to try it out in an iOS app, follow these steps:
- Clone this repository to your local device, and
cdinto it from the Terminal application (or other similar command line tool).- Note Ensure that your local Xcode version can point to iOS 18.0 apps.
- Get the Embrace App ID for your iOS app. This will be available in the Projects and Apps section of the Embrace dashboard.
- In Terminal, run the onboarding script:
bash scripts/onboarding-script.sh
- Follow the prompts to configure this demo app with your Embrace credentials
The script will show you demo data in the Embrace dashboard. You can navigate around in the dash to understand how Embrace captures sessions and lets you dig into your app's performance.
This app is configured for test mode only - no real payments will be processed.
Use these test card numbers for payment testing:
| Card Type | Number | Description |
|---|---|---|
| Visa (Success) | 4242424242424242 |
Payment succeeds |
| Visa (Declined) | 4000000000000002 |
Payment declined |
| Mastercard (Success) | 5555555555554444 |
Payment succeeds |
| American Express (Success) | 378282246310005 |
Payment succeeds |
| Charge Customer Fail | 4000000000000341 |
Charge fails after payment method setup |
| Authentication Required | 4000002500003155 |
Requires 3D Secure authentication |
For any of the above test cards, use:
- Expiry Date: Any future date (e.g.,
12/28) - CVC: Any 3-digit number (e.g.,
123) - ZIP Code: Any valid ZIP code (e.g.,
12345)
- Successful Payment: Use
4242424242424242 - Declined Payment: Use
4000000000000002 - Test Payment Failure Button: Use the red "Test Payment Failure" button in the app
✅ URL Scheme Configured: The app handles Stripe redirects via embrace-ecommerce://stripe-redirect
📱 SDK Version: Using Stripe iOS SDK 24.19.0+ with the latest PaymentSheet implementation
This app implements comprehensive breadcrumb tracking using the Embrace SDK to monitor three distinct checkout user flows.
Tracks the user journey from checkout initiation through shipping information completion.
| Breadcrumb | Location | Description |
|---|---|---|
CHECKOUT_STARTED |
CheckoutCoordinator.swift:51 |
When checkout is initialized |
SHIPPING_INFORMATION_COMPLETED |
ShippingInformationViewController.swift:204 |
When user completes shipping form |
CHECKOUT_SHIPPING_COMPLETED |
CheckoutCoordinator.swift:81 |
When transitioning to payment step |
Tracks the payment processing flow from shipping completion through successful payment.
| Breadcrumb | Location | Description |
|---|---|---|
STRIPE_PAYMENT_PROCESSING_STARTED |
StripePaymentView.swift:267 |
When payment processing begins |
STRIPE_PAYMENT_PROCESSING_SUCCESS |
StripePaymentView.swift:293 |
When payment succeeds |
STRIPE_PAYMENT_PROCESSING_FAILED |
StripePaymentView.swift:308 |
When payment fails |
CHECKOUT_PAYMENT_COMPLETED |
CheckoutCoordinator.swift:84 |
When transitioning to confirmation step |
Tracks the final order placement flow from payment completion through successful order creation.
| Breadcrumb | Location | Description |
|---|---|---|
PLACE_ORDER_INITIATED |
OrderConfirmationViewController.swift:174 |
When user taps place order |
ORDER_DETAILS_API_COMPLETED |
CheckoutCoordinator.swift:177 |
When order API call completes successfully |
ORDER_PLACED_SUCCESS |
OrderConfirmationViewController.swift:211 |
When order placement succeeds |
ORDER_PLACED_FAILED |
OrderConfirmationViewController.swift:230 |
When order placement fails |
These breadcrumbs allow you to:
- Track conversion rates through each checkout step
- Identify drop-off points in the checkout flow
- Monitor payment processing success/failure rates
- Analyze the complete user journey from cart to order completion
- Debug issues specific to each flow step
The breadcrumbs are automatically captured in your Embrace sessions and can be viewed in the Embrace dashboard for comprehensive user flow analysis.