bSecure is a universal checkout made for the Pakistan market that is easy & simple to install on any iOS app. It gives you an option to enable one-step check out and accept multiple payment method for your customers, as well as run your business hassle free\n. By following a few simple steps, you can be up and running in no time. Leave the rest to us. We will take care of the login, address, shipping methods and payments on your behalf. All you have to do is configure your checkout once on the bSecure Partner portal once and leave the rest to us.
The bSecure iOS SDK requires Xcode 11.0 with Swift 5 or later and is compatible with apps targeting iOS 11 or above.
By following a few simple steps, you can set up your bSecure Checkout and Single-Sign-On.
- Go to Partners Portal
- App Integration >> Sandbox / Live
- Select Environment Type (Custom Integration)
- Fill following fields:
a. Store URL its required in any case
b. Login Redirect URL Required for feature Login with bSecure
c. Checkout Redirect URL Required for feature Pay with bSecure
d. Checkout Order Status webhook Required for feature Pay with bSecure - Save your client credentials (Client ID and Client Secret)
- Please make sure to keep credentials at safe place in your code
- Add
pod 'BSecureCheckout
in your podfile and runpod install
. - Once your user is ready for checkout (presses the checkout with bSecure button) call your custom integration bSecure create order API-request.
- In the response of this api, you will get the
order_reference
number,order_refe
which is required to launch the SDK. - Once you have acquired a order reference number you can call
BSecureManager.shared.initialize(viewController: UIViewController, orderCheckoutURL: String, orderReference: String, redirectURL: String, delegate: BSecureManagerDelegate)
UIViewController
- make sure you are calling this function on aUIViewController
and not anyother like UINavigation or Tabbar Controller. All others will not allow SDK to start because of theprecondition
.orderCheckoutURL
- this is the checkout URL which will initiate the SDK.redirectURL
- this is the riderect URL which is used to compare URL domain and exit SDK.orderReference
- this is the order reference String obtained when you hit create order on bSecure Server.BSecureCheckout.BSecureManagerDelegate
- confirm to this delegate to catch when the SDK opens and closes and also to montior any abrupt crashes or errors.
After successful payment you can call you custom integration bSecure Order detail API to show order details if you require.