Objective C-Non-Seamless
Using SDK’s Inbuilt UI
Prerequisites
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
Integration steps
#import "PUUIPaymentOptionVC.h"PayUModelPaymentParams *paymentParam = [[PayUModelPaymentParams alloc] init]; PayUModelHashes *hashes = [[PayUModelHashes alloc] init];// Set the hashes here paymentParam.key = @"gtKFFx"; paymentParam.transactionID = @"txnID20170220"; paymentParam.amount = @"10"; paymentParam.productInfo = @"iPhone"; paymentParam.SURL = @"https://payu.herokuapp.com/success"; paymentParam.FURL = @"https://payu.herokuapp.com/failure"; paymentParam.firstName = @"Baalak"; paymentParam.email = @"Baalak@gmail.com"; paymentParam.udf1 = @""; paymentParam.udf2 = @""; paymentParam.udf3 = @""; paymentParam.udf4 = @""; paymentParam.udf5 = @""; paymentParam.hashes = hashes; // Set this property if you want to get the stored cards: paymentParam.userCredentials = @"gtKFFx:Baalak@gmail.com"; // Set the environment according to merchant key ENVIRONMENT_PRODUCTION for Production & // ENVIRONMENT_TEST for test environment: paymentParam.environment = ENVIRONMENT_TEST; // Set this property if you want to give offer: paymentParam.offerKey = @"";
PayUWebServiceResponse *webServiceResponse =[[PayUWebServiceResponse alloc]init]; [webServiceResponse getPayUPaymentRelatedDetailForMobileSDK:paymentParam withCompletionBlock:^(PayUModelPaymentRelatedDetail *paymentRelatedDetails, NSString *errorMessage, id extraParam) { if (!errorMessage) { UIStoryboard *stryBrd = [UIStoryboard storyboardWithName:@"PUUIMainStoryBoard" bundle:nil]; PUUIPaymentOptionVC * paymentOptionVC = [stryBrd instantiateViewControllerWithIdentifier:VC_IDENTIFIER_PAYMENT_OPTION]; paymentOptionVC.paymentParam = paymentParam; paymentOptionVC.paymentRelatedDetail = paymentRelatedDetails; [self.navigationController pushViewController:paymentOptionVC animated:true]; } else{ // error occurred while creating the request } }];[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(responseReceived:) name:kPUUINotiPaymentResponse object:nil]; -(void)responseReceived:(NSNotification *) notification{ NSString *strConvertedRespone = [NSString stringWithFormat:@"%@",notification.object]; NSLog(@"Response Received %@",strConvertedRespone); }
Last updated