iOS Native SDK - Embed(V3)
1. Overview#
Integrate PortOne iOS Native SDK to enable secure and efficient payment processing in your iOS application. This guide will help you set up the SDK and start accepting payments seamlessly.
2. Video Tutorial#
For a comprehensive guide on integrating the PortOne iOS SDK and using the payment method flow, refer to the following video tutorials:
- iOS Integration: Watch Tutorial
- Accessing PortOne Checkout: Watch Tutorial
3. Sample App#
Explore the sample application for integration examples on GitHub.
4. Prerequisites#
Before starting the integration, ensure you have:
- PortOne Account: Create an account on PortOne to access their services.
- API Keys: Obtain your API keys (client key and secret key) from the PortOne portal under Settings -> API tab.
- Enable Payment Channels: Customize and enable the payment channels and methods according to your business requirements.
- iOS Application: Prepare an iOS application where you will integrate the PortOne SDK.
- Download the Framework: Get the latest framework from here.
5. Integration Steps#
5.1. Embed the Framework in Project#
Add Framework:
- Download the
.xcframeworkfrom the version folder. - Drag and drop it into your Xcode project.
- Go to
General->Frameworks, Libraries, and Embedded Content. - Set the framework to
Embed & Sign.

- Download the
5.2. Enable Deep Linking in iOS#
Configure URL Schemes:
Open your project settings and navigate to
Info.Add URL schemes and identifiers under
URL Typesininfo.plist:
Add URL Schemes for Other Apps:
Support HTTP Connections:
Add the following to
info.plist:
5.3. Obtain JWT Token#
Generate JWT Token:
- Implement server-side logic to generate a JWT token using the
portoneKey. - Retrieve the JWT token in your iOS app and store it securely.
- Implement server-side logic to generate a JWT token using the
5.4. Generate Signature Hash#
Create Signature Hash:
- Use HmacSHA256 to generate a signature hash for the payload.
5.5. Initialize and Authorize SDK#
Import SDK:
Initialize Checkout:
Implement Delegate Methods:
6. Checkout Using Web (v3)#
PortOne's Checkout offers a streamlined process by handling the payment UI within the SDK.
Initiate Checkout:
Prepare Payload:
}
Sample Response:
Success:
Failed:
7. Error Handling#
INVALID_UNAUTHORIZED_JWT_TOKEN_ERROR: Ensure the PortOne key and secret key are correct, and that the JWT token is properly formatted with theBearerprefix.INVALID_UNAUTHORISED_TRANSACTION_SIGNATURE_ERROR: Verify that all parameters match the payload and the PortOne key is correct.INVALID_PAYMENT_CHANNEL: Confirm that the payment channels and methods are enabled in the PortOne portal.INVALID_ENVIRONMENT: Ensure the environment is set to eithersandboxorlive.- Summation of Order Values: Check that the order value, taxes, duties, shipping, and discounts match the specified amount.
8. JWT Token Generation#
Algorithm: HS256
Generate JWT Token:
- iss: Issuer (Default: "PORTONE")
- sub: Portone Key
- iat: Issued At (Current timestamp)
- exp: Expiration Time (Timestamp + 100 seconds)
For more details, refer to the Native iOS - Payment SDK: v2 documentation