1

这是我用于验证具有值的 OTP 特定 Payfort 的功能,但显示(无效值 OTP),但响应邮递员请求显示(成功 OTP)为什么执行,并且 OTP 值中的问题必须是字母数字,所以怎么能我定义了一个字母数字参数?

func verifyOTP(getTotal: String, getRandom: String,getTransaction: String) {
    let signatureStructure = "sportEyeByAbouElgoukhaccess_code=hRRVGXrIpHSYoH19Ebwtamount=\(getTotal)currency=EGPlanguage=enmerchant_identifier=e54638ebmerchant_order_id=\(getRandom)merchant_reference=\(getRandom)otp=\(123456)payment_option=VALUphone_number=01008606003service_command=OTP_VERIFYtotal_downpayment=0sportEyeByAbouElgoukh"
    let base64Str = signatureStructure.sha256()
    let parameters = ["otp":123456,"currency":"EGP","merchant_order_id":getRandom,"signature":base64Str,"merchant_reference":getRandom,"payment_option":"VALU","merchant_identifier":"e54638eb","amount":getTotal,"access_code":"hRRVGXrIpHSYoH19Ebwt","total_downpayment":"0","service_command":"OTP_VERIFY","phone_number":"01008606003","language":"en"] as [String : Any]
    Alamofire.request(URLAPi.URL_Payment_Api , method : .post , parameters : parameters , encoding: JSONEncoding.default ).responseJSON { (response) in
        if response.result.isSuccess {
            let jsonpayfortrequest : JSON  = JSON(response.result.value!)
            SVProgressHUD.dismiss()
        }
        else {
            print("error connection")
            SVProgressHUD.dismiss()
        }
    }
}
4

0 回答 0