4 "summary": "The eSewa Mobile SDK enable native iOS (swift) to easily accept eSewa payments.",
5 "description": "Transaction Flow\nClient Mobile Application initiates eSewa Payment procedure by sending their client_id and client_secret along with product/service name, product/service price, product_id and callback-url to sdk.\n\nSDK sends merchant’s credentials to eSewa.\n\neSewa verifies merchant credentials and sends merchant authentication token on successful verification.\n\nSDK sends customer credentials to eSewa.\n\neSewa sends customer identifier along with name and balance to SDK.\n\nSDK sends payment request to eSewa if balance is sufficient for payment.\n\nIn case of successful payment eSewa sends proof of payment to SDK and to client application server.\n\nSDK forwards proof of payment to client mobile application.\n\nFinal verification procedure is strongly recommended before product/service delivery.\n\nDeliver Product/Service to customer.\n\nclient_id and client_secret values are provided by eSewa to its merchant/client and is unique for each. For development phase, you can use the following credentials:\nclient_id: JB0BBQ4aD0UqIThFJwAKBgAXEUkEGQUBBAwdOgABHD4DChwUAB0R\nclient_secret: BhwIWQQADhIYSxILExMcAgFXFhcOBwAKBgAXEQ==\n\nNote : After login, if the device stays ideal for more than 5 minutes before confirming the payment, the particular session will be time out and customer have to re-initiate the payment process.\n\nSystem Interaction\nThe interactions required to complete a transaction followed by verification process are shown below: System interaction of sdk payment\n\nIntegration\nAdd SDK to your project\nClients can download the sdk file for their respective x-code & swift version from this drive link. The sdk build will be different for each version of x-code and swift. The sdk file must be added to the project and the following steps should be followed.:\n\nStep 1 Drag & Drop provided eSewa SDK (Framework) inside your project. Make sure “copy items if needed” is selected and the framework is copied to your project.\n\nStep 2 2.1 Click on your Project -> Target -> Embedded Binaries 2.2 Tap + sign under Embedded Binaries, Locate your recently copied framework and press Add. 2.3 Now eSewa SDK framework should show under Embedded Binaries as well as Linked frameworks & Libraries. Incase it doesn’t show in either one of them, Delete the copied framework and remove it from both Embedded Binaries and Linked Frameworks & Libraries and repeat from Step 1.\n\nStep 3 Now your eSewa SDK has been successfully added to your project. To complete the process, Build your project again.\n\nStep 4 To use eSewa SDK, you need to import it first in your UIViewController or any other classes.\nEg: import EsewaSDK\n\nNote :\n1. SDK for Simulator/Testing purpose can only be used while selecting the build device as Simulator\n2. SDK for Appstore/Release can only be used while selecting the actual build device or while creating the archive for release purpose.\n\nAfter that, the following code should added:\n\nFor Swift Version 3.0 & above\n\nStep 1: Initialize eSewa SDK. Make sure sdk is an Instance Variable.\n\n\nimport EsewaSDK\nclass TestViewController: UIViewController {\n\n // Keep it in class instance\n var sdk: EsewaSDK?\n\n override func viewDidLoad() {\n super.viewDidLoad()\n }\n\n func testSdkButtonTap() {\n //Start payment process\n sdk = EsewaSDK(inViewController: self, environment: .development, delegate: self)\n sdk?.initiatePayment(merchantId: “<Client ID>”, merchantSecret: “<Secret Key>”, productName: \"<Product Name>\", productAmount: \"<Product Price>\", productId: \"<ProductId>\", callbackUrl: \"<Callback-url>\")\n }\n\n}\nLastly, add two EsewaSDKPaymentDelegate methods to observe the success or failure of transaction from the sdk.\n\nfunc onEsewaSDKPaymentSuccess(info:[String:Any]) {\n // Called when the payment is success. Info contains the detail of transaction.\n}\n\nfunc onEsewaSDKPaymentError(errorDescription: String) {\n // Called when there is error with the description of the error.\n}\nFor Swift Version 2.3\nEvery step is same as before except change in the syntax as follows:\n\nlet s = UIStoryboard(name: \"esewa\", bundle: NSBundle(forClass: RequestViewController.self))\nlet vc = s.instantiateViewControllerWithIdentifier(\"NetworkSearch\") as! RequestViewController\nvc.sendForAuthentication(\"<Client ID>\", \"<Secret Key>\", \"{environment}\", \"<Product Name>\", \"<Product Price>\", \"<ProductId>\",\"<Callback-url>\")presentViewController(vc, animated: true, completion: nil)\n\nNSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.getTransactionDetails(_:)), name: \"NotificationIdentifier\", object: nil)}\n\n//Observe the notification as shown below\nfunc getTransactionDetails(notification: NSNotification) {\n let detailsValue = notification.object as! [String: AnyObject] \n print(\"details Value of transaction Details : (detailsValue)\")\n }\nWhere,\n\nParameter Name Description\nClient ID Client Id of the client/merchant\nSecret Key Secret key of the client/merchant\nEnvironment Environment integrating for i.e. LIVE (live) or DEVELOPMENT (test)\nProduct Price Price of Product or Service\nProduct Name Name of Product or Service\nProductId Set a unique Id for your particular product or services\nCallback-url API exposed at merchant/client`server where eSewa sends a copy of proof of payment after successful payment\n\n\n\nCall Back Url\nCallback-url is an API exposed at merchant/client's server at which eSewa sends a copy of proof of payment after successful payment; the client/merchant must send a callback-url while initiating the payment through SDK. The sent callback-url is later used by eSewa server to send a copy of proof of payment after a payment is received. The callback-url is a POST method API and should be in this format\n\nError Cases and Handling\nSDK handles all of the errors and displays appropriate alert to end user. Here are the error cases that can occur in each of the step during implementation of eSewa SDK implementation.\n\nDuring Merchant Verification\nInvalid Merchant Id or Secret Key\nInvalid Merchant Id or Merchant Secret can cause this error. There are different Merchant Id & Secret for Development & Production Environment. Make sure you are providing valid Merchant Id & Secret for Development & Production Environment.\n\nNo Internet Connection\nSDK shows dialog box with message “Internet not available” to end user.\n\nInvalid Test Environment\nIf environment of sdk is set to .development in production mode or vice versa, SDK shows message \"Sorry your request failed. Contact your service provider.\" to end user.\n\nDuring Customer Login\nNo Internet Connection\nSDK shows dialog box with message \"Internet not available\" to end user.\n\nInvalid user name or password\nSDK shows message Invalid username or password to customer and clears password field.\n\nCanceled by customer\nIf end user presses Back Button or Cancel button then user is returned to the screen the sdk is initiated from.\n\nDuring Payment Confirmation\nNo Internet Connection\nSDK shows dialog box with message \"Internet not available\" to customer. He can turn on Internet and proceed to confirming their payment.\n\nInsufficient Balance\nSDK compares the current balance of user with the total amount of the product or service. Payment request is sent if and only if the user has sufficient balance else the following message will be shown to user “Your balance is less than required total amount” and user will be bound to cancel the payment. And if user has sufficient balance initially but balance is expended via other parties before confirming the payment, appropriate message is shown indicating that transaction is not completed.\n\nCanceled by user\nIf end user presses Back Button or Cancel button then user is returned to the screen the sdk is initiated from.\n\nSession Timeout\nIf the device is kept ideal for at least 2 minute then the particular session for payment expires and user has to re-process the payment again.\n\nTransaction Verification\nThis verification is done after SDK returns proof of payment to the client app after successful transaction. Although payment is already completed, this verification plays a vital role to avoid fraud transactions. The verification can be done by comparing parameters of the response obtained from eSewa SDK with the response obtained by eSewa backend server on the callback url . If all the parameters are equivalent then the product/service is ready for delivery else it can be fraud transaction so you are requested to stop the product/service delivery. If mobile application server fails to receive proof of payment from eSewa Server or eSewa server fails to send proof of payment to application server then the request for verification can be sent from the client side in two different ways:\n\nWith reference/transaction Id: Clients can check the payments validity with transaction/reference id received on their end with this API. Download the postman sample request from here.\n\nWith product Id & amount: Clients can even check the payments validity without transaction/reference id but with the product id and amount of product the client wants to confirm for. Download the postman sample request from here.\nCredentials & URLs\nEach client will also receive a wallet on eSewa (Merchant wallet) from where they can find payments made for their products/services:\n\nLink For Production Mode: https://merchant.esewa.com.np\n\nLink For Development Mode: https://uat-merchant.esewa.com.np\n\nMerchant Credentials: Following are the test merchant credentials to check the payment in the wallet:\n\nUsername: epaytest@gmail.com\nPassword: test@1234\nMerchant ID/Service Code: EPAYTEST\n\neSewa ID & Password:\nTo make payment with eSewa sdk. One must be a registered eSewa user. For testing phase, the client/merchant can use the following eSewa id and password:\n\neSewa ID: 9806800001/2/3/4/5\nPassword: Nepal@123\n\nA GIT sample project with eSewa sdk integrated can be cloned from here",
6 "homepage": "https://esewa.com.np",
12 "Farheen Banu": "farheen.banu@esewa.com.np"
18 "vendored_frameworks": "EsewaSDK.xcframework"
21 "http": "https://www.dropbox.com/s/s1oqiw8y0y9yy0f/EsewaSDK.zip?dl=1"