# Quickstart > Before reading this document, ensure you have completed the [Integration Guide](/payments/docs/introduction/integrated-guide) and are familiar with the [APIs for creating a checkout](/payments/apis/introduction/started). The iOS SDK provided by PayKKa allows you to easily embed our [Web Checkout](/payments/docs/transaction/web/hosted-web) via a WebView. By simply providing a `sessionId` to the SDK, you can open the checkout page within your app, accept payments, and customize payment callbacks. The latest SDK download link is available in the [iOS SDK Release History](/payments/docs/developer-resources/native-sdks/ios-sdk/release-history). ## Step 1: Integrate the SDK into Your Project After downloading the SDK, you will receive a .zip file with the following directory structure: ```txt . ├── PayKKaCheckoutApp-iOS │   ├── OcCheckoutDemo │   │   ├── OcCheckoutDemo │   │   └── OcCheckoutDemo.xcodeproj │   ├── PayKKaCheckoutApp-iOS.xcworkspace │   │   ├── contents.xcworkspacedata │   │   ├── xcshareddata │   │   └── xcuserdata │   └── SwiftCheckoutDemo │   ├── SwiftCheckoutDemo │   ├── SwiftCheckoutDemo.xcodeproj │   ├── SwiftCheckoutDemoTests │   └── SwiftCheckoutDemoUITests └── sdk └── PayKKaCheckoutPayments.xcframework ├── Info.plist ├── ios-arm64 └── ios-arm64_x86_64-simulator ``` The `PayKKaCheckoutApp-iOS` folder contains two Xcode projects for sample apps written in Objective-C and Swift, allowing developers to understand how to use the PayKKa SDK APIs through sample code. The `PayKKaCheckoutPayments.xcframework` in the `sdk` folder at the root directory after extraction is the core PayKKa SDK. To integrate the PayKKa SDK, simply follow these steps in Xcode: Project Navigator `` → `TARGETS ` → `Build Phases` → `Link Binary With Libraries` → click the `+` icon → select `Add Files...` → choose ``. Note: Under `TARGETS ` → `General` → `Frameworks, Libraries, and Embedded Content`, ensure `PayKKaCheckoutPayments.xcframework` is set to `Embed & Sign`, as shown below: Xcode configuration 1 ## Step 2: Use the SDK in Your Project Once the SDK is integrated, you can begin using the PayKKa Checkout in your app. Key code snippets are provided below; for full code and examples, refer to the source code of the PayKKaCheckoutApp-iOS Xcode projects included with the SDK. Swift ```swift ConfirmOrder.swift import SwiftUI /// Import the SDK import PayKKaCheckoutPayments struct ConfirmOrder: View { @EnvironmentObject var router: NavigationRouter /// Define a state variable to control the visibility of the WebViewSheet @State private var showWebView = false /// PayKKa Checkout sessionId, typically returned by the backend API, used to construct and display the checkout private let sessionId: String let price: Double = 1118.83; var body: some View { ScrollView { ... } /// Register the paykkaPaymentWKWebViewSheet component here to customize payment callbacks .paykkaPaymentWKWebViewSheet(isPresented: $showWebView, sessionId: sessionId, onPaymentResultCallback: { paymentResult in print("---->", paymentResult.toString()) switch paymentResult.status { // Checkout payment successful case .success: router.redirect(to: .payment_complete(extraData: ["paymentResult": paymentResult])) // Checkout session expired case .expired: router.redirect(to: .payment_complete(extraData: ["paymentResult": paymentResult])) print("onExpired: \(paymentResult.toString())") default: print("Unhandled payment status: \(paymentResult.status)") } }) .navigationTitle("Confirm Order") .navigationBarTitleDisplayMode(.inline) HStack { Button { /// Tap button to show WebViewSheet showWebView = true } label: { ... } } ... } init(showWebView: Bool = false, sessionId: String) { /// Initialize the PayKKa SDK environment configuration here... PayKKa.use(.sandbox) self.showWebView = showWebView self.sessionId = sessionId } } ... ``` Objective-C ```objective-c ConfirmOrderViewController.m #import "ConfirmOrderViewController.h" #import "../PaymentComplete/PaymentCompleteViewController.h" /// Import SDK header file #import NS_ASSUME_NONNULL_BEGIN ... @implementation ConfirmOrderViewController - (instancetype)initWithExtraData:(NSDictionary *)extra { self = [super init]; if (self) { _sessionId = extra[@"sessionId"] ?: @""; _price = 1118.83; /// Initialize the PayKKa SDK environment configuration here... [PayKKa useEnv:PayKKaEnv.SANDBOX]; } return self; } - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Confirm Order"; self.view.backgroundColor = [UIColor systemGray6Color]; [self buildScrollView]; [self buildOrderCard]; [self buildBottomPayButton]; } - (void)buildScrollView { ... } - (void)buildOrderCard { ... } - (void)buildBottomPayButton { ... } - (void)openCheckout { /// Show WebViewSheet UINavigationController *nav = self.navigationController; UIViewController *presentingVC = nav.topViewController; /// Directly call the method here to launch the WKWebViewSheet component and customize payment callbacks [PayKKa goPay:presentingVC sessionId:@"CSXXXXXXXXXXXXXXXXXX" onPaymentCallback:^(PaymentResult * _Nonnull paymentResult) { PaymentCompleteViewController *vc = [[PaymentCompleteViewController alloc] initWithPaymentResult:paymentResult]; switch (paymentResult.status) { // Checkout payment successful case PaymentStatusSuccess: { NSArray *newStack = @[nav.viewControllers.firstObject, vc]; [nav setViewControllers:newStack animated:YES]; break; } // Checkout session expired case PaymentStatusExpired: { NSArray *newStack = @[nav.viewControllers.firstObject, vc]; [nav setViewControllers:newStack animated:YES]; NSLog(@"onExpired: %@", [paymentResult toString]); break; } default: NSLog(@"Unhandled payment status: %@", @(paymentResult.status)); break; } }]; } @end NS_ASSUME_NONNULL_END ``` ## Step 3: Test the Payment You can use test cards in the PayKKa SANDBOX environment for testing. Switch to the PROD environment when building the release version of your app. Swift ```swift /// SANDBOX (default) PayKKa.use(.sandbox) /// Switch to European production environment PayKKa.use(.prod_EU) /// Switch to Hong Kong production environment PayKKa.use(.prod_HK) ``` Objective-C ```objective-c /// SANDBOX (default) [PayKKa useEnv:PayKKaEnv.SANDBOX]; /// Switch to European production environment [PayKKa useEnv:PayKKaEnv.PROD_EU]; /// Switch to Hong Kong production environment [PayKKa useEnv:PayKKaEnv.PROD_HK]; ``` ## Precautions ### Apple Pay #### 1. How to use test cards for payment testing? You need to log in to App Store Connect, create a sandbox account using an email address, then log in with this sandbox account on your iOS device. Link a sandbox test card for Apple Pay to conduct payment testing. The complete configuration guide can be found in Apple's official documentation: [Apple Pay Sandbox Testing](https://developer.apple.com/apple-pay/sandbox-testing/). More documentation on the checkout can be found here: [Payment Method - Apple Pay](/payments/docs/payment-method/apple-pay/apple-pay#testing)