简体   繁体   中英

How to integrate Paytm payment gateway in iOS(swift) project? Unable to create object of PGMerchantConfiguration

I am trying to integrate Paytm payment gateway in iOS(swift) project. I added pods as per steps mentioned on " https://github.com/Paytm-Payments/Paytm_iOS_App_Kit "

Step 0: is done

Now next step is :


Step 1: Merchant configuration

SDK identifies each Merchant by PGMerchantConfiguration object. You can configure this anywhere in the code before the first transaction with necessary parameters. It requires only one time configuration. Since it is singleton Class, you may utilize the same for any transaction within your application.

Objective – C

//You will get default PGMerchantConfiguration object. By setting the below properties of object you can make a fully configured merchant object.

PGMerchantConfiguration *mc = [PGMerchantConfiguration defaultConfiguration];

However I am not getting what should I do as when I am trying to create object in swift like :

let obj = PGMerchantConfiguration()

I am unable to find "PGMerchantConfiguration"

Is there anything I am missing? Do I need to create Bridging Header file ?(if yes then how to do it) If anyone knows any link for integrating Paytm Payment gateway in iOS (swift) where step by step work instruction is given then please share, I have done so much digging but unable to find any.

Thank you in advance!

Yes, you will need to set the bridging header for it. then you can invoke your object like this:

 var merchantConf = PGMerchantConfiguration.default()

Let's go step by step:

1) Download Library from Github

2) Create a bridging header.h as follows:

在此处输入图片说明

在此处输入图片说明

3) Now in project Target, set bridging header to header.h

在此处输入图片说明

4) Drag and drop the contents of Paytm Sdk folder

在此处输入图片说明

5) Your header file should look like

在此处输入图片说明

Following all of the above steps, now you can create an Object

  var merchantConf = PGMerchantConfiguration.default()

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM