Integrate PayU Money Payment Gateway in iOS Swift 4
Posted By : Vasu Saini | 13-Dec-2017
PayU money is nowadays popular payment gateway for Indian currency but problem is that it is not available for swift and even
Here are steps to integrate
Step 1. Open/Create project in which you want to integrate
Step 2. Install following pod in it
pod 'PayUmoney_PnP'
Step 3.Create
https://test.payumoney.com/
Step 4.Create
https://www.payumoney.com/
Step 5. Register yourself and follow steps given there to get MerchantId
Step 6. Now
https://s3.amazonaws.com/oodles-blogs/blog-images/28a8c465-a633-46ea-ade3-c881ca3980ec.zip
Step 7. Now Add PayUServiceHelper.h to your bridging header
Step 8. Here are some changes you have to done in PayUServiceHelper.m
#pragma mark Sandbox Crenditials
txnParam.environment = PUMEnvironmentTest;
txnParam.key = @"";
txnParam.merchantid = @"";
self.payu_salt = @"";
#pragma mark Production Crenditials
// txnParam.environment = PUMEnvironmentProduction;
// txnParam.key = @"";
// txnParam.merchantid = @"";
// self.payu_salt = @"";
Step 9. In above mentioned code add all your sandbox and production crenditials
Step 10. If you are using for testing or staging comment you production credintials and open sandbox credintials and vice versa.
Step 11. You can also change here
Step 12. Now open controller class in which you want payment process and on buttonAction call the function getPayment of the PayUServiceHelper.m as follows
PayUServiceHelper.sharedManager().getPayment("Controller", "[email protected]", "+91-9896952757", "Name", "Amount 0011", didComplete: { (dict, error) in
if let error = error {
print("Error")
}else {
print("Sucess")
}
}) { (error) in
print("Payment Process Breaked")
}
Step 13. Pass all params in the method as required, and your payment process will start and will give you callback of sucess or failure.
Step 14. All done
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Vasu Saini
Vasu Saini is Passionate to deploy ideas into real world, Have zeal to learn new technologies. working as iOS Developer in Oodles Technologies. Sports Freak, Calisthenics ,Parkour, Love to play football, swimmer, athletics etc