/passkit
Integrate Apple Pay payments and Wallet passes using PassKit. Use when adding Apple Pay buttons, creating payment requests, handling payment authorization, adding passes to Wallet, configuring merchant capabilities, managing shipping/contact fields, or working with
$ npx -y skills add dpearson2699/swift-ios-skills --skill passkit --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/passkit
Context preview
The summary Claude sees to decide when to auto-load this skill.
Integrate Apple Pay payments and Wallet passes using PassKit. Use when adding Apple Pay buttons, creating payment requests, handling payment authorization, adding passes to Wallet, configuring merchant capabilities, managing shipping/contact fields, or working with
SKILL.md
passkit.SKILL.mdname: passkit
description: "Integrate Apple Pay payments and Wallet passes using PassKit. Use when adding Apple Pay buttons, creating payment requests, handling payment authorization, adding passes to Wallet, configuring merchant capabilities, managing shipping/contact fields, or working with PKPaymentRequest, PKPaymentAuthorizationController, PKPaymentButton, AddPassToWalletButton, PKPass, PKAddPassesViewController, PKPassLibrary, Wallet pass distribution, or Apple Pay checkout flows for physical goods, real-world services, donations, and eligible recurring payments."
PassKit
Accept Apple Pay payments for physical goods, real-world services, donations, and eligible recurring payments, and add passes to the user's Wallet. Covers payment buttons, payment requests, authorization, Wallet passes, and merchant configuration. Targets Swift 6.3 / iOS 26+.
For advanced Apple Pay flows, one `PKPaymentRequest` can set only one optional advanced request type: recurring, automatic reload, deferred, Apple Pay Later availability, or multi-token contexts. Use separate payment requests when a checkout needs more than one of those modes.
Contents
- [Setup](#setup)
- [Displaying the Apple Pay Button](#displaying-the-apple-pay-button)
- [Creating a Payment Request](#creating-a-payment-request)
- [Presenting the Payment Sheet](#presenting-the-payment-sheet)
- [Handling Payment Authorization](#handling-payment-authorization)
- [Wallet Passes](#wallet-passes)
- [Checking Pass Library](#checking-pass-library)
- [Common Mistakes](#common-mistakes)
- [Review Checklist](#review-checklist)
- [References](#references)
Setup
Project Configuration
1. Enable the **Apple Pay** capability in Xcode 2. Create a Merchant ID in the Apple Developer portal (format: `merchant.com.example.app`) 3. Generate and install a Payment Processing Certificate for your merchant ID 4. Add the merchant ID to your entitlements
Availability Check
Always verify the device can make payments before showing Apple Pay UI. If you check for an active card with `canMakePayments(usingNetworks:capabilities:)`, Apple's HIG expects Apple Pay to be a primary, prominent payment option wherever you use that check.
import PassKit
func canMakePayments() -> Bool {
// Check device supports Apple Pay at all
guard PKPaymentAuthorizationController.canMakePayments() else {
return false
}
// Check user has cards for the networks you support
return PKPaymentAuthorizationController.canMakePayments(
usingNetworks: [.visa, .masterCard, .amex, .discover],
capabilities: .threeDSecure
)
}Displaying the Apple Pay Button
SwiftUI
Use the built-in `PayWithApplePayButton` view in SwiftUI. Use Apple-provided button APIs for any control labeled Apple Pay; custom buttons must not include the Apple Pay logo or "Apple Pay" text.
import SwiftUI
import PassKit
struct CheckoutView: View {
var body: some View {
PayWithApplePayButton(.buy) {
startPayment()
}
.payWithApplePayButtonStyle(.black)
.frame(height: 48)
.padding()
}
}UIKit
Use `PKPaymentButton` for UIKit-based interfaces.
let button = PKPaymentButton(
paymentButtonType: .buy,
paymentButtonStyle: .black
)
button.cornerRadius = 12
button.addTarget(self, action: #selector(startPayment), for: .touchUpInside)**Button types:** `.plain`, `.buy`, `.setUp`, `.inStore`, `.donate`, `.checkout`, `.continue`, `.book`, `.subscribe`, `.reload`, `.addMoney`, `.topUp`, `.order`, `.rent`, `.support`, `.contribute`, `.tip`
Creating a Payment Request
Build a `PKPaymentRequest` with your merchant details and the items being purchased. PassKit amount APIs take `NSDecimalNumber`, not `Double`.
func createPaymentRequest() -> PKPaymentRequest {
let request = PKPaymentRequest()
request.merchantIdentifier = "merchant.com.example.app"
request.countryCode = "US"
request.currencyCode = "USD"
request.supportedNetworks = [.visa, .masterCard, .amex, .discover]
request.merchantCapabilities = .threeDSecure
request.paymentSummaryItems = [
PKPaymentSummaryItem(
label: "Widget",
amount: NSDecimalNumber(string: "9.99")
),
PKPaymentSummaryItem(
label: "Shipping",
amount: NSDecimalNumber(string: "4.99")
),
PKPaymentSummaryItem(
label: "My Store",
amount: NSDecimalNumber(string: "14.98")
) // Total
]
return request
}The **last item** in `paymentSummaryItems` is treated as the total and its label appears in the Pay line on the payment sheet.
Requesting Shipping and Contact Info
Request only the contact fields needed to price, fulfill, or legally process the order. Collect required product choices, optional notes, per-item shipping destinations, and pickup locations before the Apple Pay button when the payment sheet cannot collect them accurately.
request.requiredShippingContactFields = [.postalAddress, .emailAddress, .name]
request.requiredBillingContactFields = [.postalAddress]
let standard = PKShippingMethod(
label: "Standard",
amount: NSDecimalNumber(string: "4.99")
)
standard.identifier = "standard"
standard.detail = "5-7 business days"
let express = PKShippingMethod(
label: "Express",
amount: NSDecimalNumber(string: "9.99")
)
express.identifier = "express"
express.detail = "1-2 business days"
request.shippingMethods = [standard, express]
request.shippingType = .shipping // .delivery, .storePickup, .servicePickupSupported Networks
| Network | Constant | |---|---| | Visa | `.visa` | | Mastercard | `.masterCard` | | American Express | `.amex` | | Discover | `.discover` | | China UnionPay | `.chinaUnionPay` | | JCB | `.JCB` | | Maestro | `.maestro` | | Electron | `.electron` | | Interac | `.interac` |
Query available networks at runtime
Read more
name: passkit description: "Integrate Apple Pay payments and Wallet passes using PassKit. Use when adding Apple Pay buttons, creating payment requests, handling payment authorization, adding passes to Wallet, configuring merchant capabilities, managing shipping/contact fields, or working with PKPaymentRequest, PKPaymentAuthorizationController, PKPaymentButton, AddPassToWalletButton, PKPass, PKAddPassesViewController, PKPassLibrary, Wallet pass distribution, or Apple Pay checkout flows for physical goods, real-world services, donations, and eligible recurring payments."
PassKit
Accept Apple Pay payments for physical goods, real-world services, donations, and eligible recurring payments, and add passes to the user's Wallet. Covers payment buttons, payment requests, authorization, Wallet passes, and merchant configuration. Targets Swift 6.3 / iOS 26+.
For advanced Apple Pay flows, one `PKPaymentRequest` can set only one optional advanced request type: recurring, automatic reload, deferred, Apple Pay Later availability, or multi-token contexts. Use separate payment requests when a checkout needs more than one of those modes.
Contents
- [Setup](#setup)
- [Displaying the Apple Pay Button](#displaying-the-apple-pay-button)
- [Creating a Payment Request](#creating-a-payment-request)
- [Presenting the Payment Sheet](#presenting-the-payment-sheet)
- [Handling Payment Authorization](#handling-payment-authorization)
- [Wallet Passes](#wallet-passes)
- [Checking Pass Library](#checking-pass-library)
- [Common Mistakes](#common-mistakes)
- [Review Checklist](#review-checklist)
- [References](#references)
Setup
Project Configuration
1. Enable the **Apple Pay** capability in Xcode 2. Create a Merchant ID in the Apple Developer portal (format: `merchant.com.example.app`) 3. Generate and install a Payment Processing Certificate for your merchant ID 4. Add the merchant ID to your entitlements
Availability Check
Always verify the device can make payments before showing Apple Pay UI. If you check for an active card with `canMakePayments(usingNetworks:capabilities:)`, Apple's HIG expects Apple Pay to be a primary, prominent payment option wherever you use that check.
import PassKit
func canMakePayments() -> Bool {
// Check device supports Apple Pay at all
guard PKPaymentAuthorizationController.canMakePayments() else {
return false
}
// Check user has cards for the networks you support
return PKPaymentAuthorizationController.canMakePayments(
usingNetworks: [.visa, .masterCard, .amex, .discover],
capabilities: .threeDSecure
)
}Displaying the Apple Pay Button
SwiftUI
Use the built-in `PayWithApplePayButton` view in SwiftUI. Use Apple-provided button APIs for any control labeled Apple Pay; custom buttons must not include the Apple Pay logo or "Apple Pay" text.
import SwiftUI
import PassKit
struct CheckoutView: View {
var body: some View {
PayWithApplePayButton(.buy) {
startPayment()
}
.payWithApplePayButtonStyle(.black)
.frame(height: 48)
.padding()
}
}UIKit
Use `PKPaymentButton` for UIKit-based interfaces.
let button = PKPaymentButton(
paymentButtonType: .buy,
paymentButtonStyle: .black
)
button.cornerRadius = 12
button.addTarget(self, action: #selector(startPayment), for: .touchUpInside)**Button types:** `.plain`, `.buy`, `.setUp`, `.inStore`, `.donate`, `.checkout`, `.continue`, `.book`, `.subscribe`, `.reload`, `.addMoney`, `.topUp`, `.order`, `.rent`, `.support`, `.contribute`, `.tip`
Creating a Payment Request
Build a `PKPaymentRequest` with your merchant details and the items being purchased. PassKit amount APIs take `NSDecimalNumber`, not `Double`.
func createPaymentRequest() -> PKPaymentRequest {
let request = PKPaymentRequest()
request.merchantIdentifier = "merchant.com.example.app"
request.countryCode = "US"
request.currencyCode = "USD"
request.supportedNetworks = [.visa, .masterCard, .amex, .discover]
request.merchantCapabilities = .threeDSecure
request.paymentSummaryItems = [
PKPaymentSummaryItem(
label: "Widget",
amount: NSDecimalNumber(string: "9.99")
),
PKPaymentSummaryItem(
label: "Shipping",
amount: NSDecimalNumber(string: "4.99")
),
PKPaymentSummaryItem(
label: "My Store",
amount: NSDecimalNumber(string: "14.98")
) // Total
]
return request
}The **last item** in `paymentSummaryItems` is treated as the total and its label appears in the Pay line on the payment sheet.
Requesting Shipping and Contact Info
Request only the contact fields needed to price, fulfill, or legally process the order. Collect required product choices, optional notes, per-item shipping destinations, and pickup locations before the Apple Pay button when the payment sheet cannot collect them accurately.
request.requiredShippingContactFields = [.postalAddress, .emailAddress, .name]
request.requiredBillingContactFields = [.postalAddress]
let standard = PKShippingMethod(
label: "Standard",
amount: NSDecimalNumber(string: "4.99")
)
standard.identifier = "standard"
standard.detail = "5-7 business days"
let express = PKShippingMethod(
label: "Express",
amount: NSDecimalNumber(string: "9.99")
)
express.identifier = "express"
express.detail = "1-2 business days"
request.shippingMethods = [standard, express]
request.shippingType = .shipping // .delivery, .storePickup, .servicePickupSupported Networks
| Network | Constant | |---|---| | Visa | `.visa` | | Mastercard | `.masterCard` | | American Express | `.amex` | | Discover | `.discover` | | China UnionPay | `.chinaUnionPay` | | JCB | `.JCB` | | Maestro | `.maestro` | | Electron | `.electron` | | Interac | `.interac` |
Query available networks at runtime
86 agent skills optimized for iOS 26+ development with Swift 6.3 and modern Apple frameworks.
Repo: dpearson2699/swift-ios-skills
Other skills on swift-ios-skills.
- /accessorysetupkit
Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based
Open skill - /activitykit
Implement, review, or improve Live Activities and Dynamic Island experiences in iOS apps using ActivityKit. Use when building real-time updating widgets for the Lock Screen and Dynamic Island — delivery tracking, sports scores, ride-sharing status, workout timers, media
Open skill - /adattributionkit
Measure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing
Open skill - /alarmkit
Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers AlarmManager scheduling, AlarmAttributes and AlarmPresentation, system Stop and AlarmButton secondary actions, authorization,
Open skill - /app-clips
Build iOS App Clips with invocation URLs, App Clip Codes, NFC, QR codes, Safari banners, Maps, Messages, target setup, App Store Connect experiences, size/capability constraints, NSUserActivity routing, SKOverlay promotion, App Group/keychain handoff, ephemeral notifications,
Open skill - /app-intents
Implement App Intents for Siri, Shortcuts, Spotlight, widgets, Control Center, and Apple Intelligence on iOS. Covers AppIntent actions, AppEntity and EntityQuery models, AppShortcutsProvider phrases, IndexedEntity Spotlight indexing, WidgetConfigurationIntent, SnippetIntent, and
Open skill

