Scaffolding Provided



This repository provides the following components that are common to our open source projects:


  • FastpayMerchantSDK.framework.zip
  • FastPaySDKDocumentation.pdf
  • Download SDK

Get Started



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


Implementation



Import FastpayMerchantSDK in your class


1
import FastpayMerchantSDK

Make your class conform to FastPayDelegate delegate


1
class ViewController: UIViewController, FastPayDelegate {

Initialize the instance of FastPay


1
let testObj = Fastpay(storeId: "*****", storePassword: "****", orderId: "*****", amount: 500, currency: .IQD)

Set your class as delegate for FastPayDelegate


1
testObj.delegate = self

Parameters to pass when initiating


1
2
3
4
5
6
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.

1
Fastpay(storeId: "*****", storePassword: "****", orderId: "*****", amount: 500, currency: .IQD)

Implement FastPaySDK delegate method to get transaction result


For Success Case


1
func fastpayTransactionSucceeded(with transaction: FPTransaction) {}: 500, currency: .IQD)

You will get the following data from transaction object in the delegate function


1
2
3
4
5
6
7
8
transactionId: String? orderId: String? amount: Int? currency: FPCurrency? customerMobileNo: String? customerName: String? status: String? transactionTime: String?

Sample Test Code


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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