Я пытаюсь создать сеанс, но не могу выполнить эту задачу, поскольку у меня возникла проблема, может кто-нибудь помочь мне с этим:
ошибка: CreadiMaxPaymentDemo. MerchantAPIError.failedRequest
вот мое усилие
let mID = "TESTE1******0"
let mURL:URL = URL(string: "https://credimax.gateway.mastercard.com/api/rest/version/53/merchant/\(mID)/session")!
let mRegion = GatewayRegion.asiaPacific
configure(merchantId: mID, region: mRegion, merchantServiceURL: mURL, applePayMerchantIdentifier: "")
// Called to configure the view controller with the gateway and merchant service information.
func configure(merchantId: String, region: GatewayRegion, merchantServiceURL: URL, applePayMerchantIdentifier: String?) {
gateway = Gateway(region: region, merchantId: merchantId)
merchantAPI = MerchantAPI(url: merchantServiceURL)
transaction.applePayMerchantIdentifier = applePayMerchantIdentifier
}
// This function creates a new session using the merchant service
func createSession() {
merchantAPI.createSession { (result) in
DispatchQueue.main.async {
guard case .success(let response) = result,
"SUCCESS" == response[at: "gatewayResponse.result"] as? String,
let session = response[at: "gatewayResponse.session.id"] as? String,
let apiVersion = response[at: "apiVersion"] as? String else {
print(result)
print("Error Creating Session")
return
}
// The session was created successfully
self.transaction.session = GatewaySession(id: session, apiVersion: apiVersion)
print("Creating Session")
}
}
}
Заранее спасибо.