- Have
AdyenToolkit
library in../AdyenPOSLib
folder - install Cocoapods
- run
pod install
For the connection to Adyen backend, those domains should be whitelisted:
pos-payment-live.adyen.com
pos-sync-live.adyen.com
pos-payment-test.adyen.com
pos-sync-test.adyen.com
ca-test.adyen.com
Make sure to unzip the app source and the adyen library in the following folder structure:
AdyenPOS/
- source of appAdyenPOSLib/
- libraryAdyenToolkit.podspec
- Pod specios/AdyenToolkit.framework
- framework
Install Cocoapods and run pod install
Make sure to include followint in Info.plist
UISupportedExternalAccessoryProtocols
:com.adyen.bt1
com.verifone.pmr.zontalk
com.verifone.pmr.xpi
To receive the barcode implement the following:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(barcodeReceived:)
name:ADYNotificationBarcodeReceived
object:nil];
- (void)barcodeReceived:(NSNotification *)notification {
NSString *barcode = notification.object;
NSString *symbology = notification.userInfo[@"symbology”]
ADYBarcodeType barcodeType = [notification.userInfo[@"type"] integerValue];
}
UIButton *barcodeBtn = [[UIButton alloc] init];
[barcodeBtn setTitle:@"Barcode" forState:UIControlStateNormal];
[barcodeBtn addTarget:self action:@selector(startBarcodeScan:) forControlEvents:UIControlEventTouchDown];
[barcodeBtn addTarget:self action:@selector(stopBarcodeScan:) forControlEvents:UIControlEventTouchUpInside];
- (IBAction)startBarcodeScan:(id)sender {
ADYDevice *device = _selectedDeviceManager.selectedDevice;
[device startBarcodeScan];
}
- (IBAction)stopBarcodeScan:(id)sender {
ADYDevice *device = _selectedDeviceManager.selectedDevice;
[device stopBarcodeScan];
}