Skip to content

payapi/payapi-sdk-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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": "support@payapi.io"
  ]
]

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 support@payapi.io for any questions.

About

PayApi SDK for iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published