For more information please see the website.
Simply add the following line to your Podfile
:
pod 'PayTabsSDKLite', '~> 4.0.10'
pod 'PayTabsSDKOCR', '~> 4.0.10'
Download SDK v4.0.10 Lite version
Download SDK v4.0.10 OCR version
Read the documentation to know how to integrate your application with the library documentation
Static framework requires at minimum deployment target 9.0.
You have to include the following dependencies in your `Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'sample-run' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for sample-run
pod 'BIObjCHelpers'
pod 'IQKeyboardManager', '~> 4.0.2'
pod 'AFNetworking', '-> 4.0.1'
pod 'Mantle'
pod 'Reachability'
pod 'Lockbox'
pod 'SBJson'
pod 'PINCache'
pod 'MBProgressHUD', '~> 1.1.0'
pod 'ActionSheetPicker-3.0'
# In case if you are using OCR version
pod 'PayCardsRecognizer'
end
You might face an issue when you try installing the sdk manualy while "ENABLE_BITCODE" flag enabled, you will have to include the following script to your Podfile
:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
config.build_settings['ENABLE_BITCODE'] = 'YES'
end
end
end
let bundle = Bundle(url: Bundle.main.url(forResource: "Resources", withExtension: "bundle")!)
self.initialSetupViewController = PTFWInitialSetupViewController.init(
bundle: bundle,
andWithViewFrame: self.view.frame,
andWithAmount: 1.0,
andWithCustomerTitle: "PayTabs Sample App",
andWithCurrencyCode: "SAR",
andWithTaxAmount: 0.0,
andWithSDKLanguage: "en",
andWithShippingAddress: "Manama",
andWithShippingCity: "Manama",
andWithShippingCountry: "BHR",
andWithShippingState: "Manama",
andWithShippingZIPCode: "123456",
andWithBillingAddress: "Manama",
andWithBillingCity: "Manama",
andWithBillingCountry: "BHR",
andWithBillingState: "Manama",
andWithBillingZIPCode: "12345",
andWithOrderID: "12345",
andWithPhoneNumber: "0097333109781",
andWithCustomerEmail: "[email protected]",
andIsTokenization: FALSE,
andIsPreAuth: FALSE,
andWithMerchantEmail: "",
andWithMerchantSecretKey: "",
andWithAssigneeCode: "SDK",
andWithThemeColor:UIColor.red,
andIsThemeColorLight: TRUE)
self.initialSetupViewController.didReceiveBackButtonCallback = {
}
self.initialSetupViewController.didStartPreparePaymentPage = {
// Start Prepare Payment Page
// Show loading indicator
}
self.initialSetupViewController.didFinishPreparePaymentPage = {
// Finish Prepare Payment Page
// Stop loading indicator
}
self.initialSetupViewController.didReceiveFinishTransactionCallback = {(responseCode, result, transactionID, tokenizedCustomerEmail, tokenizedCustomerPassword, token, transactionState) in
print("Response Code: \(responseCode)")
print("Response Result: \(result)")
// In Case you are using tokenization
print("Tokenization Cutomer Email: \(tokenizedCustomerEmail)");
print("Tokenization Customer Password: \(tokenizedCustomerPassword)");
print("TOkenization Token: \(token)");
}