Import
import ECPayPaymentGatewayKit
Initialize
It is recommended to perform the initialization action in AppDelegate.swift. For environment parameters, please refer to the description in the next paragraph.
ECPayPaymentGatewayManager.sharedInstance().initialize(env: .Stage)
Input
Env String
Required
Environment parameter.
- Stage: Stage environment/testing mode
- Prod: Production environment/live mode
Example
var envStr:String = "prod"
if let env = Bundle.main.object(forInfoDictionaryKey: "ENV") as? String {
envStr = env.lowercased()
}
switch envStr {
case "stage":
ECPayPaymentGatewayManager.sharedInstance().initialize(env: .Stage)
break
default:
ECPayPaymentGatewayManager.sharedInstance().initialize(env: .Prod)
break
}