Latest 2.0.2
License MIT
Platforms ios 8.0
Frameworks UIKit

Omise-iOS-Swift is a Swift 2.0 library for managing token with Omise API.

By using the token produced by this library, you will be able to securely process credit card without letting sensitive information pass through your server. This token can also be used to create customer card data which will allow re-using of card data for the next payment without entering it again.

All data are transmitted via HTTPS to our PCI-DSS certified server.


Please copy all files in {repo root}/Omise-iOS/Omise-iOS/OmiseLib into your project.


Omise-iOS-Swift is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'Omise-iOS-Swift', '~> 2.0'

Primary classes


A class representing a card information.


A class encapsulating parameters for requesting token. You will have to set card information as a parameter for this class.


A class representing token. This class is what will be passed to the delegate if the request is successful.


A class for requesting token. See also sample code below.

Test app

By opening Omise-iOS_Test.xcodeproj and building it on Xcode, the sample application will launch and create a charge token to test.

Request a token


override func viewDidLoad() {

    //set parameters
    let tokenRequest = OmiseTokenRequest()
    tokenRequest.publicKey = "pkey_test_4y7dh41kuvvawbhslxw" //required
    tokenRequest.card!.name = "JOHN DOE" //required
    tokenRequest.card!.city = "Bangkok" // optional
    tokenRequest.card!.postalCode = "10320" //optional
    tokenRequest.card!.number = "4242424242424242" //required
    tokenRequest.card!.expirationMonth = "11" //required
    tokenRequest.card!.expirationYear = "2016" //required
    tokenRequest.card!.securityCode = "123" //required

    let omise = Omise()
    omise.delegate = self

// MARK: - OmiseTokenDelegate
extension AccessOmiseViewController: OmiseRequestDelegate {

    func omiseOnFailed(error: NSError?) {
        //handle error

    func omiseOnSucceededToken(token: OmiseToken?) {
        //handle success
        if let token = token {
            //your code here

Latest podspec

    "name": "Omise-iOS-Swift",
    "version": "2.0.2",
    "summary": "Swift 2.0 client library for the Omise API",
    "description": "Omise-iOS-Swift is a library for managing payment authorization tokens andnstored credit card details with the Omise API.",
    "homepage": "",
    "social_media_url": "",
    "authors": {
        "Omise": "[email protected]"
    "license": "MIT",
    "source": {
        "git": "",
        "tag": "v2.0.2"
    "platforms": {
        "ios": "8.0"
    "source_files": "Omise-iOS_SDK/Omise-iOS_SDK/SDK/*.swift",
    "frameworks": [

Pin It on Pinterest

Share This