RaveSDK
示例
要运行示例项目,请首先克隆仓库,然后在 Example 目录中运行pod install
。
要求
要安装 RaveSDK,您需要在您的 Mac 上安装 Cocoapods。如果您还没有安装,您可以在终端粘贴以下代码片段:
sudo gem install cocoapods
安装
RaveSDK 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中即可:
pod 'RaveSDK'
使用
import UIKit
import RaveSDK
class ViewController: UIViewController ,RavePayProtocol {
func tranasctionSuccessful(flwRef: String?, responseData: [String : Any]?) {
}
func tranasctionFailed(flwRef: String?, responseData: [String : Any]?) {
}
@IBAction func showAction(_ sender: Any) {
let config = RaveConfig.sharedConfig()
config.country = "NG" // Country Code
config.currencyCode = "NGN" // Currency
config.email = "[[email protected]]" // Customer's email
config.isStaging = false // Toggle this for staging and live environment
config.phoneNumber = "[xxxxxxxxx]" //Phone number
config.transcationRef = "ref" // transaction ref
config.firstName = "[firstname]"
config.lastName = "[lastname]"
config.meta = [["metaname":"sdk", "metavalue":"ios"]]
config.publicKey = "[PUB-KEY]" //Public key
config.encryptionKey = "[ENCRYPTION-KEY]" //Encryption key
let controller = NewRavePayViewController()
let nav = UINavigationController(rootViewController: controller)
controller.amount = "[amount]"
controller.delegate = self
self.present(nav, animated: true)
}
}
作者
许可
RaveSDK可供MIT许可证使用。有关更多信息,请参阅LICENSE文件。