{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","br","details","admonition","tabs","tab"]},"type":"markdown"},"seo":{"title":"Apple Pay","description":"Transform your commerce with PXP's unified platform—seamless payments, real-time insights, and global growth in one powerful integration.","lang":"en-UK","siteUrl":"https://developer.pxp.io","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"apple-pay","__idx":0},"children":["Apple Pay"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Accept Apple Pay payments with automatic wallet handling, one-click checkout, and seamless iOS integration."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apple Pay is automatically included in the drop-in when enabled in your session. The drop-in handles all Apple Pay setup, button rendering, wallet interaction, and payment processing automatically."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"key-benefits","__idx":2},"children":["Key benefits"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Apple Pay appears automatically in the drop-in when it's enabled in your session configuration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The drop-in handles all Apple Pay setup, so you don't need Apple Pay-specific code."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Apple Pay uses the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," callbacks as other payment methods for a unified integration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Customers can pay using any card or payment method saved in their Apple Wallet."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Native iOS Apple Pay UI for familiar and trusted checkout experience."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["One-click checkout for fast and frictionless payments."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enhanced security with tokenised payment credentials."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-it-works","__idx":3},"children":["How it works"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a customer selects Apple Pay:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The customer taps \"Apple Pay\" in the payment options list."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The native iOS Apple Pay sheet opens."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The customer authenticates using Face ID, Touch ID, or passcode."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The customer confirms the payment in the Apple Pay interface."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Apple Pay sheet closes automatically."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The payment is processed through Unity."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," callback fires."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configuration","__idx":4},"children":["Configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure Apple Pay-specific settings for the payment button, merchant information, and transaction parameters."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configuration-properties","__idx":5},"children":["Configuration properties"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following properties are available for Apple Pay configuration through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DropInApplePayConfig"]},":"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Property"},"children":["Property "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shippingContactConfiguration"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["DropInApplePayShippingContactConfiguration?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configuration for shipping contact fields."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shippingContactConfiguration.requireShippingContactFields"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["[ContactField]?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Which contact fields to require for shipping. Available values: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".postalAddress"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".emailAddress"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".phoneNumber"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".phoneticName"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billingContactConfiguration"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["DropInApplePayBillingContactConfiguration?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configuration for billing contact fields."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billingContactConfiguration.requireBillingContactFields"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["[ContactField]?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Which contact fields to require for billing. Available values: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".postalAddress"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".emailAddress"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".phoneNumber"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".phoneticName"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onShippingContactSelected"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["(ApplePayContact?) -> ApplePayRequestUpdate?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Called when the customer selects or changes their shipping contact in Apple Pay. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayRequestUpdate"]}," to update totals, shipping methods, or errors, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nil"]}," if no update is needed."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onShippingMethodSelected"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["(ApplePayShippingMethod?) -> ApplePayRequestUpdate?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Called when the customer selects or changes their shipping method in Apple Pay. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayRequestUpdate"]}," to update totals or errors, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nil"]}," if no update is needed."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPaymentMethodSelected"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["(ApplePayPaymentMethod?) -> ApplePayRequestUpdate?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Called when the customer selects or changes their payment method in Apple Pay. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayRequestUpdate"]}," to update totals or errors, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nil"]}," if no update is needed."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCouponCodeChanged"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["(String) -> ApplePayRequestUpdate?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Called when the customer enters or changes a coupon code in Apple Pay. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayRequestUpdate"]}," to update totals or errors, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nil"]}," if the coupon is invalid or no update is needed."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"settings-used-from-global-configuration","__idx":6},"children":["Settings used from global configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apple Pay inherits the following settings from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["methodConfig.global"]},":"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Property"},"children":["Property "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"70%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["acceptedCardNetworks"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["[DropInCardNetworks]?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Which card brands to accept through Apple Pay (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[.visa, .mastercard, .amex]"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allowedCardFundingSource"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["[DropInCardFundingSource]?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Which funding types to accept (Credit, Debit). Mapped to Apple Pay merchant capabilities."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allowedIssuerCountryCodes"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["[String]?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Allowed card issuer countries as ISO country codes (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[\"GB\", \"US\", \"FR\"]"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shippingOptions"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["[DropInShippingOption]?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shipping options displayed in the Apple Pay sheet. Each option includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["label"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["couponInfo"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["DropInCouponInfo?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Coupon configuration for Apple Pay. Includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["couponCode"]}," which is passed to Apple Pay sheet."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["riskScreeningData"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["RiskScreeningData?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Risk screening data for fraud detection, passed into Apple Pay transaction initialisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInfo"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["DropInTransactionInfo"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction information including country code and total label."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInfo.countryCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Two-letter ISO country code for the merchant (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"US\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"GB\""]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInfo.totalLabel"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Label shown for the total amount in Apple Pay (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Demo Store\""]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Total\""]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetConsent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["(DropInPaymentMethod) -> Bool"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provides consent value for Apple Pay vaulting when no consent component is attached."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["(DropInPaymentMethod, Any?) -> Void"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Called when user cancels Apple Pay payment (closes sheet)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"complete-example","__idx":7},"children":["Complete example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This example shows a full Apple Pay configuration with shipping options and all supported Apple Pay-specific callbacks:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"methodConfig: DropInMethodConfig(\n    // Global settings that apply to Apple Pay\n    global: DropInGlobalConfig(\n        // Card networks accepted through Apple Pay\n        acceptedCardNetworks: [.visa, .mastercard, .amex],\n        \n        // Shipping options displayed in Apple Pay sheet\n        shippingOptions: [\n            DropInShippingOption(\n                id: \"standard\",\n                label: \"Standard Shipping\",\n                description: \"Arrives in 3-5 business days\",\n                amount: \"10.00\"\n            ),\n            DropInShippingOption(\n                id: \"express\",\n                label: \"Express Shipping\",\n                description: \"Arrives in 1-2 business days\",\n                amount: \"25.00\"\n            )\n        ],\n        \n        // Transaction information for Apple Pay\n        transactionInfo: DropInTransactionInfo(\n            countryCode: \"GB\",\n            totalLabel: \"Demo Store\"\n        ),\n        \n        // Handle Apple Pay cancellation\n        onCancel: { paymentMethod, data in\n            if paymentMethod == .applePay {\n                print(\"Apple Pay payment cancelled: \\(String(describing: data))\")\n                \n                // Update UI\n                Task { @MainActor in\n                    showToast(\"Apple Pay payment was cancelled. Please try again.\")\n                }\n            }\n        }\n    ),\n    \n    applePay: DropInApplePayConfig(\n        // Shipping contact configuration\n        shippingContactConfiguration: DropInApplePayShippingContactConfiguration(\n            requireShippingContactFields: [\n                .postalAddress,\n                .name,\n                .phoneNumber,\n                .emailAddress\n            ]\n        ),\n        \n        // Billing contact configuration\n        billingContactConfiguration: DropInApplePayBillingContactConfiguration(\n            requireBillingContactFields: [\n                .postalAddress,\n                .name\n            ]\n        ),\n        \n        // Shipping contact selection callback\n        onShippingContactSelected: { contact in\n            // Return nil when no update needed\n            // Return ApplePayRequestUpdate to update totals/shipping/errors\n            nil\n        },\n        \n        // Shipping method selection callback\n        onShippingMethodSelected: { method in\n            // Update total based on selected shipping method\n            guard let shippingAmount = method?.amount else { return nil }\n            \n            return ApplePayRequestUpdate(\n                summaryItems: [\n                    ApplePaySummaryItem(\n                        label: \"Subtotal\",\n                        amount: Decimal(string: \"99.99\") ?? 0\n                    ),\n                    ApplePaySummaryItem(\n                        label: \"Shipping\",\n                        amount: shippingAmount\n                    ),\n                    ApplePaySummaryItem(\n                        label: \"Demo Store\",\n                        amount: (Decimal(string: \"99.99\") ?? 0) + shippingAmount\n                    )\n                ]\n            )\n        },\n        \n        // Payment method selection callback\n        onPaymentMethodSelected: { method in\n            // Return nil when no update needed\n            nil\n        },\n        \n        // Coupon code changed callback\n        onCouponCodeChanged: { couponCode in\n            // Validate coupon and return updated totals\n            // Return nil if coupon is invalid or no update needed\n            nil\n        }\n    )\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apple-pay-requirements","__idx":8},"children":["Apple Pay requirements"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apple Pay requires the following to function correctly:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["iOS compatibility:"]}," iOS 14.0 or higher."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Apple Pay capability:"]}," Apple Pay must be configured in your Xcode project capabilities."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Merchant ID:"]}," A valid Apple Pay merchant identifier registered in your Apple Developer account."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Customer setup:"]}," The customer must have Apple Pay set up on their device with at least one payment method."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HTTPS:"]}," Your backend endpoints must be served over HTTPS."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Unity Portal configuration:"]}," Apple Pay must be enabled and configured in the Unity Portal."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Entry type:"]}," Apple Pay is designed for e-commerce transactions (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["entryType: .ecom"]},")."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use Apple Pay, you must register an Apple Pay merchant identifier in your Apple Developer account and add the Apple Pay capability to your Xcode project. The merchant ID must also be configured in the Unity Portal."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"implementation","__idx":9},"children":["Implementation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apple Pay works through the standard implementation, with no Apple Pay-specific code needed:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import SwiftUI\nimport PXPCheckoutSDK\n\nstruct CheckoutView: View {\n    @StateObject private var viewModel = CheckoutViewModel()\n    \n    var body: some View {\n        Group {\n            if let dropIn = viewModel.dropIn {\n                dropIn.buildContent()\n            } else if let errorMessage = viewModel.errorMessage {\n                Text(errorMessage)\n            } else {\n                ProgressView(\"Loading checkout...\")\n            }\n        }\n        .task {\n            await viewModel.loadDropIn()\n        }\n    }\n}\n\n@MainActor\nfinal class CheckoutViewModel: ObservableObject {\n    @Published var dropIn: CheckoutDropIn?\n    @Published var errorMessage: String?\n    \n    func loadDropIn() async {\n        // Fetch session from backend (with Apple Pay enabled)\n        guard let sessionData = await fetchSessionFromBackend() else {\n            errorMessage = \"Failed to create session\"\n            return\n        }\n        \n        // Initialise Drop-in\n        let config = CheckoutDropInConfig(\n            environment: .test,\n            session: sessionData,\n            transactionData: DropInTransactionData(\n                amount: Decimal(string: \"99.99\") ?? 0,\n                currency: \"GBP\",\n                entryType: .ecom,\n                intent: DropInTransactionIntentData(\n                    card: .purchase  // Apple Pay uses card intent\n                ),\n                merchantTransactionId: UUID().uuidString,\n                merchantTransactionDate: { Date() }\n            ),\n            merchantShopperId: \"shopper-123\",\n            ownerId: \"MERCHANT-1\",\n            onGetShopper: {\n                TransactionShopper(id: \"shopper-123\")\n            },\n            onSuccess: { result in\n                print(\"Apple Pay payment successful!\")\n                print(\"System transaction ID: \\(result.systemTransactionId)\")\n                print(\"Payment method: \\(result.paymentMethod.rawValue)\") // \"ApplePay\"\n                \n                // CRITICAL: Verify on backend\n                Task {\n                    await verifyPaymentOnBackend(result)\n                }\n            },\n            onError: { paymentMethod, error in\n                print(\"Apple Pay payment failed: \\(error.errorMessage)\")\n                Task { @MainActor in\n                    self.errorMessage = \"Payment failed: \\(error.errorMessage)\"\n                }\n            }\n        )\n        \n        do {\n            let instance = try CheckoutDropIn(config: config)\n            await instance.create()\n            dropIn = instance\n        } catch {\n            errorMessage = error.localizedDescription\n        }\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"session-configuration-backend","__idx":10},"children":["Session configuration (backend)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Enable Apple Pay in your session request:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"// BACKEND: Create a session with Apple Pay enabled\nconst sessionRequest = {\n  merchant: \"MERCHANT-1\",\n  site: \"SITE-1\",\n  sessionTimeout: 120,\n  merchantTransactionId: crypto.randomUUID(),\n  transactionMethod: {\n    intent: {\n      card: \"Purchase\"  // Apple Pay uses card intent\n    }\n  },\n  amounts: {\n    currencyCode: \"GBP\",\n    transactionValue: 99.99\n  },\n  allowedFundingTypes: {\n    wallets: {\n      applePay: {\n        // Apple Pay configuration from the Unity Portal will be used\n        // The SDK SessionData expects:\n        merchantId: \"merchant.com.example.demostore\"\n      }\n    }\n  },\n  allowTransaction: true,\n  serviceType: \"CheckoutDropIn\"\n};\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payment-flows","__idx":11},"children":["Payment flows"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Drop-in supports two Apple Pay payment flows, configured via the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["intent"]}," parameter:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Pay now (purchase)","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Immediate, single-step payment where funds are captured right away."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"transactionData: DropInTransactionData(\n    amount: Decimal(string: \"99.99\") ?? 0,\n    currency: \"GBP\",\n    entryType: .ecom,\n    intent: DropInTransactionIntentData(\n        card: .purchase  // Pay Now flow - Apple Pay uses card intent\n    ),\n    merchantTransactionId: UUID().uuidString,\n    merchantTransactionDate: { Date() }\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this flow for:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Digital products"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Simple orders with immediate fulfillment"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Subscriptions"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Donations"]}]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Confirm payment (authorisation)","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two-step payment: authorise now, capture later (within scheme-specific time windows)."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"transactionData: DropInTransactionData(\n    amount: Decimal(string: \"149.99\") ?? 0,\n    currency: \"GBP\",\n    entryType: .ecom,\n    intent: DropInTransactionIntentData(\n        card: .authorisation  // Confirm Payment flow - Apple Pay uses card intent\n    ),\n    merchantTransactionId: UUID().uuidString,\n    merchantTransactionDate: { Date() }\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this flow for:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Physical products (capture on shipment)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Inventory validation needed"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Final amount may change (shipping, taxes)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Complex order workflows"]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"handling-responses","__idx":12},"children":["Handling responses"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apple-pay-callback-data","__idx":13},"children":["Apple Pay callback data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When an Apple Pay payment succeeds, your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," callback receives the same standard result as other payment methods:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"onSuccess: { result in\n    print(\"Payment details:\")\n    print(\"- System transaction ID: \\(result.systemTransactionId)\")\n    print(\"- Merchant transaction ID: \\(result.merchantTransactionId ?? \"N/A\")\")\n    print(\"- Payment method: \\(result.paymentMethod.rawValue)\") // \"ApplePay\"\n    \n    // Note: Amount, currency, and other transaction details must be retrieved from backend\n    // Apple Pay tokenisation is handled internally\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"error-handling","__idx":14},"children":["Error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Handle Apple Pay-specific errors:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"onError: { paymentMethod, error in\n    print(\"Error code: \\(error.errorCode)\")\n    print(\"Error message: \\(error.errorMessage)\")\n    \n    // Handle specific error codes\n    let userMessage: String\n    switch error.errorCode {\n    case \"SDK0602\":\n        userMessage = \"Apple Pay is not available on this device.\"\n    case \"SDK0615\":\n        // User cancelled - don't show error\n        return\n    case \"SDK0616\":\n        userMessage = \"Apple Pay merchant validation failed. Please contact support.\"\n    case \"SDK0617\":\n        userMessage = \"Apple Pay processing failed. Please try again.\"\n    case \"SDK1119\":\n        userMessage = \"Apple Pay payment failed. Please try again.\"\n    default:\n        // Fall back to message-based detection\n        if error.errorMessage.localizedCaseInsensitiveContains(\"cancelled\") ||\n           error.errorMessage.localizedCaseInsensitiveContains(\"closed\") {\n            // User intentionally cancelled - don't show error\n            return\n        } else if error.errorMessage.localizedCaseInsensitiveContains(\"not available\") {\n            userMessage = \"Apple Pay isn't available on this device. Please use a different payment method.\"\n        } else if error.errorMessage.localizedCaseInsensitiveContains(\"not supported\") {\n            userMessage = \"Apple Pay isn't supported for this transaction. Please use a different payment method.\"\n        } else if error.errorMessage.localizedCaseInsensitiveContains(\"declined\") {\n            userMessage = \"Payment declined. Please try a different payment method.\"\n        } else if error.errorMessage.localizedCaseInsensitiveContains(\"timeout\") {\n            userMessage = \"Apple Pay timed out. Please try again.\"\n        } else {\n            userMessage = \"Apple Pay payment failed: \\(error.errorMessage)\"\n        }\n    }\n    \n    Task { @MainActor in\n        showError(userMessage)\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"common-error-scenarios","__idx":15},"children":["Common error scenarios"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following table describes common Apple Pay error scenarios:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Scenario"},"children":["Scenario"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"How to detect"},"children":["How to detect"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Recommended action"},"children":["Recommended action"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Apple Pay not supported"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorCode == \"SDK0602\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Suggest using different payment method"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["User cancelled"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorCode == \"SDK0615\""]}," or message contains \"cancelled\""]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["No alert needed - user action was intentional"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Merchant validation failed"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorCode == \"SDK0616\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Contact support for merchant configuration"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Custom API processing failed"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorCode == \"SDK0617\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Retry payment or contact support"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Apple Pay payment failed"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorCode == \"SDK1119\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Suggest trying again or using another payment method"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Payment declined"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorMessage"]}," contains \"declined\""]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Suggest trying different payment method"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Timeout"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorMessage"]}," contains \"timeout\""]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Suggest retrying the payment"]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apple Pay errors include both error codes (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0602"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0615"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0616"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0617"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1119"]},") and descriptive messages. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorCode"]}," for programmatic handling and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorMessage"]}," for additional context. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]}," callback in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["methodConfig.global"]}," can also be used to handle user cancellations."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"backend-verification","__idx":16},"children":["Backend verification"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Always verify Apple Pay payments on your backend to ensure payment success before fulfilling orders:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"onSuccess: { result in\n    // Send to backend for verification\n    Task {\n        do {\n            let response = try await apiClient.post(\"/api/verify-payment\", body: [\n                \"systemTransactionId\": result.systemTransactionId,\n                \"merchantTransactionId\": result.merchantTransactionId ?? \"\"\n            ])\n            \n            if response.success {\n                // Navigate to success screen\n                await MainActor.run {\n                    navigateToSuccess(orderId: response.orderId)\n                }\n            } else {\n                await MainActor.run {\n                    showError(\"Payment verification failed\")\n                }\n            }\n        } catch {\n            print(\"Verification error: \\(error.localizedDescription)\")\n            await MainActor.run {\n                showError(\"Failed to verify payment\")\n            }\n        }\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"backend-verification-code","__idx":17},"children":["Backend verification code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the following backend code to verify Apple Pay transactions via the PXP API:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"// BACKEND: Verify Apple Pay payment\napp.post('/api/verify-payment', async (req, res) => {\n  const { systemTransactionId, merchantTransactionId } = req.body;\n  \n  try {\n    // Query the PXP API to get transaction details\n    const txnPath = `api/v1/transactions/${systemTransactionId}`;\n    const { authHeader, requestId } = createAuthHeader(\n      txnPath,\n      '',\n      process.env.PXP_TOKEN_ID,\n      process.env.PXP_TOKEN_VALUE\n    );\n    \n    const transaction = await fetch(\n      `https://api-services.pxp.io/${txnPath}`,\n      {\n        headers: {\n          'X-Client-Id': process.env.PXP_CLIENT_ID,\n          'X-Request-Id': requestId,\n          'Authorization': authHeader\n        }\n      }\n    ).then(r => r.json());\n    \n    // Verify transaction state\n    if (transaction.state !== 'Authorised' && transaction.state !== 'Captured') {\n      return res.json({ success: false, error: 'Transaction not successful' });\n    }\n    \n    // Verify merchant transaction ID matches\n    if (transaction.merchantTransactionId !== merchantTransactionId) {\n      return res.json({ success: false, error: 'Transaction ID mismatch' });\n    }\n    \n    // Verify amount matches expected amount from your order records\n    const order = await getOrderByMerchantTransactionId(merchantTransactionId);\n    const txnAmount = transaction.amounts?.transactionValue || transaction.amount || 0;\n    if (Math.abs(txnAmount - order.amount) > 0.01) {\n      return res.json({ success: false, error: 'Amount mismatch' });\n    }\n    \n    // Apple Pay payments show as Card funding type (processed as card transactions)\n    const fundingType = transaction.fundingData?.fundingType || \n                       transaction.fundingType || \n                       'Unknown';\n    if (fundingType !== 'Card') {\n      return res.json({ success: false, error: 'Invalid funding type' });\n    }\n    \n    // Fulfill order\n    const orderId = await fulfillOrder(transaction);\n    \n    return res.json({ success: true, orderId });\n    \n  } catch (error) {\n    console.error('Verification error:', error);\n    return res.json({ success: false, error: 'Verification failed' });\n  }\n});\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"testing-apple-pay","__idx":18},"children":["Testing Apple Pay"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"test-environment","__idx":19},"children":["Test environment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure your app for Apple Pay testing:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Use test environment for Apple Pay testing\nCheckoutDropInConfig(\n    environment: .test,  // Test environment\n    // ... other config\n    methodConfig: DropInMethodConfig(\n        global: DropInGlobalConfig(\n            transactionInfo: DropInTransactionInfo(\n                countryCode: \"GB\",\n                totalLabel: \"Demo Store\"\n            )\n        ),\n        applePay: DropInApplePayConfig(\n            shippingContactConfiguration: DropInApplePayShippingContactConfiguration(\n                requireShippingContactFields: [.postalAddress, .name]\n            ),\n            billingContactConfiguration: DropInApplePayBillingContactConfiguration(\n                requireBillingContactFields: [.postalAddress]\n            )\n        )\n    )\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apple-pay-sandbox-testing","__idx":20},"children":["Apple Pay sandbox testing"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To test Apple Pay in the sandbox environment:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add test cards to your Apple Wallet on your test device or simulator."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use the test environment in your Drop-in configuration (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["environment: .test"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Apple provides sandbox test cards that can be added to Wallet for testing."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Test payments won't charge real cards or accounts."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apple Pay sandbox testing requires a valid Apple Pay merchant identifier and proper Xcode project configuration. Ensure your merchant ID is registered in both your Apple Developer account and the Unity Portal."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"xcode-project-setup","__idx":21},"children":["Xcode project setup"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To enable Apple Pay in your iOS app, you must configure your Xcode project:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open your project in Xcode."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select your target and go to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Signing & Capabilities"]}," tab."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+"]}," button to add a capability."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add \"Apple Pay\" capability."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select your Apple Pay merchant identifiers."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your merchant identifier should match the format ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchant.com.yourcompany.yourapp"]}," and must be registered in your Apple Developer account."]}]},"headings":[{"value":"Apple Pay","id":"apple-pay","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Key benefits","id":"key-benefits","depth":3},{"value":"How it works","id":"how-it-works","depth":2},{"value":"Configuration","id":"configuration","depth":2},{"value":"Configuration properties","id":"configuration-properties","depth":3},{"value":"Settings used from global configuration","id":"settings-used-from-global-configuration","depth":3},{"value":"Complete example","id":"complete-example","depth":3},{"value":"Apple Pay requirements","id":"apple-pay-requirements","depth":3},{"value":"Implementation","id":"implementation","depth":2},{"value":"Session configuration (backend)","id":"session-configuration-backend","depth":3},{"value":"Payment flows","id":"payment-flows","depth":3},{"value":"Handling responses","id":"handling-responses","depth":2},{"value":"Apple Pay callback data","id":"apple-pay-callback-data","depth":3},{"value":"Error handling","id":"error-handling","depth":3},{"value":"Common error scenarios","id":"common-error-scenarios","depth":4},{"value":"Backend verification","id":"backend-verification","depth":2},{"value":"Backend verification code","id":"backend-verification-code","depth":3},{"value":"Testing Apple Pay","id":"testing-apple-pay","depth":2},{"value":"Test environment","id":"test-environment","depth":3},{"value":"Apple Pay sandbox testing","id":"apple-pay-sandbox-testing","depth":3},{"value":"Xcode project setup","id":"xcode-project-setup","depth":2}],"frontmatter":{"seo":{"title":"Apple Pay"}},"lastModified":"2026-06-12T11:56:36.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/drop-in/ios/apple-pay","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}