CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

PayApiSDK 1.0.0

PayApiSDK 1.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2016
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Payapi.



PayApiSDK 1.0.0

  • By
  • PayApi

PayApi SDK for iOS

Swift implementation of PayApi Secure Form.

Contents

Includes an easy-to-use PayApi SDK for any iOS application, working with Swift. In order to use the SDK, please register for a free PayApi user account

Installation

CocoaPods is the recommended installation method.

pod 'PayApiSDK'

Usage

import PayApiSDK

Initialization

Initialize SDK with your credentials (Public Id and PayApi key)

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

Building a product data dictionary

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]"
  ]
]

Adding functionality to a button

Method to open the Secure Form on any UIButton TouchUpInside event

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

Questions?

Please contact [email protected] for any questions.