Foloosi
Search…
⌃K
Links

Initiate Payment

This Section briefs about how to initiate a payment !
Foloosi's iOS SDK provides easy payment collections.
You can use it on the front-end to open payment page or use the actual flow to create Payment Token.

Step - 1 - Add Dependency

pod 'Foloosi-iOS-SDK', '~> 1.4.9'
pod update

Step - 2 - Import SDK

import FoloosiSdk

Step - 3 - Initialize SDK

To initialize the SDK - Create InitData Object with the merchant key you retrieved from foloosi merchant panel. If you do not have a merchant key create a new one and customize the checkout page to your liking.
1
let initData = InitData()
2
initData.merchantKey = "merchantKey" //"Your Unique Merchant Key"
3
initData.customColor = "costomColor" // It must be valid 6 digit hexadecimal color to make payment page loading color as app color.
4
FoloosiPay.initSDK(initData: initData, withDelegate: self)
Important Note
You can Follow any one of the methods below to initiate payment widget

a. Make Payment with order object

Create orderData Object with necessary inputs

You can create the order data or payment input with our OrderData Model class. Here you need to provide order id, title, description, currency code, order amount and customer details like name, email and mobile number.
1
let orderData = OrderData()
2
orderData.orderTitle = "" // Any Title
3
orderData.currencyCode = "" // 3 digit currency code like "AED"
4
orderData.orderAmount = 0 // in double format ##,###.##
5
orderData.orderId = "" // unique order id.
6
orderData.orderDescription = "" // any description.
7
orderData.postalCode = "00000"
8
orderData.state = "Dubai"
9
orderData.country = "UAE"
10
orderData.customerUniqueReference = "" //Customer Unique Reference value should be email/mobile no/uniqueCustomer id from your DB
11
let customer = Customer()
12
customer.customerEmail = "[email protected]"
13
customer.customerName = "name"
14
customer.customerCity = "City"
15
customer.customerAddress = "Address"
16
customer.customerPhoneNumber = "1234567890"
17
orderData.customer = customer

*Important Note*

orderData.customerUniqueReference = "Unique value"
// Unique value must be customer id/email/mobile number for saved card feature.
Now make payment with order data you created above.
FoloosiPay.makePayment(orderData);

b.Make Payment with reference token

Initialize api

post
https://api.foloosi.com/aggregatorapi/web/initialize-setup
Get Reference Token
Make the payment with the order reference token
var referenceToken = "Your Reference Token"
FoloosiPay.makePaymentWithReferenceToken(referenceToken)

Api Specification

  • Request call must be on POST.
  • This Api will be used to confirm the feature you are about to Use.
  • For Saved Card Payment Method, You need to pass your customer unique details like email,etc. to customer_unique_identifier.
Post Request Body
customer_unique_identifier
  1. 1.
    This is mandatory when you are using saved card payment.
  2. 2.
    This data must be Unique like email id,customer id, etc.,

Support

Visit https://www.foloosi.com for support requests or email to [email protected]

Developed by

Foloosi Technologies Pvt Ltd.

License

Copyrights (c) 2022 Foloosi