You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I updated Adyen SDK to version 5.0.0. It seems like it is missing .add(holder: card.holder) in this function:
public static func encryptToken(from card: Card, with publicKey: String) throws -> String {
guard !card.isEmpty else { throw CardEncryptor.Error.invalidCard }
let payload = CardPayload()
.add(number: card.number)
.add(securityCode: card.securityCode)
.add(expiryMonth: card.expiryMonth)
.add(expiryYear: card.expiryYear)
return try encrypt(payload, with: publicKey)
}
When I add that line it works as expected, so I think you need to add that. Maybe I miss something?
In previous versions this function it looks like:
public static func encryptedToken(for card: Card, holderName: String?, publicKeyToken: String, environment: Environment, completion: @escaping Completion<Result<String, Swift.Error>>) {
requestPublicKey(forToken: publicKeyToken, environment: environment) { result in
switch result {
case let .success(key):
do {
let encryptedCardToken = try CardEncryptor.encryptedToken(for: card, holderName: holderName, publicKey: key)
completion(.success(encryptedCardToken))
} catch {
completion(.failure(error))
}
case let .failure(error):
completion(.failure(error))
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I updated Adyen SDK to version 5.0.0. It seems like it is missing .add(holder: card.holder) in this function:
public static func encryptToken(from card: Card, with publicKey: String) throws -> String {
guard !card.isEmpty else { throw CardEncryptor.Error.invalidCard }
let payload = CardPayload()
.add(number: card.number)
.add(securityCode: card.securityCode)
.add(expiryMonth: card.expiryMonth)
.add(expiryYear: card.expiryYear)
return try encrypt(payload, with: publicKey)
}
When I add that line it works as expected, so I think you need to add that. Maybe I miss something?
}
Beta Was this translation helpful? Give feedback.
All reactions