PayApiSDK 1.0.0

PayApiSDK 1.0.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最新发布2016年10月
SwiftSwift 版本3.0
SPM支持 SPM

Payapi 维护。



PayApiSDK 1.0.0

  • 编写者
  • PayApi

iOS 的 PayApi SDK

PayApi 安全单的实现,使用 Swift 语言。

内容

包括适用于任何 iOS 应用程序的方便易用的 PayApi SDK,与 Swift 一起工作。为了使用 SDK,请注册一个免费的 PayApi 用户帐户

安装

CocoaPods 是推荐的安装方法。

pod 'PayApiSDK'

用法

import PayApiSDK

初始化

使用您的凭证(公钥和 PayApi 密钥)初始化 SDK

let secureForm = SecureForm(publicId: "SHOP_PUBLIC_ID", apiKey: "PROVIDED_API_KEY")

构建产品数据字典

let productData: [String: Any] = [
  "order": [
    "sumInCentsIncVat": 122,
    "sumInCentsExcVat": 100,
    "vatInCents": 22,
    "currency": "EUR",
    "referenceId": "ref123"
  ],
  "products": [
    [
      "quantity": 1,
      "title": "Black bling cap",
      "priceInCentsIncVat": 122,
      "priceInCentsExcVat": 100,
      "vatInCents": 22,
      "vatPercentage": 22
    ]
  ],
  "consumer": [
    "email": "[email protected]"
  ]
]

给按钮添加功能

在任何 UIButton TouchUpInside 事件上打开安全表单的方法

secureForm.addSecureFormToButton(button: myButton, message: productData)

有疑问吗?

如有任何疑问,请联系 [email protected]