Razorpay Payment Gateway Integration in Swift with Standard SDK

Updated 1 July 2020


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

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 authorizes card or direct payments processing for e-businesses, online retailers, bricks, and clicks, or traditional brick and mortar.

Note: They have moved their SDK to Swift framework. Razorpay Payment Gateway framework only supports iOS version 10.0 and later. Public contracts have not been changed. They have ensured that everyone would not have to change anything in his code when he move from Objective-C library to our new Swift framework.

Thus, it’s enough for us now. Let’s start by following the instructions below.


Step 1 – Import the Razorpay iOS Standard SDK Library

1.) Download the SDK and unzip it.

SDK Link->

2.) Open your project in XCode and go to file under Menu. Select Add files to “yourproject”.

3.) Select Razorpay.framework in the directory you just unzipped.

4.) Select the Copy items if needed check-box.

5.) Click Add.

6.) Navigate to Target settings > General and add the Razorpay.framework in both Embedded Binaries and Linked Frameworks and Libraries.

Step 2 – Initialize the Razorpay iOS Standard SDK

To initialize the Razorpay iOS Standard SDK, you need the following :

Step 3 – Pass Payment Options and Display Checkout Form

Add the following code to your ViewController or wherever you want to initialize payments:

Step 4 – Handle Success and Errors Events

You can handle success or error events when a payment is completed by implementing onPaymentSuccess and onPaymentError methods of the RazorpayPaymentCompletionProtocol.

Step 5 – Insert the Following XML Source Code Snippet Into the Body of Your Info.Plist File Just Before the Final.



So please follow the above step and and if you have any issue or suggestion you can leave your query/suggestion in the comment section I will try to solve that.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.

Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home