source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/visa/mpos.sdk.ios.pods.git' use_frameworks! target :"your-app-target>" do pod 'payworks', '' pod 'payworks.paybutton', '' end
import UIKit import mpos_core class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. payworksExample() } 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 print(transactionProcessDetails.information[0]) print(transactionProcessDetails.information[1]) // do something } actionRequired: { (transactionProcess, transaction, transactionAction, transactionActionSupport) in // do something } completed: { (transactionProcess, transaction, transactionProcessDetails) in // do something } } }