Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 1.71 KB | None | 0 0
  1. let merchantConfig = PGMerchantConfiguration.default()
  2.         merchantConfig?.checksumGenerationURL = "http://api.myserver.io/generate_checksum" // Not the actual url
  3.         merchantConfig?.checksumValidationURL = "http://api.myserver.io/verify_checksum" // Not the actual url
  4.        
  5.         var orderParams: [String: String] = [:]
  6.         // Merchant config
  7.         orderParams["MID"] = "SreeTr69744841387208"
  8.         orderParams["CHANNEL_ID"] = "WAP"
  9.         orderParams["INDUSTRY_TYPE_ID"] = "Retail"
  10.         orderParams["WEBSITE"] = "APP_STAGING"
  11.         // Order config
  12.         orderParams["TXN_AMOUNT"] = "1.00"
  13.         orderParams["ORDER_ID"] = "1499926963"
  14.         orderParams["CALLBACK_URL"] = "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp"
  15.         orderParams["REQUEST_TYPE"] = "DEFAULT"
  16.         orderParams["CHECKSUMHASH"] = "BLkX0WUJ2TCnb54xz0IhLEZU9gYi2N21XNkinbrRQXv5s+LLjF+UiOYkpB1ccrR6YbhQtk71TRPd5Pvz1KeUZKraaCCr6ovzmYSxEV0d8GQ=" // From Server
  17.         orderParams["CUST_ID"] = "1234567890"
  18.         let order: PGOrder = PGOrder(params: orderParams)
  19.        
  20.         PGServerEnvironment.selectServerDialog(self.view) { serverType in
  21.             let transactionController = PGTransactionViewController.init(transactionFor: order)
  22.             transactionController?.serverType = serverType
  23.             transactionController?.merchant = merchantConfig
  24.             transactionController?.delegate = self
  25.             transactionController?.loggingEnabled = true
  26.            
  27.             if let vc = transactionController {
  28.                 self.present(vc, animated: true, completion: nil)
  29.             } else {
  30.                 log.error("vc could not be initialised")
  31.             }
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement