简体   繁体   English

如何在iOS(swift)项目中集成Paytm支付网关? 无法创建PGMerchantConfiguration的对象

[英]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. 我正在尝试将Paytm付款网关集成到iOS(swift)项目中。 I added pods as per steps mentioned on " https://github.com/Paytm-Payments/Paytm_iOS_App_Kit " 我按照“ https://github.com/Paytm-Payments/Paytm_iOS_App_Kit ”中提到的步骤添加了广告连播

Step 0: is done 步骤0:完成

Now next step is : 现在下一步是:


Step 1: Merchant configuration 步骤1:商家设定

SDK identifies each Merchant by PGMerchantConfiguration object. SDK通过PGMerchantConfiguration对象识别每个商家。 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. //您将获得默认的PGMerchantConfiguration对象。 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" 我找不到“ 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. 我是否需要创建桥接头文件?(如果是,那么该怎么做)如果有人知道在iOS(swift)中集成Paytm Payment网关的任何链接,其中给出了分步工作说明,那么请分享,我已经做了很多挖掘但找不到任何东西。

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 1)从Github下载库

2) Create a bridging header.h as follows: 2)创建桥接header.h,如下所示:

在此处输入图片说明

在此处输入图片说明

3) Now in project Target, set bridging header to header.h 3)现在在项目Target中,将桥接头设置为header.h

在此处输入图片说明

4) Drag and drop the contents of Paytm Sdk folder 4)拖放Paytm Sdk文件夹的内容

在此处输入图片说明

5) Your header file should look like 5)您的头文件应该看起来像

在此处输入图片说明

Following all of the above steps, now you can create an Object 按照上述所有步骤,现在您可以创建一个对象

  var merchantConf = PGMerchantConfiguration.default()

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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