आईओएस (एक्सकोड 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);
}
यहाँ स्क्रीनशॉट जबकि सीधे मंचन यह पेज दिखा उपयोग कर रहा है:
* नोट - असल में मैं उत्पादन के लिए नहीं मंचन के लिए कोशिश कर रहा हूँ।
जब मैं निष्पादित करता हूं तो यह पेटीएम फीपेमेंट फॉर्म नहीं दिखाता है बल्कि यह ऑर्डरिड और लेनदेन आईडी के साथ राशि दिखाता है।
जब उपयोगकर्ता फॉर्म में शुल्क राशि दर्ज करते हैं तो पेटीएम भुगतान फॉर्म कैसे खोलें, तो उसे अतिरिक्त कर के साथ राशि को कैलक्यूलेट करना चाहिए और फिर शुल्क भुगतान बटन पर क्लिक करना चाहिए, इसे पेमेंट भुगतान फॉर्म खोलना चाहिए।
कृपया मुझे इस समस्या को हल करने में मदद करें (मुझे पैटम एसडीके डॉक चरण के माध्यम से कदम है लेकिन इसे खोजने के लिए सक्षम है)। धन्यवाद।
महत्वपूर्ण: ** जहां तक checksumGenerationURL और checksumValidationURL का संबंध है, हमें इसे बनाना होगा। शुरू में मैं Paytm से उपयोग करने के लिए करने की कोशिश की, लेकिन यह काम इतना अंत में हमारे सर्वर टीम सहारे यह किया, इस घालमेल Paytm
क्या आपने एक व्यापारी के रूप में पेटीएम के साथ साइन अप किया है और उचित व्यापारी कॉन्फ़िगरेशन जानकारी प्राप्त की है? ऑर्डर आईडी और टीएक्सएन आईडी वाले संवाद में आपको क्या संदेश मिलता है? –
अच्छी तरह से कर के संबंध में है कि हम अपने पक्ष से (एक webservice बुला रहे हैं) लेकिन भुगतान भुगतान फार्म कैसे खोलें। मैंने सफलतापूर्वक mc.checksumGenerationURL और mc.checksumValidationURL सेट किया है। लेकिन यह लेनदेन आईडी के साथ "कंपनी के नाम पर 100 रुपये का कुल भुगतान" दिखाते हुए एक पृष्ठ खोलता है। मैं पेमेंट भुगतान फॉर्म सर खोलना चाहता हूं। एसडीके 2.1 के साथ यह संभव है या नहीं! –
कृपया इसे देखें: https://stackoverflow.com/questions/48782215/ios-paytm-something-went-wrong-it-may-be-due-to-any-of-these-reasons –