payUmoney Payment Gateway Integration in iOS App (Objective C)
We have many Payment Gateways available such as Paypal, CCAvenue, Zaakpay, etc.
payUmoney is the best Payment Gateway available in India now; according to me.
I am saying this with my personal experience with payUmoney Technical Support Team.
They offer 2.9% Transaction charges without any Enrolment, Setup, AMC or other Hidden charges.
payUmoney Home Page Link: Home_Page
payUmoney Contact Details:
Address:
5th Floor, Pearl Towers Plot 51, Sector 32 Gurgaon, 122002
Phone:
0124-6624956,
0124-6624970
Email:
techsupport@payumoney.com
Steps to integrate payUmoney gateway:
1. Create a new iOS Objective C app in XCode.
2. Open Main.storyboard in you app.
3. Add UIWebView and set its Delegate. [Screenshot 1]
4. Set Frames & Constraints as per design requirements.
5. Link UIWebView by creating IBOutlet to either .h or .m file. [Screenshot 2]
6. Signup and create an account on payUmoney. Test Envirnment: http://test.payumoney.com/ or Production Environment: https://www.payumoney.com/
7. Follow below mentioned procedure to complete the registration process:
Test Environment:
Recently, payUmoney has done some modifications in test environment due to which test key-JBZaLc and salt-GQs7yium will not work anymore.
In order to test the gateway using a test key and salt, kindly follow these steps:
1 - Go on http://test.payumoney.com/
2 - Sign up as a merchant - use any of your valid email ids - kindly do not use a random email id.
3 - Use a valid Mobile Number and for Phone/Landline No use your valid mobile number with a preceeding 0. (e.g. Mobile No: 9762159571 so the Landline No: 09762159571)
4 - Complete the "Business Details" - you may use PAN no. ABCDE1234F and DOB - 01/04/1990
5 - Complete "Bank Account Details" (You may use IFSC- ALLA0212632)
6 - Please leave the bank verification part.
7 - Go to below mentioned location to get the Test Merchant Id :
Seller Dashboard -> Settings -> My account -> Profile Settings
Once you provide your test merchant id, payUmoney will approve it so that you can find your test key and salt at :
Seller Dashboard -> Settings -> My account -> Merchant Key - Salt
Production Environment:
kindly register to https://www.payumoney.com/ and follow above steps with all your Genuine Bank details, contact numbers & adresses.
Please note that the Key and Salt for Production server are different from the one we get from Test server.
8. payUmoney requires some mandatory fields to make a web-call:
txnid, key, amount, productinfo, firstname, email, phone, surl, furl, hash, service_provider.
9. We have to create a Transaction ID which must be unique SHA512 encrypted value.
10. Take all values from user except txnid, key, surl, furl, hash & service_provider.
11. Create a NSString by appending all the values in sequence as below:
NSString *hashValue = [NSString stringWithFormat:@"%@|%@|%@|%@|%@|%@|||||||||||%@",key,txnid1,amount,productInfo,firstname,email,Salt];
12. Use SHA512 encryption to hash the hashValue.
13. Create a NSDictionary of with all the values we have.
14. Make a POST type NSMutableURLRequest and pass the required parameters.
15. Load the NSMutableURLRequest to WebView and we are done.
Download code from Github Repo: Code
Special Thanks to:
Stackoverflow_Link
payUmoney_Link
Thank you so much for sharing this post with us. Can your provide more information about other mobile payment gateway service providers in India. What are their services and fee structure???
ReplyDeleteHere you can find some information regarding other payment gateways:
Deletehttp://techwelkin.com/best-payment-gateways-india-no-setup-fee
http://www.nextbigwhat.com/comparison-payment-gateways-in-india-2014-edition-297/
http://www.raywenderlich.com/87300/apple-pay-tutorial
hi presently
ReplyDeletehttps://test.payu.in/ is not working it is throwing this error
Page Not Found! Please check the url.
Error: 404.
how can i check this
Can you check whether you have missed any step or using any wrong url, merchant id, etc.
Delete
ReplyDeletenice blogs.
Friend chatMake new friend’s without revealing yourself. Dial 543216 at Rs 2/min and monthly subscription of Rs 30/ 30 days.
We have design bitcoin payment gateway integration for merchants who intend to integrate payment system in their project and receive payment through bitcoins. The main objective is to handle transactions. If you need any help visit us at: http://www.cryptextechnologies.com/
ReplyDeleteIs there any way to integrate this sdk into swift project?
ReplyDeleteWe can integrate Objective C code in a Swift Project and vice-versa.
DeleteBelow are few links to achieve the same:
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html
http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift
http://www.theappguruz.com/blog/integrate-objective-c-file-swift
nice blog...
ReplyDeleteI want to know, user sign in to his payU money account for payment once... If he wants to make another payment, is it compulsory to login again..?
can we track this to do only once?
For this you need to talk to the payumoney technical team. Cause signing in each time is meant for the Security purpose of the user's account, which authenticates each time and allows you to make the payments once authorized.
Deletehey thanks for the code. In my app if payment is successfull then only order details goes to api. so pls tell me where i can write code to send data. i mean in which method.
ReplyDeleteIn webViewDidFinishLoad method we can check whether we are getting success or failure by evaluating the requestURL. In case of success do the action to make api call to order details.
Deletehey can you provide me your contact details please....
ReplyDeleteYou can mail me on: surajmirajkar@yahoo.com/mirajkarsuraj@gmail.com
Deletei have applied same code with my merchant id and salt which i got from seller dashboard but still i get error https://test.payu.in/_payment .. please let me know what can i do !!!
ReplyDeleteAs the error message suggest you are missing a mandatory parameter, can you cross check the parameters you are sending.
DeleteHi I am using the same code,but when I am trying to do payment with random mail ids, it always says user already exists.
ReplyDeleteThis surely means you have already used those mail id's for Transaction.
DeleteWhen i using this base url "https://www.payumoney.com/" then it's open the site of payumoney.What can i do for using production enviroment and then i want to store it on app store.Please help.
ReplyDeleteuse "https://secure.payu.in" for production. Make sure the complete url would be "https://secure.payu.in/_payment".
DeleteMake sure the merchant key and salt are valid by checking the pay u client dashboard. This will definitely work.
hello sir i am having card no,cvc no,expiray date and card holder name then how i can accept payment in my app.
ReplyDeleteYou must go through the Post and it will help you understand accepting payment in your app.
DeleteThis comment has been removed by the author.
DeleteCan you plz post your code in swift as i am not able to change it in swift
ReplyDeleteSorry but i haven't worked much on Swift. You have to do it on your own.
DeleteYa i want to swift code
ReplyDeleteSorry but i haven't worked much on Swift. You have to do it on your own.
Delete
ReplyDeleteExcellent blogs!!!!you have for sharing them effect information..we developer very learning to easy
Google App Integration Chennai
Hi.... Thanks for the great tutorial. I have integrated PayU successfully into my app using swift. But when I am going to delete the stored card the app is crashing because cardCVV and isExpired parameter I am getting in as int32 data type but these two parameter has been defined as string in sdk. I convert these two parameters in string and request for deleteStoredCard method still no luck. can you please look into this?
ReplyDeletehi i am new in payumoney intigration in ios. my question is how can i get responce data after the transaction is successfull ?
ReplyDeletepossible in swift pls give me demo
ReplyDeleteHi, i m working on CCAvenue in swift can u help me....
ReplyDeleteCCAvenue has provided their own Framework, you can integrate it and use it.
Deletesir test.payment.in is working but live www.secure.payu.in not working i want to do payment process for columbia city please suggest me
ReplyDeletehey suraj can you help me out with the payumoney ios sdk integeration
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHello,
ReplyDeleteplease run your code. I am getting blank screen in webview. response url is "https://test.payumoney.com/payments/#/user/53A9BDD2278FD8BB56EEA8D576D653C8"
what does this mean..
Good article, and of course good payment gateway in india but I used Instamojo
ReplyDeletehello sir,
ReplyDeletei want to use this payment gateway in my project so can you give me these functions in swift?
Thanking you
Regards
Nitesh
Hai Nitish u got any solution for pay u money in swift???
DeleteThis comment has been removed by the author.
ReplyDeletehello, can you please give me the solution when payment is pay successfully then how to redirect in our app?? i'm couldn't find PAY BUTTON delegate.
ReplyDeleteGreat blog. Thanks for sharing such an informative blog....
ReplyDeleteMobile App Development Company
Android app Development Company
ios app development Company
Mobile App Development Companies
Help to get the PayUMoney Customer Care as I wants to confirm about Payumoney Points and where to buy them.
ReplyDeletepayumoney when integrated with swift always giving error
ReplyDeleteNice Post ..... Thanks Admin
ReplyDeleteCustomer Care Number
Contact Number
Toll Free Number
helpline number
Contact Number HUB
It is very easy thank you. But I have some doubt... In above procedure where you are using pay u money sdk? Can u please explain the flow. I am new to iOS
ReplyDeletehi i am new in payumoney intigration in ios. my question is how can i get responce data after the transaction is successfull ?
ReplyDeleteThis comment has been removed by the author.
ReplyDeletecan u send me the demo of pay u money in swift 3 language
ReplyDeleteThis blog gives very important info about iOS Thanks for sharing
ReplyDeleteiOS Online Course Bangalore
nice
ReplyDeleteIf you are ready to accept payments through credit cards for your online services or products bought by your customers, you need to have a payment gateway. If you are looking for Payment Gateway in Qatar, you should check out PaymentsMe.
ReplyDeleteThanks for sharing this...the Indian e-commerce field is an important part of the world's commercial field. Leading payment gateways are renowned for giving the best payment gateway in India with advanced and secure services.
ReplyDelete