Created
October 22, 2018 09:06
-
-
Save xslim/d12822e3f7523baeeb0fa43d5b790245 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)removeAllPaymentDevices:(id)args | |
{ | |
NSLog(@"removing all payment devices"); | |
ADYDeviceRegistry* deviceRegistry = [Adyen sharedInstance].deviceRegistry; | |
NSMutableArray* devices = deviceRegistry.devices.copy; | |
for (ADYDevice* device in devices) { | |
if (device.connectionType == ADYDeviceConnectionTypeWifi && device.hostname != nil && ![device.hostname isEqualToString:@""]) { | |
NSLog(@"Payment device with hostname %@ being removed from device registry", device.hostname); | |
if (self.device == device) { | |
[self.device removeObserver:self forKeyPath:@"status"]; | |
self.device = nil; | |
} | |
[deviceRegistry removeDeviceWithHostname:device.hostname]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment