This repository provides the following components that are common to our open source projects:
Drag and drop the framework file in your project. Check ‘Copy items if needed’ and select your target.
After successfully adding the framework file in your project, select project file from Xcode’s Project Navigator and follow the selections below:
Target → General → Framework, Libraries and Embedded Content and then select Embed & Sign for the added framework as shown below
Import FastpayMerchantSDK in your class
import FastpayMerchantSDK
Make your class conform to FastPayDelegate delegate
class ViewController: UIViewController, FastPayDelegate {
Initialize the instance of FastPay
let testObj = Fastpay(storeId: "*****", storePassword: "****", orderId: "*****", amount: 500, currency: .IQD)
Set your class as delegate for FastPayDelegate
testObj.delegate = self
Parameters to pass when initiating
start(in: ….) → your view controller class that you want the SDK to present on
storeId → Merchant’s provided store ID.
storePassword → Merchant’s provided store password.
orderId → Merchant’s provided order ID.
amount → Payable amount in the transaction.
currency → In which currency order will perform.
Fastpay(storeId: "*****", storePassword: "****", orderId: "*****", amount: 500, currency: .IQD)
Implement FastPaySDK delegate method to get transaction result
For Success Case
func fastpayTransactionSucceeded(with transaction: FPTransaction) {}: 500, currency: .IQD)
You will get the following data from transaction object in the delegate function
transactionId: String?
orderId: String?
amount: Int?
currency: FPCurrency?
customerMobileNo: String?
customerName: String?
status: String?
transactionTime: String?
class ViewController: UIViewController, FastPayDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func showAction(_ sender: UIButton){
callSDK()
}
func callSDK(){
let testObj = Fastpay(storeId: "1953_693", storePassword: "Password100@", orderId: "order240", amount: 500, currency: .IQD)
testObj.delegate = self
testObj.start(in: self, for: .Sandbox)
}
func fastpayTransactionSucceeded(with transaction: FPTransaction) {
if let transactionId = transaction.transactionId, let orderID = transaction.orderId, let billAmount = transaction.amount, let currency = transaction.currency, let customerMobileNo = transaction.customerMobileNo, let name = transaction.customerName, let status = transaction.status, let transactionTime = transaction.transactionTime{
print("Transaction ID : (transactionId)")
print("Order ID : (orderID)")
print("Amount : (orderID)")
print("Bill Amount : (billAmount)")
print("Currency : (currency)")
print("Mobile Number : (customerMobileNo)")
print("Name : (name)")
print("Status : (status)")
print("Transaction Time : (transactionTime)")
}
}
func fastpayTransactionFailed(with orderId: String) {
print("Failed Order ID: (orderId)")
}
}
© 2025 FastPay, all right reserved