- Have
AdyenToolkit
library in../AdyenPOSLib
folder - install Cocoapods
- run
pod install
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
#import "ViewController.h" | |
// Do not forget to put in Podfile: | |
// use_frameworks! | |
// pod "AdyenBarcoder" | |
#import <AdyenBarcoder/AdyenBarcoder-Swift.h> | |
@interface ViewController () <BarcoderDelegate> | |
@end |
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
// Adyen Delegates | |
-(void)transactionStarted:(ADYTransactionData *)transaction { | |
// Save tenderReference and terminalId to storage | |
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; | |
[ud setObject:transaction.tenderReference forKey:@"tx_tenderReference"]; | |
[ud setObject:transaction.terminalId forKey:@"tx_terminalId"]; | |
[ud synchronize]; | |
} |
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)viewDidLoad { | |
[super viewDidLoad]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(barcodeReceived:) | |
name:ADYNotificationBarcodeReceived | |
object:nil]; | |
// Optional - button to trigger soft scan |
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
import UIKit | |
import ExternalAccessory | |
class DevicesViewController: UITableViewController { | |
var manager = EAAccessoryManager.sharedAccessoryManager() | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<input type="button" id="stopButton" value="Stop Listening"/> | |
<hr/> | |
<div id="content"></div> | |
<script> |
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
{ | |
"paymentMethods":[ | |
{ | |
"brandCode":"diners", | |
"name":"Diners Club" | |
}, | |
{ | |
"brandCode":"discover", | |
"name":"Discover" | |
}, |
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
+ (BOOL)checkJailbreak { | |
//#if DEBUG | |
// return NO; | |
//#endif | |
BOOL debug = YES; | |
if (debug) NSLog(@"setup started"); | |
int is_jailbroken = 0; | |
int result = fork(); |