iOS Client-Side Encryption SDK

      iOS Client-Side Encryption SDK


        Article Summary

        This SDK is used to encrypt card data on the client side. In this case on the iOS device itself. The crypted data that is created by CSE can be transferred to the Buckaroo API through you own server.

        Client side

        On the client side you have to make a form in which the consumer can enter its card data (like card number, expiry date, cvc and cardholder name). This data has to be fed to the ecrypt method (for cards that do not have a cvc code, like Maestro and Bancontact, you can provide the empty string) alongside with a function which sends the encrypted card data to the server side. We also have provided some validation functions to validate the consumer's input. You can find examples of how to use this SDK below.

        Server side

        With the received encrypted card data you can create a Creditcard or Bancontact PayEncrypted (or AuthorizeEncrypted) request (see respectively the Creditcard or Bancontact documentation on how to make such a request). After this request, the flow will continue like the consumer has entered its card data on our checkout, so we will return an URL when the consumer has to perform 3DSecure or we will return a success (or failed) status of the transaction.

        Next steps

        Once you have performed some successful test transactions you can fill out the SAQ-A from PCI and Buckaroo will enable Client Side Encryption on your live channel.

        Encrypt card data example

        This code example shows how the Encrypt method can be used for card data.

        do {
        	let encryptCardDataResult = try CSE.encrypt(cardNumber: "5386860000000000", year: "2020", month: "12", cvc: "123", cardholder: "A DE GROOT")
        	print("encryptedCardData: \(encryptCardDataResult)")
        } catch {
        	print("encryptError: \(error)")
        }
        

        Encrypt security code example

        This code example shows how the Encrypt method can be used for just the security code.

        do {
        	let encryptCardDataResult = try CSE.encrypt(cvc: "123")
        	print("encryptedCardData: \(encryptCardDataResult)")
        } catch {
        	print("encryptError: \(error)")
        }
        

        Was this article helpful?