Closed raphaels17 closed 1 year ago
We believe this issue is fixed, please reach out to me if you continue to have problems
Hi
This works though.. I am suprise I can only enter "URL" and not sheme with myappname:// ? Am i missing something ?
Hey Raphael,
The issue has been fixed, and now you can enter a custom schema in the URL.
Kind regards,
SumUp
Hi thanks, I have been able to change. This being said, It somehow still doesn't work.. For what it's worth ChatGPT 4 doesn't seem to find anything wrong with my code either..I am afraid the issue is still not on my hand. The project is the SumUpSDKSampleApp , where I try to implement SumUpSDK.login(withToken: token.
I have attached the project. Can you help ?
When calling : // Start the authentication session session = ASWebAuthenticationSession(url: request.url!, callbackURLScheme: encodedURI) And clicking OK I get unknow error.
here is the entire function . I will offcourse use another account for production of our PoS app.
private func requestAuthorizationCode() {
// Set up the authorization request
// let authURLString = "https://api.sumup.com/authorize?response_type=code&client_id=cc_classic_1G6T7smTwnawrORglMA903dJJYpG6&redirect_uri=https://www.hangers.io/sumup&scope=payments.history payments.app-settings payments.profile_readonly".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! // let authURL = URL(string: authURLString)! let authURL = URL(string: "https://api.sumup.com/authorize")! let redirectURI = "com.sumup.sdk.sample.swift://authsum" let encodedURI = redirectURI.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)! var components = URLComponents(url: authURL, resolvingAgainstBaseURL: false)! components.queryItems = [ URLQueryItem(name: "response_type", value: "code"), URLQueryItem(name: "client_id", value: "cc_classic_2CgPnRf5uKic33Ovgkr1IMnThAH5S"), URLQueryItem(name: "redirect_uri", value: encodedURI), URLQueryItem(name: "scope", value: "payments.app-settings payments.profile_readonly".addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!), ] let url = components.url! let request = URLRequest(url: url)
// Start the authentication session
session = ASWebAuthenticationSession(url: request.url!, callbackURLScheme: encodedURI) { [weak self] callbackURL, error in
guard let self = self else { return }
// Handle the callback URL to retrieve the authorization code
guard let code = self.extractAuthorizationCode(from: callbackURL) else {
print("Failed to retrieve authorization code: \(error?.localizedDescription ?? "Unknown error")")
return
}
// Exchange the authorization code for an access token
OAuthSumUpAccountManager.getSumUpToken(code: code,completion: { (token, error) in
SumUpSDK.login(withToken: token!) { [weak self] (success: Bool, error: Error?) in
//debugPrint("SUMUP logged in : \(SumupSDK.isLoggedIn())")
guard error == nil else {
// self?.showResult(title:.sumUpError,string: .sumUpNotLoggedIn, isError: true)
//debugPrint("SUMUP error after calling oAuth url : \(error.debugDescription)")
// errors are handled within the SDK, there should be no need
// for your app to display any error message
return
}
}
})
}
if #available(iOS 13.0, *) {
session?.presentationContextProvider = self
} else {
// Fallback on earlier versions
}
session?.start()
}
The developer form for integration is simply broken. One can no longer "Create client credentials" for Application Type "iOS" or other, other types work.
The save button keeps failing
I have tried on several account and browser
This is the data used if this can help