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
platform :ios, :deployment_target => "9.0" | |
use_frameworks! | |
def shared_dependencies | |
pod "acceptSDKTwo" | |
end | |
target 'AcceptDemo' do | |
shared_dependencies | |
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
// Import the SDK header | |
#import <WDePOS/WDePOS.h> | |
//End of SDK Setup process | |
CurrentUserCompletion setupCompletion = ^( WDMerchantUser * _Nullable currentUser, WDMerchantCashier * _Nullable cashier, NSError * _Nullable error){ | |
//Current User is returned upon successful login | |
//if the Cash Management is enabled and Cashier record exist for the current user then the Cashier is returned also | |
}; | |
// The SDK is initialized as shared instance so can be accessed |
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 SDK module | |
import WDePOS | |
//End of SDK setup process | |
let setupCompletion:CurrentUserCompletion = {( currentUser:WDMerchantUser?, cashier:WDMerchantCashier? , error:Error?) in | |
//Current User is returned upon successful login | |
//if the Cash Management is enabled and Cashier record exist for the current user then the Cashier is returned also | |
} | |
// The SDK is initialized as shared instance so can be accessed |
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
// Create the instance of the Sale Request | |
// Here the minimum data is depicted | |
WDSaleRequestPurchase *saleRequest = [[WDSaleRequestPurchase alloc] initWithUniqueId:@"yourSaleUniqueID" // provide your unique ID to identify the Sale | |
location:nil // provide the GPS location | |
inclusiveTaxes:YES // Tax inclusive/exclusive flag | |
currency:@"EUR" // Currency to use for this Sale | |
note:@"Test Posmate Sale" // Top level note for this sale | |
gratuityTaxRate:nil // Gratuity tax rate - nil if no gratuity to be set later in the payment flow | |
// Create one item named "Item 1" costing 10.00 EUR at 20% Tax |
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
// Create the instance of the Sale Request | |
// Here the minimum data is depicted | |
let saleRequest = WDSaleRequestPurchase(uniqueId: "yourSaleUniqueID", // provide your unique ID to identify the Sale | |
location: nil, // provide the GPS location for this payment e.g. the mobile device location | |
inclusiveTaxes: true, // Tax inclusive/exclusive flag | |
currency: "EUR", // Currency to use for this Sale | |
note: "Test Sale", // Top level note for this sale | |
gratuityTaxRate: nil // Gratuity tax rate - nil if no gratuity to be set later in the payment flow | |
)! |
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
// The SDK is initialized as shared instance so can be accessed | |
// from multiple View Controllers | |
WDePOS *sdk = [WDePOS sharedInstance]; | |
// Set the SDK target environment - in this case Public Test | |
// and the username and password to authenticate to it | |
[sdk setupWithEnvironment:WDEnvironmentPublicTest | |
username:@"yourUsername" | |
password:@"yourPassword" | |
completion:^(WDMerchantUser * _Nullable currentUser, WDMerchantCashier * _Nullable cashier, NSError * _Nullable error) { |
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
//End of SDK setup process | |
let setupCompletion: CurrentUserCompletion = {( currentUser:WDMerchantUser?, cashier:WDMerchantCashier? , error:Error?) in | |
//Current User is returned upon successful login | |
//if the Cash Management is enabled and Cashier record exist for the current user then the Cashier is returned also | |
} | |
// The SDK is initialized as shared instance so can be accessed | |
// from multiple View Controllers | |
let sdk: WDePOS = WDePOS.sharedInstance() |
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
let sdk: WDePOS = WDePOS.sharedInstance() | |
// Discover active terminals and use it - in this case we use the first one | |
// Alternatively use the one discovered previously and stored in an instance variable (or user preferences) | |
sdk.terminalManager.discoverDevices(WDExtensionTypeUUID.WDPosMateExtensionUUID) { (terminals: [WDTerminal]?, error: Error?) in | |
if let terminalsArr = terminals { | |
//Here we assume that at least one terminal is present | |
let terminal:WDTerminal! = terminalsArr.first | |
// Create the instance of the Sale Request |
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
//End of SDK Setup process | |
CurrentUserCompletion setupCompletion = ^( WDMerchantUser * _Nullable currentUser, WDMerchantCashier * _Nullable cashier, NSError * _Nullable error){ | |
//Current User is returned upon successful login | |
//if the Cash Management is enabled and Cashier record exist for the current user then the Cashier is returned also | |
}; | |
// The SDK is initialized as shared instance so can be accessed | |
// from multiple View Controllers | |
WDePOS *sdk = [WDePOS sharedInstance]; |
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
// It is necessary to implement WDPaymentDelegate methods to receive events from the payment flow | |
@interface PaymentHandler : NSObject<WDPaymentDelegate> | |
@end | |
@implementation PaymentHandler | |
// The end of the payment process | |
- (void)completion:(WDSaleResponse * _Nullable)saleResponse saleResponseError:(NSError * _Nullable)saleResponseError { | |
//sale - Is the completed Sale - contains the sale status, details, results | |
//error - If any error is encountered during the sale it would be reported |
OlderNewer