Introduction
Welcome to the documentation for Checkoutsdk-ios, a software development kit (SDK) that allows you to integrate secure and seamless payment processing into your iOS applications.
Features
- Easy integration: Simple steps to integrate payment functionality into your iOS app.
- Secure transactions: Ensure a secure payment process for your users.
- Seamless UI: Provide a smooth user experience with customizable payment screens.
- Multiple payment methods: Support a variety of payment options, including credit cards, digital wallets, and more.
- Encryption: Safeguard sensitive user data using advanced encryption algorithms.
- Transaction history: Keep track of payment transactions for easy auditing and reporting.
Getting Started
To get started with Checkoutsdk-ios, follow the steps below:
Installation
1. Open your iOS project in Xcode.
2. In Xcode, go to ‘File’ -> ‘Swift Packages’ -> ‘Add Package Dependency’.
3. Enter the following repository URL: ‘https://github.com/checkouts/checkoutsdk-ios’
4. Choose the desired version of the SDK.
5. Click ‘Next’ and then ‘Finish’ to complete the installation process.
Configuration
Once the SDK is installed, you need to configure it in your project:
1. Open your app’s AppDelegate.swift file.
2. Import the Checkoutsdk module.
3. In the application:didFinishLaunchingWithOptions method, initialize the SDK with your API public key:
import Checkoutsdk
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
...
// Initialize the Checkoutsdk with your API public key
Checkoutsdk.initialize(publicKey: "YOUR_API_PUBLIC_KEY")
...
}
Usage
Integration of Checkoutsdk-ios involves the following steps:
Step 1 – Create Payment Request
To initiate a payment, create a PaymentRequest object:
let paymentRequest = PaymentRequest(amount: 10.99, currency: "USD")
paymentRequest.reference = "ORDER123"
// Set additional payment request properties, if required
paymentRequest.customerName = "John Doe"
paymentRequest.customerEmail = "john.doe@example.com"
...
Step 2 – Present Payment Screen
Present the payment view controller to allow the user to enter payment details:
let paymentViewController = PaymentViewController(paymentRequest: paymentRequest)
present(paymentViewController, animated: true, completion: nil)
Step 3 – Handle Payment Completion
Implement the PaymentDelegate protocol to receive payment completion callbacks:
class MyPaymentDelegate: NSObject, PaymentDelegate {
func paymentSucceeded(paymentResponse: PaymentResponse) {
// Handle successful payment
}
func paymentCancelled() {
// Handle cancelled payment
}
func paymentFailed(error: Error) {
// Handle payment failure
}
}
// Assign the delegate to the payment view controller
paymentViewController.paymentDelegate = MyPaymentDelegate()
Additional Resources
For further assistance with Checkoutsdk-ios, you can refer to the following resources:
Official SDK Repository
Find the latest updates and documentation by visiting the official Checkoutsdk-ios repository on GitHub:
https://github.com/checkouts/checkoutsdk-ios
Support and Community
Join the community and get help from other developers using Checkoutsdk-ios:
Contact Support
If you have any specific questions or need further assistance, please contact our support team:
Email: support@checkout.com
Phone: +1 123 456 7890
That’s it! You are now ready to integrate the Checkoutsdk-ios SDK into your iOS application. Enjoy seamless and secure payments within your app!