Giter VIP home page Giter VIP logo

paytabs-ios-library-sample's Introduction

Paytabs iOS SDK Samples

Paytabs-ios-library-v4.0.8 xcode-v10.1

For more information please see the website.

Installation

CocoaPods

Simply add the following line to your Podfile:

PayTabs Lite

pod 'PayTabsSDKLite', '~> 4.0.10'

PayTabs OCR

pod 'PayTabsSDKOCR', '~> 4.0.10'

Manual

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

Usage

Pay now

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)");
}

Paytabs

Support | Terms of Use | Privacy Policy

paytabs-ios-library-sample's People

Contributors

humayun-paytabs avatar muhamedadly avatar ihammys avatar wajihkm avatar cogtea avatar ahmed-mahdi-pt avatar adlypaytabs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.