Read now

Tap Payment Gateway Integration In Swift With SDK

Hi guys, today we will learn about how to implement Tap Payment Gateway for an iOS application in Swift.

Let us know first what is the Payment gateway.

A payment gateway bridges the gap between customers, banks and online business. It safely and securely passes all the sensitive information such as customer’s credit card numbers and so on, from one end to the other. It is used for online transactions with the customer. It is a merchant service provided by an e-commerce application service provider that authorizes credit card or direct payments processing for e-businesses, online retailers, bricks and clicks, or traditional brick and mortar.

Now we can start the steps to integrate the payment gateway.

Step to Integrate Tap Payment Gateway

Step 1 => Add ‘goSellSdk’ in the project

To integrate goSellSDK into your Xcode project using CocoaPods, specify it in your Podfile:

and then run this command in the terminal

Step 2 => Setup of SDK

To set it up, add the following line of code somewhere in your project and make sure it will be called before any usage of goSellSDK, otherwise, an exception will be thrown.

Step 3 => Setup of Play Button

a) Using StoryBoard

  1. Drag & drop an instance of UIView at the desired location.
  2. Select added view and open Identity Inspector
  3. Enter the following values:
    1. Class: PayButton
    2. Module: goSellSDK

 

b) Using code

Step 4 => Implementing SessionDataSource and  SessionDelegate

You have to implement SessionDataSource and  SessionDelegate in the viewController where you have set up the Play button. Create an extension of the controller and add this code.

Step 5=> Handle payment success and failure

You can handle payment success and failure by adding paymentSucceed method and paymentFailed method.

Step 6 => Handle Session

You can handle Session  by adding sessionHasStarted, sessionCancelled and sessionHasFailedToStart method.

Step 7 => Final Step

In viewDidload add the following code and callupdatePayButtonAmount and setData method

 

Note:-

(i)You can test the payment gateway using the Test key and Test card Number which you can get from below URL.

https://tappayments.api-docs.io/2.0/testing/test-api-keys 

(ii) You have to also register the bundle identifier with the Tap support team.

Conclusion

So please follow the above step to integrate the Tap payment gateway and if you have any issue or suggestion you can leave your query/suggestion in the comment section.

. . .

Comments (2)

Add Your Comment

  • anand
    how to configure button action to it and I’m not able to display the text in button-like KWD 10.000

    i followed your steps and while clicking button nothing happens

    • Vicky Kumar
      In viewDidload method you have to call updatePlayButtonAmount() and setData() method. You have to follow the final step (Step 7).
  • 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