Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewController.swift
- // IMEPayTest
- //
- // Created by Naren Maharjan on 9/20/18.
- // Copyright © 2018 Naren Maharjan. All rights reserved.
- //
- import UIKit
- import IMEPay
- class ViewController: UIViewController {
- let manager = IMPPaymentManager(environment: Live) // For Test
- override func viewDidLoad() {
- super.viewDidLoad()
- setupIMEPay()
- // Do any additional setup after loading the view, typically from a nib.
- }
- func setupIMEPay(){
- // let manager = IMPPaymentManager(environment: Live) // For production
- manager?.pay(withUsername: "tootle" , password: "tootle123", merchantCode: "TOOTLE", merchantName: "Tootle", merchantUrl: "https://api.demo.ktm.tt.hyperloopnepal.com/v2/transactions/imeRecordData", amount: "10", referenceId: "C123", module: "TOOTLE", success: { (transactionInfo) in
- print(transactionInfo?.amount)
- // You can extract the following info from transactionInfo
- transactionInfo?.responseCode
- // Response Code 100:- Transaction successful.
- // Response Code 101:- Transaction failed.
- transactionInfo?.responseDescription // ResponseDescription, message sent from server
- transactionInfo?.transactionId // Transaction Id, Unique ID generated from IME Pay system.
- transactionInfo?.customerMsisdn // Customer mobile number (IME Pay wallet ID)
- transactionInfo?.amount // Payment Amount
- transactionInfo?.referenceId // Reference Value
- }, failure: { (transactionInfo, errorMessage) in
- print(errorMessage)
- // Transaction Failure
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement