2016-02-19 7 views
5

आईओएस (एक्सकोड 7) में एकीकृत पेटीएम एसडीके 2.1 और भुगतान करने के लिए कॉन्फ़िगर किया गया।पेटीएम भुगतान फॉर्म खोलने के लिए पीटीएम एसडीके आईओएस एकीकरण?

मेरे पास एक ऐसा फॉर्म है जिसमें राशि और अन्य फ़ील्ड भरने की आवश्यकता है तो भुगतान के लिए एक बटन है।

यहाँ कोड है जो मैं उपयोग कर रहा हूँ है:

//Step 1: Create a default merchant config object 
    PGMerchantConfiguration *mc = [PGMerchantConfiguration defaultConfiguration]; 

    //Step 2: If you have your own checksum generation and validation url set this here. Otherwise use the default Paytm urls 
    mc.checksumGenerationURL = @"generate checksum url"; 
    mc.checksumValidationURL = @"checksum validation url"; 


    //Step 3: Create the order with whatever params you want to add. But make sure that you include the merchant mandatory params 
    NSMutableDictionary *orderDict = [NSMutableDictionary new]; 
    //Merchant configuration in the order object 
    orderDict[@"MID"] = @"abc1111"; 
    orderDict[@"CHANNEL_ID"] = @"WAP"; 
    orderDict[@"INDUSTRY_TYPE_ID"] = @"Education"; 
    orderDict[@"WEBSITE"] = @"companyname"; 
    //Order configuration in the order object 
    orderDict[@"TXN_AMOUNT"] = @"100"; 
    orderDict[@"ORDER_ID"] = [Feepayment generateOrderIDWithPrefix:@"111"]; 
    orderDict[@"REQUEST_TYPE"] = @"DEFAULT"; 
    orderDict[@"CUST_ID"] = @"abc7777"; 

    PGOrder *order = [PGOrder orderWithParams:orderDict]; 

    //Step 4: Choose the PG server. In your production build dont call selectServerDialog. Just create a instance of the 
    //PGTransactionViewController and set the serverType to eServerTypeProduction 


    [PGServerEnvironment selectServerDialog:self.view completionHandler:^(ServerType type) 
    { 
     PGTransactionViewController *txnController = [[PGTransactionViewController alloc] initTransactionForOrder:order]; 

     //show title var 
     UIView *mNavBar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,44)]; 
     mNavBar.backgroundColor = [UIColor grayColor]; 
     txnController.topBar = mNavBar; 

     //Cancel button 
     UIButton *mCancelButton = [[UIButton alloc] initWithFrame:CGRectMake(5, 2, 70, 40)]; 
     [mCancelButton setTitle:@"Cancel" forState:UIControlStateNormal]; 
     mCancelButton.titleLabel.textColor = PURPLE_COLOR; 
     [mCancelButton setFont:[UIFont fontWithName:@"Helvetica-Bold" size:15.0]]; 
     txnController.cancelButton = mCancelButton; 


     //add title 
     UILabel *mTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.view.frame.size.width/2 - 10, 1, 100, 50)]; 
     [mTitleLabel setText:@"Payment"]; 
     [mTitleLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:15.0]]; 
     mTitleLabel.textColor = [UIColor whiteColor]; 
     [mNavBar addSubview:mTitleLabel]; 

     if (type!=eServerTypeNone) { 
      txnController.serverType = type; 
      txnController.merchant = mc; 
      txnController.loggingEnabled = YES; 
      txnController.sendAllChecksumResponseParamsToPG = YES; 
      txnController.delegate = self; 
      [self showController:txnController]; 
     } 

    }]; 

//show controller method 
-(void)showController:(PGTransactionViewController *)controller { 
    if (self.navigationController != nil) 
     [self.navigationController pushViewController:controller animated:YES]; 
    else 
     [self presentViewController:controller animated:YES 
         completion:^{ 

         }]; 
} 
//remove controller 
-(void)removeController:(PGTransactionViewController *)controller { 
    if (self.navigationController != nil) 
     [self.navigationController popViewControllerAnimated:YES]; 
    else 
     [controller dismissViewControllerAnimated:YES 
             completion:^{ 
             }]; 
} 
#pragma mark PGTransactionViewController delegate 

- (void)didSucceedTransaction:(PGTransactionViewController *)controller 
        response:(NSDictionary *)response { 
    DEBUGLOG(@"ViewController::didSucceedTransactionresponse= %@", response); 
    NSString *title = [NSString stringWithFormat:@"Your order was completed successfully. \n %@", response[@"ORDERID"]]; 
    [[[UIAlertView alloc] initWithTitle:title message:[response description] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; 
    [self removeController:controller]; 
} 

- (void)didFailTransaction:(PGTransactionViewController *)controller error:(NSError *)error response:(NSDictionary *)response { 
    DEBUGLOG(@"ViewController::didFailTransaction error = %@ response= %@", error, response); 
    if (response) 
    { 
     [[[UIAlertView alloc] initWithTitle:error.localizedDescription message:[response description] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; 
    } 
    else if (error) 
    { 
     [[[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; 
    } 
    [self removeController:controller]; 
} 

- (void)didCancelTransaction:(PGTransactionViewController *)controller error:(NSError*)error response:(NSDictionary *)response { 
    DEBUGLOG(@"ViewController::didCancelTransaction error = %@ response= %@", error, response); 
    NSString *msg = nil; 
    if (!error) msg = [NSString stringWithFormat:@"Successful"]; 
    else msg = [NSString stringWithFormat:@"UnSuccessful"]; 

    [[[UIAlertView alloc] initWithTitle:@"Transaction Cancel" message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; 
    [self removeController:controller]; 
} 

- (void)didFinishCASTransaction:(PGTransactionViewController *)controller response:(NSDictionary *)response { 
    DEBUGLOG(@"ViewController::didFinishCASTransaction:response = %@", response); 


} 

यहाँ स्क्रीनशॉट जबकि सीधे मंचन यह पेज दिखा उपयोग कर रहा है: enter image description here

* नोट - असल में मैं उत्पादन के लिए नहीं मंचन के लिए कोशिश कर रहा हूँ।

जब मैं निष्पादित करता हूं तो यह पेटीएम फीपेमेंट फॉर्म नहीं दिखाता है बल्कि यह ऑर्डरिड और लेनदेन आईडी के साथ राशि दिखाता है।

जब उपयोगकर्ता फॉर्म में शुल्क राशि दर्ज करते हैं तो पेटीएम भुगतान फॉर्म कैसे खोलें, तो उसे अतिरिक्त कर के साथ राशि को कैलक्यूलेट करना चाहिए और फिर शुल्क भुगतान बटन पर क्लिक करना चाहिए, इसे पेमेंट भुगतान फॉर्म खोलना चाहिए।

कृपया मुझे इस समस्या को हल करने में मदद करें (मुझे पैटम एसडीके डॉक चरण के माध्यम से कदम है लेकिन इसे खोजने के लिए सक्षम है)। धन्यवाद।

महत्वपूर्ण: ** जहां तक ​​checksumGenerationURL और checksumValidationURL का संबंध है, हमें इसे बनाना होगा। शुरू में मैं Paytm से उपयोग करने के लिए करने की कोशिश की, लेकिन यह काम इतना अंत में हमारे सर्वर टीम सहारे यह किया, इस घालमेल Paytm

+0

क्या आपने एक व्यापारी के रूप में पेटीएम के साथ साइन अप किया है और उचित व्यापारी कॉन्फ़िगरेशन जानकारी प्राप्त की है? ऑर्डर आईडी और टीएक्सएन आईडी वाले संवाद में आपको क्या संदेश मिलता है? –

+0

अच्छी तरह से कर के संबंध में है कि हम अपने पक्ष से (एक webservice बुला रहे हैं) लेकिन भुगतान भुगतान फार्म कैसे खोलें। मैंने सफलतापूर्वक mc.checksumGenerationURL और mc.checksumValidationURL सेट किया है। लेकिन यह लेनदेन आईडी के साथ "कंपनी के नाम पर 100 रुपये का कुल भुगतान" दिखाते हुए एक पृष्ठ खोलता है। मैं पेमेंट भुगतान फॉर्म सर खोलना चाहता हूं। एसडीके 2.1 के साथ यह संभव है या नहीं! –

+0

कृपया इसे देखें: https://stackoverflow.com/questions/48782215/ios-paytm-something-went-wrong-it-may-be-due-to-any-of-these-reasons –

उत्तर

3

अंत में, उत्पादन और उसके कामकाजी जुर्माना पर इसका परीक्षण करके हल किया गया। जहां तक ​​स्टेजिंग सर्वर का संबंध है, मुझे लगता है कि एसडीके में हार्ड कोड की जानकारी है इसलिए पीजीएसडीके के अगले संस्करण में आशा है कि हम इसे स्टेजिंग पर भी जांच सकते हैं।

धन्यवाद।

@ प्रदीप के ... आपके सभी मूल्यवान समर्थन के लिए बहुत बहुत धन्यवाद।

+0

अच्छी नौकरी !! अपने अपने आवेदन –

+0

@Shobhakar तिवारी के लिए काम यू मेरा मार्गदर्शन करें सकते हैं कि कैसे उत्पन्न करने के लिए checksumGenerationURL और checksumvalidationURL –

+0

इस सर्वर की ओर से की स्थापना की है, मैं व्यापारी क्रमांक और मर्चेंट कुंजी –

0

आप mc.checksumGenerationURL और mc.checksumValidationURL ठीक से बसा है के लिए सबसे महत्वपूर्ण बात है? इसके अलावा एसडीके का 2.7 संस्करण है जिसका उपयोग आप करना चाहिए। नवीनतम आईओएस एसडीके के लिए अपने पेटीएम संपर्क बिंदु से पूछें।

अब राशि के बारे में, पेटीएम कर की गणना नहीं करता है। आपको इसे उस राशि में जोड़ना होगा जिसे आप पेटीएम को भेज रहे हैं।

+0

अच्छी तरह से जहां तक ​​कर का सवाल है कि हम अपनी तरफ से (वेबसाइज को बुला रहे हैं) लेकिन पेमेंट भुगतान फॉर्म कैसे खोलें। मैंने सफलतापूर्वक mc.checksumGenerationURL और mc.checksumValidationURL सेट किया है। लेकिन यह लेनदेन आईडी के साथ "कंपनी के नाम पर 100 रुपये का कुल भुगतान" दिखाते हुए एक पृष्ठ खोलता है। मैं पेमेंट भुगतान फॉर्म सर खोलना चाहता हूं। एसडीके 2.1 के साथ यह संभव है या नहीं! –

+0

आपको 2.7 पर अपग्रेड करना होगा।अगर आप आईओएस 9 पर चल रहे हैं तो क्या आपने एप ट्रांसपोर्ट सिक्योरिटी प्रॉपर्टी ऐप की इन्फो.प्लिस्ट में जोड़ दी है। आपको वास्तव में क्या त्रुटि मिल रही है? क्या आप एक स्नैपशॉट संलग्न कर सकते हैं? –

+0

मैंने पहले से ही ऐप ट्रांसपोर्ट सुरक्षा जोड़ दी है। महोदय, मैं केवल यह पूछ रहा हूं कि पेटीएम भुगतान फॉर्म कैसे खोलें, जहां नेट बैंकिंग, क्रेडिट कार्ड इत्यादि का भुगतान करना है। यह दिखा नहीं रहा है। यह सीधे दिखा रहा है कि पेटीएम पेज दिखा रहा है .. ट्रांज़ेक्शन आईडी के साथ XYZ आरएस 100 के लिए बनाया गया भुगतान भुगतान। –

संबंधित मुद्दे