Can I integrate the mPOS SDK in a Swift App?

Yes, you can work with the mPOS SDK entirely in Swift.

To install it, add the following command in your podfile and run pod install

Remember to update the SDK to the latest released version. You also need to use Xcode 12 and an iOS project targeting iOS 13 or above.

source ''
source ''

target :"<your-app-target>" do
    pod 'payworks',           ''
    pod 'payworks.paybutton', ''

Once cocoapods are installed, Swift will work out of the box. You just need to import the module of Payworks library and all Api's will be available. A normal view controller should look like this:

import UIKit
import mpos_core

class ViewController: UIViewController {

    override func viewDidLoad() {
        // Do any additional setup after loading the view.
    func payworksExample() {
        let transactionProvider = MPMpos.transactionProvider(for: .TEST, merchantIdentifier: "test", merchantSecretKey: "test")
        let transactionParameters = MPTransactionParameters.charge(withAmount: NSDecimalNumber(string: "10"), currency: .GBP) { (optionals) in
            // optionals
        let accessory = MPAccessoryParameters.mock()
        let _ = transactionProvider.startTransaction(with: transactionParameters, accessoryParameters: accessory, processParameters: nil) { (transactionProcess, transaction) in
            // do something
        } statusChanged: { (transactionProcess, transaction, transactionProcessDetails) in
            // do something
        } actionRequired: { (transactionProcess, transaction, transactionAction, transactionActionSupport) in
            // do something
        } completed: { (transactionProcess, transaction,
                        transactionProcessDetails) in
            // do something



Can we help you?

If you cannot find your answer, contact us and we'll get in touch with you soon.