iPaySDK 0.9.0

iPaySDK 0.9.0

G M Tasnim Alam 维护。



iPaySDK 0.9.0

  • Tasnim Alam Shovon

iPaySDK

Version License Platform

示例

要运行示例项目,请先克隆仓库,然后从 Example 目录运行 pod install

要求

  • iOS 9.3 及以上版本

安装

iPaySDK 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中

pod 'iPaySDK'

先决条件

iPaySDK 要求商家从 iPay 获取 client_id。如果您的 client_idxyz,则需要将以下 URL 添加到 info.plist 中的 URL 类型

	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>None</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>ipayxyz</string>
			</array>
		</dict>
	</array>

如何使用

配置和初始化设置

iPaySDK.shared.environment = .Development //Use this for Development environment
iPaySDK.shared.configure(withClientId: "xyz")
iPaySDK.shared.delegate = self

启动会话

iPaySDK.shared.userInitiateSession()

添加URL处理器

将此代码放在AppDelegate中

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    return iPaySDK.shared.handleUrl(url: url)
}

获取余额

iPaySDK.shared.getBalance { (balance) in
   DispatchQueue.main.async {
       print(balance)
   }
}

进行支付

iPaySDK.shared.makePayment(amount: 10)

检查SDK是否已连接

if iPaySDK.shared.isAuthenticated {
    //Write your code here     
}

SDK代理:使用这些代理处理回调并显示适当的结果,以提高用户体验。

func oauthDidSuccess()
func oauthDidFail()
    
func paymentDidSuccess()
func paymentDidFail()

作者

塔斯尼姆·阿拉姆·肖夫恩,[email.bd1c2c3fde39cb3ada4d4d9c9c4c397d4d9b9](http://www.researchgate.net/profile/Tasnim-Alam-Shovon)

许可协议

iPaySDK遵循Apache-2.0许可协议。更多信息请参阅LICENSE文件。