- Install package with
$ npm install react-native-adyen-encrypt --save
- modify
ios/Podfile
so thatplatform :ios
is >= 10 - your iOS project will need to have a Swift bridging header. Easiest way to do this is to add a swift file to the project. This file must remain in the project 😢
- Verify that your SWIFT_VERSION is >= 5
pod install
- Install package with
$ npm install react-native-adyen-encrypt --save
- That should be it 😅
https://github.com/voomflights/react-native-adyen-encrypt-example
import {AdyenEncryptor, CardForm} from 'react-native-adyen-encrypt'
const cardForm: CardForm = {
cardNumber: "654654654654654",
securityCode: "999",
expiryMonth: "13",
expiryYear: "1999" // note 4 digit year
}
const encryptor = new AdyenEncryptor(ADYEN_PUBLIC_KEY)
const promise = encryptor.encryptCard(cardForm)
promise.then((data: EncryptedCard) => {
// do something neat
})