Introduction
Welcome to the documentation for QuadPaySDK, a powerful software development kit for QuadPay integration in your iOS applications. This documentation aims to provide you with a comprehensive guide on how to integrate QuadPay into your iOS app and utilize its features effectively.
Getting Started
In order to integrate QuadPaySDK into your iOS application, follow the steps below:
- Install the QuadPaySDK via CocoaPods or manually download and import the framework into your project.
- Import the QuadPaySDK module into your source files.
- Obtain your QuadPay API credentials by signing up for an account on the QuadPay Merchant Portal.
- Configure your QuadPay credentials in your app’s configuration file.
- Integrate QuadPay into your app by utilizing the provided QuadPaySDK functions and methods.
Usage and Implementation
QuadPaySDK offers various methods and functions to help you integrate QuadPay into your iOS application:
QuadPaySDK Functions
QuadPaySDK provides a range of functions to handle different aspects of the QuadPay integration:
initializeSDK(clientID: String, environment: QuadPayEnvironment)
: Initializes the QuadPaySDK with the provided client ID and environment.configureAppearance(appearance: QuadPayAppearance)
: Configures the appearance settings for the QuadPayUI components.createCheckoutOrder(order: QuadPayOrder, viewController: UIViewController, completion: @escaping QuadPayCheckoutCompletion)
: Creates a checkout order for the user, presenting the QuadPayUI checkout flow.fetchCustomer(completion: @escaping QuadPayCustomerCompletion)
: Fetches the authenticated customer’s details such as the customer ID, email, and shipping address.updateCustomer(customer: QuadPayCustomer, completion: @escaping QuadPayCustomerCompletion)
: Updates the customer’s details such as the email or shipping address.
QuadPayEnvironment
QuadPaySDK provides two environment options to specify the API environment:
QuadPayEnvironment.production
: Specifies the production API environment for live transactions.QuadPayEnvironment.sandbox
: Specifies the sandbox API environment for testing and development.
QuadPayAppearance
The QuadPayAppearance class allows you to modify the appearance settings for the QuadPayUI components. It provides properties such as:
backgroundColor
: The background color of the QuadPayUI components.foregroundColor
: The foreground color of the QuadPayUI components.buttonColor
: The color of buttons in the QuadPayUI components.buttonCornerRadius
: The corner radius of buttons in the QuadPayUI components.
QuadPayOrder
The QuadPayOrder class represents the details of an order to be processed through QuadPay. It includes properties such as order ID, order amount, and merchant location details.
QuadPayCustomer
The QuadPayCustomer class holds the customer’s details such as the customer ID, email, and shipping address for authentication and order processing.
Examples and Code Snippets
Below are some examples showcasing the usage of QuadPaySDK in your iOS app:
Example 1: Initialize QuadPaySDK
// Initialize the QuadPaySDK
QuadPaySDK.shared.initializeSDK(clientID: "YOUR_CLIENT_ID", environment: .sandbox)
Example 2: Create a Checkout Order
// Create a checkout order
QuadPaySDK.shared.createCheckoutOrder(order: quadPayOrder, viewController: self) { result in
switch result {
case .success(let orderId):
print("Checkout Order created successfully. Order ID: \(orderId)")
case .failure(let error):
print("Failed to create checkout order. Error: \(error.localizedDescription)")
}
}
Additional Information and Resources
For further details and a comprehensive list of functions, please refer to the official QuadPaySDK documentation found on GitHub: https://github.com/quadpay/quadpay-ios-sdk.
You can also explore the QuadPay Merchant Portal and QuadPay API documentation for more information on how to use the QuadPay service effectively in your applications.
Conclusion
Congratulations! You have successfully learned how to integrate QuadPaySDK into your iOS app and utilize its functionalities. Feel free to explore the various functions and options provided by QuadPaySDK to enhance the payment experience for your users.