You can download Swift 5 demo from here and use MFSDK.

  • Add below code in didFinishLaunchingWithOptions method
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey:     // Override point for customization after application launch.
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
       
        // Setup your My Fatoorah Merchant details
        MFSettings.shared.configure(username: "[email protected]", password: "Mf@12345678", baseURL: "https://apidemo.myfatoorah.com/")
                
        // You can change title and color of navigation bar, also title and color of dismiss button
        let them = MFTheme(navigationTintColor: .white, navigationBarTintColor: .lightGray, navigationTitle: "Payment", cancelButtonTitle: "Cancel")
        
        MFSettings.shared.setTheme(theme: them)
        
        return true
    }

MyFaoorah Visa/Mastercard direct payment

Myfatoorah SDK now support direct payment for Visa and Master card with this feature you can implement your own design for collecting card info from the user pass them to our SDK and let us do the rest for you with only 3 easy steps your payment will be done
follow this steps to know how to use it :-

1600
//1- Create invoice model like this:  

    /// - Parameters: 

    ///   - invoiceValue: Invoice amount the customer will pay 

    ///   - customerName: Your customer name  

    ///   - countryCode: Your country code  

    ///   - displayCurrency: Currency will be displayed for the user 

let invoice = MFInvoice(invoiceValue: 20, customerName: "Test", countryCode: .kuwait, displayCurrency: .Kuwaiti_Dinar_KWD) 

 
//2- Create Card model with card info you get from the user: 
 
   /// - Parameters: 

    ///   - cardExpiryMonth: Card expiry month 2 digits 

    ///   - cardExpiryYear: Card expiry year 2 digits 

    ///   - cardSecurityCode: Card security code 3 digits  

    ///   - cardNumber: Card number   

 
let card = MFCard(cardExpiryMonth: "05", cardExpiryYear: "21", cardSecurityCode: "100",cardNumber: "54123458888888889") 

 
//3- Pass them to createInvoice method and wait the response from the SDK : 
     

  /// - Parameters: 

    ///   - invoice: Invoice model 

    ///   - card: Card model 

    ///   - apiLanguage: Language you prefer for getting msg from the API 

MFPaymentRequest.shared.createInvoice(invoice: invoice, card: card, apiLanguage: .english)

*Note : to get response from the SDK you must implement this delegate like this

//MFOrder status Delegate methods  

extension ViewController : MFInvoiceCreateStatusDelegate {  

func didInvoiceCreateSucess(transaction: MFTransaction) {  

print( "Success")  

print("result: \(transaction)")  

}  

func didInvoiceCreateFail(error: MFFailResponse) {  

print("responseCode: \(error.statusCode)")  

print( "Error: \(error.errorDescription)")  

}  

func didPaymentCancel() {  

print("Error: Payment Cancelled")  

}  

}