Latest 1.1.0
Homepage https://github.com/akaimo/paygent-token-ios-sdk
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation
Authors

paygent-token-ios-sdk

Swift 4.0
Carthage compatible
Version
License
Platform
This is not an official Paygent product.

Requirements

  • Swift 3.0 or later
  • iOS 8.0 or later

Installation

Carthage

github "akaimo/paygent-ios-sdk" ~> 1.1.0

CocoaPods

pod 'PaygentTokenSDK', '~> 1.1.0'

Usage

This can be used like APIKit

extension PaygentTokenSDK.Request {
    var merchantID: String {
        return "marchant_id"
    }
    var tokenGenerateKey: String {
        return "token_generate_key"
    }
}

struct CardTokenRequest: PaygentTokenSDK.PaygentTokenRequest {
    var cardNumber: String
    var cardExpireYear: String
    var cardExpireMonth: String
    var cardCVC: String
    var cardName: String

    init(cardNumber: String, cardExpireYear: String, cardExpireMonth: String,
         cardCVC: String, cardName: String) {
        self.cardNumber = cardNumber
        self.cardExpireYear = cardExpireYear
        self.cardExpireMonth = cardExpireMonth
        self.cardCVC = cardCVC
        self.cardName = cardName
    }
}

let request = CardTokenRequest(cardNumber: "4900123412341234", cardExpireYear: "19",
                               cardExpireMonth: "10", cardCVC: "", cardName: "")
PaygentSession.send(request) { result in
    switch result {
    case .success(let response):
        // success code...
    case .failure(let error):
        // failure code...
    }
}

Latest podspec

{
    "name": "PaygentTokenSDK",
    "version": "1.1.0",
    "summary": "Paygent card token iOS SDK",
    "homepage": "https://github.com/akaimo/paygent-token-ios-sdk",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "akaimo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/akaimo/paygent-token-ios-sdk.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "PaygentTokenSDK/*.{swift,h}",
    "frameworks": "Foundation",
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This