OlaMoney
Last updated
Was this helpful?
Last updated
Was this helpful?
PayU's Ola Money SDK is an iOS framework for integrating Ola Money Postpaid + Wallet in your app in an easy, efficient and stable way.
PayU provides SDK that perform different functions related to Ola Money Payments
PayUOlaMoneySDK: The PayUOlaMoneySDK framework give access to the APIs, Error Codes, Request builder etc. needed to integrate with PayU for OlaMoney Postpaid+Wallet.
The recommended way to included the PayUOlaMoneySDK in your iOS app is through Cocoapods. To include the framework in your Xcode project, add following line to your Podfile
For Swift 5.1
For Swift 5.1.3
If you do not want to use Cocoapods, you can download the framework manually and integrate it in your mobile app. To integrate manually, please follow the steps below:
Download the framework files from here -
Link the framework from your Xcode project
The PayUOlaMoneySDK framework requires the following dependencies. When integrating through Cocoapods, these dependencies are added automatically and you do not need to take any additional action.
PayU Networking: This is used by PayUOlaMoneySDK to handle network requests.
PayU Logger: This is used by PayUOlaMoneySDK to log errors and verbose data.
Set environment to test or production
Set Logger level to verbose, error or disabled
Set mandatory payment parameters required for the payment
Fetch hashes and save them in paymentParams
object
You need to set hashes
property in paymentParams
. Hashes ensure that requests are untampered. This helps in ensure security of the transaction. Property hashes
is of type PayUOMHashes
PayUHashes
has 2 properties. Each of these 3 is used for a distinct API call. These 3 properties are defined below:
paymentHash
: This is required to create transaction at PayU's end.
eligibilityHash
: This is required by checkEligibility API to check eligibility if use is eligible/registered for the Ola Money
You need to provide hashes before asking SDK to initiate the payment and check the user's eligibility. Hashes must be generated only on your server. Your secret key (also known as salt) must never be included in your app.
See page 10 & 11 for formula of generating paymentHash
.
See page 36 for formula of generating paymentRelatedDetailsForMobileSDKHash
& validateVPAHash
Command and var1 values for generating paymentRelatedDetailsForMobileSDKHash
& validateVPAHash
are given below
Hash for param
Command
var1
eligibilityHash
get_eligible_payment_options
{\"amount\":\"1\",\"txnid\":\""+txid+"\",\"mobile_number\":\"12345678\",\"first_name\":\"John\",\"bankCode\":\"OLAM\",\"email\":\"john.smith@gmail.com\",\"last_name\":\"Smith\"}
After setting value of hashes in paymentParams
, call following method of class PayUOMCore
to check whether the user is eligible to pay through Ola Money (Postpaid + Wallet) :
You will get a response of type Result
with the value of type PayUOMEligibilityModel
in response's success param. Sample code shown below
With the PayUOMEligibilityModel
object received above, you can populate relevant options on your checkout screen.
After checking the eligibilty, we can fetch the post params with the method. And can use the Custom Browser or WKWebView to load the URL and PostData
If you are integrating with the PayUOlaMoneySDK manually, you will need to include the dependencies mentioned below. To include the frameworks manually please follow the link -
Please view to generate hashes on your server.
(Optional) Use the to load data using following code.