Read More

PayTabs Payment Gateway Integration in Swift

Hi guys , today we will learn about how to implement PayTabs payment gateway in iOS application.

You can read their integration guide https://www.paytabs.com/PayTabs_iOS_SDK_V2.0.pdf

Before starting to code first we need to know what a payment gateway is

payment gateway is a merchant service provided by an e-commerce application service provider that authorises credit card or direct payments processing for e-businesses, online retailers, bricks and clicks, or traditional brick and mortar.

Thus , its enough for us now. Lets start by following the instructions below.

  1. Download the PayTabs iOS SDK  https://www.dropbox.com/s/40jjk40dmnfz79j/PayTabs_Objective%20c.zip?dl=0
  2. Copy or drag drop all the content inside Demo Merchants folder into your project.
  3. Create bridging header or XCode will automatically create it for you when you drag drop content inside Demo Merchants/headerfiles.
  4. Inside the bridging header.h file paste #import “PayTabCardReaderViewController.h”.
  5. Now into you Payment ViewController create an object of PayTabCardReaderViewController like this.

6. Now paste this code inside your payment class

7. Call the function callPaytabPaymentGateway()  into the action of your payment button.

8. After the successful or unsuccessful transaction PayTabs stores the transaction id and response code into your UserDefaults. To check the                         payment status call checkPaymentStatus() function into your payment ViewController’s viewWillAppear function.

9. Finally You have successfully implemented the PayTabs Payment Gateway in your iOS application.

Note:-

  1. PayTabs SDK does’t support XCode simulator.
  2. You need to disable bitcode from build settings of your project target .

 

 

   

 

. . .

Comment (1)

Add Your Comment

  • Akash
    i have error when i create object of PayTabCardReaderViewController() this controller.
    Error :
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close