SlideShare a Scribd company logo
Paytm Integration in Swift
This blog is about how to integrate Paytm with the iOS App.
Steps to integrate paytm via SDK
1. Import the library :
A library can be imported by two process :
a) Via pods
• Add pod 'Paytm-Payments' in the pod file.
• Run 'pod install' from terminal.
• Now open the xcworkspace
• Go to "Link Binary With Libraries" in the "Build Phases" in the project settings, and add
SystemConfiguration.framework
• Now Check if PaytmSDK.framework is added in both “Link Binary With Libraries” and
“Embedded Binaries”. If not, add by clicking on the plus icon
b) Via direct add library to the project
• Download SDK from the https://github.com/Paytm-
Payments/Paytm_iOS_App_Kit/tree/master/Swift
• Add Paytm.framework to the project
• Go to "Link Binary With Libraries" in the "Build Phases" in the project settings, and add
SystemConfiguration.framework
• Now Check if PaytmSDK.framework is added in both “Link Binary With Libraries” and
“Embedded Binaries”. If not, add by clicking on the plus icon
2. Add PaytmSDK to ViewController
import PaymentSDK
3. Generate Checksum
Checksumhash is a unique id used by the paytm to ensured that the transaction has not been
tempered. Checksumhash has been generated from serverside.
4. Start the payment process
A transaction can be done via the following process
1. Firstly choose the paytm server based on the environment. For Staging Create an instance of
the PGServerEnvironment and set the serverType to eServerTypeStaging. For
Production Create an instance of the PGServerEnvironment and set the serverType to
eServerTypeProduction.
2. Now create the PGOrder instance with all the parameters.
3. Create the PGTransactionViewController instance by calling initTransactionForOrder
and pass the instance of PGOrder as a parameter.
private func setupPaytm() {
serv = serv.createStagingEnvironment()
let type :ServerType = .eServerTypeStaging
let order = PGOrder(orderID: "", customerID: "", amount: "", eMail: "",
mobile: "")
order.params = ["MID":"rxazcv89315285234363",
"ORDER_ID":"order1",
"CUST_ID": "121",
"CHANNEL_ID":"WAP",
"INDUSTRY_TYPE_ID":"Retail",
"WEBSITE": "APP_STAGING",
"TXN_AMOUNT": "1024",
"CHECKSUMHASH":"oCDBVF+hvVb68JvzbKI40TOtcxlNjMdixi9FnRSh80Ub7XfjvgNr9NrfrOCPLmt6
5UhStCkrDnlYkclz1qE0uBMOrmuKLGlybuErulbLYSQ=",
"CALLBACK_URL" :"https://securegw-
stage.paytm.in/theia/paytmCallback?ORDER_ID=order1"]
self.txnController = self.txnController.initTransaction(for: order) as?
PGTransactionViewController
self.txnController.title = "Paytm Payments"
self.txnController.setLoggingEnabled(true)
if(type != ServerType.eServerTypeNone) {
self.txnController.serverType = type;
} else {
return
}
self.txnController.merchant =
PGMerchantConfiguration.defaultConfiguration()
self.txnController.delegate = self
self.navigationController?.pushViewController(self.txnController
, animated: true)
}
5. Implement protocol 'PGTransactionDelegate'
Implement protocol 'PGTransactionDelegate' to the viewcontroller from where have to do payment
//MARK : Delegate Methods
extension ScheduleOnOderVC : PGTransactionDelegate {
//this function triggers when transaction gets finished
func didFinishedResponse(_ controller: PGTransactionViewController, response
responseString: String) {
let msg : String = responseString
var titlemsg : String = ""
if let data = responseString.data(using: String.Encoding.utf8) {
do {
if let jsonresponse = try JSONSerialization.jsonObject(with:
data, options: .mutableContainers) as? [String:Any] , jsonresponse.count > 0{
titlemsg = jsonresponse["STATUS"] as? String ?? ""
}
} catch {
print("Something went wrong")
}
}
let actionSheetController: UIAlertController = UIAlertController(title:
titlemsg , message: msg, preferredStyle: .alert)
let cancelAction : UIAlertAction = UIAlertAction(title: "OK", style:
.cancel) {
action -> Void in
controller.navigationController?.popViewController(animated: true)
}
actionSheetController.addAction(cancelAction)
self.present(actionSheetController, animated: true, completion: nil)
}
//this function triggers when transaction gets cancelled
func didCancelTrasaction(_ controller : PGTransactionViewController) {
controller.navigationController?.popViewController(animated: true)
}
//Called when a required parameter is missing.
func errorMisssingParameter(_ controller : PGTransactionViewController,
error : NSError?) {
controller.navigationController?.popViewController(animated: true)
}
}
6. Verify checksum
Checksumhash needs to be verified so that response have not been tampered. Verification is done on
the server side.

More Related Content

What's hot

Binding components, events + data sources in HTML + JS
Binding components, events + data sources in HTML + JSBinding components, events + data sources in HTML + JS
Binding components, events + data sources in HTML + JSVladimir Dzhuvinov
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobile
GlobalLogic Ukraine
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
Knoldus Inc.
 
J query ppt
J query pptJ query ppt
J query ppt
Kavi Kumar
 
Serverless with azure functions the rebel service
Serverless with azure functions   the rebel serviceServerless with azure functions   the rebel service
Serverless with azure functions the rebel service
Christos Matskas
 
Grails66 web service
Grails66 web serviceGrails66 web service
Grails66 web service
Somkiat Puisungnoen
 
Load image of choice karan chanana
Load image of choice karan chananaLoad image of choice karan chanana
Load image of choice karan chananakaranchanan
 
01 session tracking
01   session tracking01   session tracking
01 session trackingdhrubo kayal
 
Building interactivity with websockets
Building interactivity with websocketsBuilding interactivity with websockets
Building interactivity with websockets
Wim Godden
 

What's hot (10)

Binding components, events + data sources in HTML + JS
Binding components, events + data sources in HTML + JSBinding components, events + data sources in HTML + JS
Binding components, events + data sources in HTML + JS
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobile
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
J query ppt
J query pptJ query ppt
J query ppt
 
Understanding AJAX
Understanding AJAXUnderstanding AJAX
Understanding AJAX
 
Serverless with azure functions the rebel service
Serverless with azure functions   the rebel serviceServerless with azure functions   the rebel service
Serverless with azure functions the rebel service
 
Grails66 web service
Grails66 web serviceGrails66 web service
Grails66 web service
 
Load image of choice karan chanana
Load image of choice karan chananaLoad image of choice karan chanana
Load image of choice karan chanana
 
01 session tracking
01   session tracking01   session tracking
01 session tracking
 
Building interactivity with websockets
Building interactivity with websocketsBuilding interactivity with websockets
Building interactivity with websockets
 

Similar to Paytm integration in swift

Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
Yudep Apoi
 
When Smalltalk Meets the Web
When Smalltalk Meets the WebWhen Smalltalk Meets the Web
When Smalltalk Meets the Web
ESUG
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
Erhwen Kuo
 
Micro services from scratch - Part 1
Micro services from scratch - Part 1Micro services from scratch - Part 1
Micro services from scratch - Part 1
Azrul MADISA
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
Vendic Magento, PWA & Marketing
 
How We Brought Advanced HTML5 Viewing to ADF
How We Brought Advanced HTML5 Viewing to ADFHow We Brought Advanced HTML5 Viewing to ADF
How We Brought Advanced HTML5 Viewing to ADF
SeanGraham5
 
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
MongoDB
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
Subhas Malik
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
Gaston Cruz
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
Amazon Web Services
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB
 
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB.local Atlanta: Introduction to Serverless MongoDBMongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB
 
Connect + Docker + AWS = Bitbucket Pipelines
Connect + Docker + AWS = Bitbucket PipelinesConnect + Docker + AWS = Bitbucket Pipelines
Connect + Docker + AWS = Bitbucket Pipelines
Atlassian
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
Danilo Poccia
 
Paul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & syncPaul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & sync
mdevtalk
 
Orion Context Broker
Orion Context Broker Orion Context Broker
Orion Context Broker
TIDChile
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
pavan penugonda
 
WAC Widget Upload Process
WAC Widget Upload ProcessWAC Widget Upload Process
WAC Widget Upload Process
wacapps
 
DEVNET-1120 Intercloud Fabric - AWS and Azure Account Setup and Utilization
DEVNET-1120	Intercloud Fabric - AWS and Azure Account Setup and UtilizationDEVNET-1120	Intercloud Fabric - AWS and Azure Account Setup and Utilization
DEVNET-1120 Intercloud Fabric - AWS and Azure Account Setup and Utilization
Cisco DevNet
 

Similar to Paytm integration in swift (20)

Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
 
When Smalltalk Meets the Web
When Smalltalk Meets the WebWhen Smalltalk Meets the Web
When Smalltalk Meets the Web
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
 
Micro services from scratch - Part 1
Micro services from scratch - Part 1Micro services from scratch - Part 1
Micro services from scratch - Part 1
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
 
How We Brought Advanced HTML5 Viewing to ADF
How We Brought Advanced HTML5 Viewing to ADFHow We Brought Advanced HTML5 Viewing to ADF
How We Brought Advanced HTML5 Viewing to ADF
 
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
Implementing Your Full Stack App with MongoDB Stitch (Tutorial)
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
 
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB.local Atlanta: Introduction to Serverless MongoDBMongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB.local Atlanta: Introduction to Serverless MongoDB
 
Connect + Docker + AWS = Bitbucket Pipelines
Connect + Docker + AWS = Bitbucket PipelinesConnect + Docker + AWS = Bitbucket Pipelines
Connect + Docker + AWS = Bitbucket Pipelines
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
 
Paul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & syncPaul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & sync
 
Orion Context Broker
Orion Context Broker Orion Context Broker
Orion Context Broker
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
WAC Widget Upload Process
WAC Widget Upload ProcessWAC Widget Upload Process
WAC Widget Upload Process
 
DEVNET-1120 Intercloud Fabric - AWS and Azure Account Setup and Utilization
DEVNET-1120	Intercloud Fabric - AWS and Azure Account Setup and UtilizationDEVNET-1120	Intercloud Fabric - AWS and Azure Account Setup and Utilization
DEVNET-1120 Intercloud Fabric - AWS and Azure Account Setup and Utilization
 

More from InnovationM

How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
InnovationM
 
Capture image on eye blink
Capture image on eye blinkCapture image on eye blink
Capture image on eye blink
InnovationM
 
Mob x in react
Mob x in reactMob x in react
Mob x in react
InnovationM
 
How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native apps
InnovationM
 
Android 8 behavior changes
Android 8 behavior changesAndroid 8 behavior changes
Android 8 behavior changes
InnovationM
 
Understanding of react fiber architecture
Understanding of react fiber architectureUnderstanding of react fiber architecture
Understanding of react fiber architecture
InnovationM
 
Automatic reference counting (arc) and memory management in swift
Automatic reference counting (arc) and memory management in swiftAutomatic reference counting (arc) and memory management in swift
Automatic reference counting (arc) and memory management in swift
InnovationM
 
Firebase crashlytics integration in iOS swift (dSYM File Required Problem Res...
Firebase crashlytics integration in iOS swift (dSYM File Required Problem Res...Firebase crashlytics integration in iOS swift (dSYM File Required Problem Res...
Firebase crashlytics integration in iOS swift (dSYM File Required Problem Res...
InnovationM
 
How prototype works in java script?
How prototype works in java script?How prototype works in java script?
How prototype works in java script?
InnovationM
 
React – Let’s “Hook” up
React – Let’s “Hook” upReact – Let’s “Hook” up
React – Let’s “Hook” up
InnovationM
 
Razorpay Payment Gateway Integration In iOS Swift
Razorpay Payment Gateway Integration In iOS SwiftRazorpay Payment Gateway Integration In iOS Swift
Razorpay Payment Gateway Integration In iOS Swift
InnovationM
 
Line Messaging API Integration with Spring-Boot
Line Messaging API Integration with Spring-BootLine Messaging API Integration with Spring-Boot
Line Messaging API Integration with Spring-Boot
InnovationM
 
Basic fundamental of ReactJS
Basic fundamental of ReactJSBasic fundamental of ReactJS
Basic fundamental of ReactJS
InnovationM
 
Basic Fundamental of Redux
Basic Fundamental of ReduxBasic Fundamental of Redux
Basic Fundamental of Redux
InnovationM
 
Integration of Highcharts with React ( JavaScript library )
Integration of Highcharts with React ( JavaScript library )Integration of Highcharts with React ( JavaScript library )
Integration of Highcharts with React ( JavaScript library )
InnovationM
 
Serialization & De-serialization in Java
Serialization & De-serialization in JavaSerialization & De-serialization in Java
Serialization & De-serialization in Java
InnovationM
 
Concept of Stream API Java 1.8
Concept of Stream API Java 1.8Concept of Stream API Java 1.8
Concept of Stream API Java 1.8
InnovationM
 
How to Make Each Round of Testing Count?
How to Make Each Round of Testing Count?How to Make Each Round of Testing Count?
How to Make Each Round of Testing Count?
InnovationM
 
Model View Presenter For Android
Model View Presenter For AndroidModel View Presenter For Android
Model View Presenter For Android
InnovationM
 
Retrofit Library In Android
Retrofit Library In AndroidRetrofit Library In Android
Retrofit Library In Android
InnovationM
 

More from InnovationM (20)

How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
 
Capture image on eye blink
Capture image on eye blinkCapture image on eye blink
Capture image on eye blink
 
Mob x in react
Mob x in reactMob x in react
Mob x in react
 
How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native apps
 
Android 8 behavior changes
Android 8 behavior changesAndroid 8 behavior changes
Android 8 behavior changes
 
Understanding of react fiber architecture
Understanding of react fiber architectureUnderstanding of react fiber architecture
Understanding of react fiber architecture
 
Automatic reference counting (arc) and memory management in swift
Automatic reference counting (arc) and memory management in swiftAutomatic reference counting (arc) and memory management in swift
Automatic reference counting (arc) and memory management in swift
 
Firebase crashlytics integration in iOS swift (dSYM File Required Problem Res...
Firebase crashlytics integration in iOS swift (dSYM File Required Problem Res...Firebase crashlytics integration in iOS swift (dSYM File Required Problem Res...
Firebase crashlytics integration in iOS swift (dSYM File Required Problem Res...
 
How prototype works in java script?
How prototype works in java script?How prototype works in java script?
How prototype works in java script?
 
React – Let’s “Hook” up
React – Let’s “Hook” upReact – Let’s “Hook” up
React – Let’s “Hook” up
 
Razorpay Payment Gateway Integration In iOS Swift
Razorpay Payment Gateway Integration In iOS SwiftRazorpay Payment Gateway Integration In iOS Swift
Razorpay Payment Gateway Integration In iOS Swift
 
Line Messaging API Integration with Spring-Boot
Line Messaging API Integration with Spring-BootLine Messaging API Integration with Spring-Boot
Line Messaging API Integration with Spring-Boot
 
Basic fundamental of ReactJS
Basic fundamental of ReactJSBasic fundamental of ReactJS
Basic fundamental of ReactJS
 
Basic Fundamental of Redux
Basic Fundamental of ReduxBasic Fundamental of Redux
Basic Fundamental of Redux
 
Integration of Highcharts with React ( JavaScript library )
Integration of Highcharts with React ( JavaScript library )Integration of Highcharts with React ( JavaScript library )
Integration of Highcharts with React ( JavaScript library )
 
Serialization & De-serialization in Java
Serialization & De-serialization in JavaSerialization & De-serialization in Java
Serialization & De-serialization in Java
 
Concept of Stream API Java 1.8
Concept of Stream API Java 1.8Concept of Stream API Java 1.8
Concept of Stream API Java 1.8
 
How to Make Each Round of Testing Count?
How to Make Each Round of Testing Count?How to Make Each Round of Testing Count?
How to Make Each Round of Testing Count?
 
Model View Presenter For Android
Model View Presenter For AndroidModel View Presenter For Android
Model View Presenter For Android
 
Retrofit Library In Android
Retrofit Library In AndroidRetrofit Library In Android
Retrofit Library In Android
 

Recently uploaded

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 

Recently uploaded (20)

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 

Paytm integration in swift

  • 1. Paytm Integration in Swift This blog is about how to integrate Paytm with the iOS App. Steps to integrate paytm via SDK 1. Import the library : A library can be imported by two process : a) Via pods • Add pod 'Paytm-Payments' in the pod file. • Run 'pod install' from terminal. • Now open the xcworkspace • Go to "Link Binary With Libraries" in the "Build Phases" in the project settings, and add SystemConfiguration.framework • Now Check if PaytmSDK.framework is added in both “Link Binary With Libraries” and “Embedded Binaries”. If not, add by clicking on the plus icon b) Via direct add library to the project • Download SDK from the https://github.com/Paytm- Payments/Paytm_iOS_App_Kit/tree/master/Swift • Add Paytm.framework to the project • Go to "Link Binary With Libraries" in the "Build Phases" in the project settings, and add SystemConfiguration.framework • Now Check if PaytmSDK.framework is added in both “Link Binary With Libraries” and “Embedded Binaries”. If not, add by clicking on the plus icon
  • 2. 2. Add PaytmSDK to ViewController import PaymentSDK 3. Generate Checksum Checksumhash is a unique id used by the paytm to ensured that the transaction has not been tempered. Checksumhash has been generated from serverside. 4. Start the payment process A transaction can be done via the following process 1. Firstly choose the paytm server based on the environment. For Staging Create an instance of the PGServerEnvironment and set the serverType to eServerTypeStaging. For Production Create an instance of the PGServerEnvironment and set the serverType to
  • 3. eServerTypeProduction. 2. Now create the PGOrder instance with all the parameters. 3. Create the PGTransactionViewController instance by calling initTransactionForOrder and pass the instance of PGOrder as a parameter. private func setupPaytm() { serv = serv.createStagingEnvironment() let type :ServerType = .eServerTypeStaging let order = PGOrder(orderID: "", customerID: "", amount: "", eMail: "", mobile: "") order.params = ["MID":"rxazcv89315285234363", "ORDER_ID":"order1", "CUST_ID": "121", "CHANNEL_ID":"WAP", "INDUSTRY_TYPE_ID":"Retail", "WEBSITE": "APP_STAGING", "TXN_AMOUNT": "1024", "CHECKSUMHASH":"oCDBVF+hvVb68JvzbKI40TOtcxlNjMdixi9FnRSh80Ub7XfjvgNr9NrfrOCPLmt6 5UhStCkrDnlYkclz1qE0uBMOrmuKLGlybuErulbLYSQ=", "CALLBACK_URL" :"https://securegw- stage.paytm.in/theia/paytmCallback?ORDER_ID=order1"] self.txnController = self.txnController.initTransaction(for: order) as? PGTransactionViewController self.txnController.title = "Paytm Payments" self.txnController.setLoggingEnabled(true) if(type != ServerType.eServerTypeNone) { self.txnController.serverType = type; } else { return } self.txnController.merchant = PGMerchantConfiguration.defaultConfiguration() self.txnController.delegate = self self.navigationController?.pushViewController(self.txnController , animated: true) } 5. Implement protocol 'PGTransactionDelegate' Implement protocol 'PGTransactionDelegate' to the viewcontroller from where have to do payment //MARK : Delegate Methods extension ScheduleOnOderVC : PGTransactionDelegate { //this function triggers when transaction gets finished func didFinishedResponse(_ controller: PGTransactionViewController, response responseString: String) { let msg : String = responseString var titlemsg : String = "" if let data = responseString.data(using: String.Encoding.utf8) { do { if let jsonresponse = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String:Any] , jsonresponse.count > 0{
  • 4. titlemsg = jsonresponse["STATUS"] as? String ?? "" } } catch { print("Something went wrong") } } let actionSheetController: UIAlertController = UIAlertController(title: titlemsg , message: msg, preferredStyle: .alert) let cancelAction : UIAlertAction = UIAlertAction(title: "OK", style: .cancel) { action -> Void in controller.navigationController?.popViewController(animated: true) } actionSheetController.addAction(cancelAction) self.present(actionSheetController, animated: true, completion: nil) } //this function triggers when transaction gets cancelled func didCancelTrasaction(_ controller : PGTransactionViewController) { controller.navigationController?.popViewController(animated: true) } //Called when a required parameter is missing. func errorMisssingParameter(_ controller : PGTransactionViewController, error : NSError?) { controller.navigationController?.popViewController(animated: true) } } 6. Verify checksum Checksumhash needs to be verified so that response have not been tampered. Verification is done on the server side.