Skip to content

Commit

Permalink
Merge pull request #66 from om-ghimire/master
Browse files Browse the repository at this point in the history
updated the docs
  • Loading branch information
aashishbaidya committed Apr 5, 2024
2 parents ecee1a0 + 7bc7ad8 commit 628078f
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 48 deletions.
128 changes: 128 additions & 0 deletions content/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
This document serves as a comprehensive guide to integrating the Khalti Payment Gateway (KPG) into your system. The integration process involves signing up as a merchant, understanding the integration methods for web and mobile, and transitioning to a live environment after successful testing.



- [1. Signup as a Merchant in Khalti](#1-signup-as-a-merchant-in-khalti)
- [2. ePayment Gateway Integration](#2-epayment-gateway-integration) <br>
- [2.1. Web](#21-web-checkout)<br>
- [2.2. Mobile](#22-mobile-checkout) <br>
- [3. Test Environment](#3-test-environment)<br>
- [4. Going Live](#4-go-live)


## 1. Signup as a Merchant in Khalti

Before proceeding with the integration, it's essential to understand the terms used throughout the documentation:<br>

+ **Merchant :** Online business services such as e-commerce websites, ISP online payment portals, or online movie ticket platforms seeking to receive online payments via KPG.<br>


If you're new to Khalti Payment Gateway service, familiarize yourself with its offerings by reading [here](./index.md) for a better understanding.

To initiate the integration process, sign up as a merchant account :


- [Create a merchant account](https://khalti.com/join/merchant/)



## 2. ePayment Gateway Integration
The integration process varies depending on whether you're integrating KPG on a web or mobile platform. Follow the steps outlined below accordingly:



### 2.1. Web Checkout
![Khalti payment overview](./img/kpgv2-light.png)
The payment process flow of KPG Web Checkout is as follows:


1. Merchant requests Khalti to initiate the online payment.
2. Khalti system returns with `pidx` and `payment_url`.
3. The user must be redirected to `payment_url`.
4. After payment, callback is received from Khalti system.
5. Merchant side must hit the lookup API to get the status of the transaction.


If you are looking to integrate KPG on web application, then the integration must be done by integrating the web checkout. Please follow the documentation here to proceed [Web Checkout](./khalti-epayment.md).

Checkout provides all the necessary Uls and perform necessary processes to initiate and confirm the payment.


### 2.2. Mobile Checkout
![Khalti payment overview](./img/kpg _mobilesdk.png)


The payment process flow of KPG SDK (Android & Flutter) is as follows:

1. Merchant requests Khalti to initiate the online payment.
2. Khalti system returns with `pidx` and `payment_url`.
3. The merchant system must pass `pidx`, `keys` and `return URL` in client side SDK (Android and Flutter) for initiating the online payment.
4. After payment, the return message is obtained on the client side along with extra SDK offerings.


5. Merchant side must hit the lookup API to get the status of the transaction.
!!! info "Note"
The return url must be same while generating PIDX and in SDK To get callback or SDK offering

If you are looking to integrate KPG in mobile, then the integration must be done by integrating the provided SDKs. Please follow the documentation here to proceed:<br>

- [Android SDK](./checkout/android.md)<br>
- [Flutter SDK](./checkout/flutter/khalti-checkout.md)

Checkout provides all the necessary Uls and perform necessary processes to initiate and confirm the payment.





## 3. Test Environment



!!! info "Access Information"

> **For Sandbox Access**

> Signup from
[here](https://test-admin.khalti.com/#/join/merchant) as a merchant.<br>

> **URL :** https://dev.khalti.com/ <br>
> **Server Side Authorization Key :** Live secret key<br>
> **Client Side Authorization Key (Android / Flutter SDK):** Live public key

!!! info "Test Credentials for sandbox environment"

> **Test Khalti ID for**
9800000000
9800000001
9800000002
9800000003
9800000004
9800000005

> **Test MPIN**
1111

> **Test OTP**
987654

!!! Important Note
Payment via E-Banking and Debit/Credit card is not supported in the test environment. However, after successful integration with KPG, this functionality will be enabled.
## 4. Going Live
After a successful integration test, a live merchant account must be created from here. The merchant must replace the Sandbox URL and authorization key with productions. Live keys will be generated in the merchant dashboard.
!!! info "Access Information"

> **For Production**

> Signup from
[here](https://admin.khalti.com/) as a merchant.<br>
> **URL :** https://khalti.com/ <br>
> **Server Side Authorization Key :** Live secret key<br>
> **Client Side Authorization Key (Android / Flutter SDK):** Live public key




!!! Important note
Even after successful integration, you won't be able to receive payments above NPR 200 per transaction. Fill the KYC form and contact us at 9801890085 / 9801856440 / 9801165558 / 9801165557 to remove the limits and accept payments without restrictions.
39 changes: 18 additions & 21 deletions content/gotchas.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,58 @@

## 1. How can I sign up as a merchant?

Please go this link for a merchant sign up: https://khalti.com/join/merchant/
Please go this [link](https://khalti.com/#/join/merchant/)
for a merchant sign up

## 2. How to integrate KPG?

Based on your requirement please visit following links for Khalti integration:

- [Web integration](https://docs.khalti.com/checkout/web/)
- [Android integration](https://docs.khalti.com/checkout/android/)
- [iOS integration](https://docs.khalti.com/checkout/ios/)
- Flutter integration
- [With Payment interface](https://docs.khalti.com/checkout/flutter/khalti-flutter/)
- [Without payment interface](https://docs.khalti.com/checkout/flutter/khalti/)
- [Web integration](./khalti-epayment.md)
- [Android integration](checkout/android.md)
<!-- - [iOS integration](https://docs.khalti.com/checkout/ios/) -->
- [Flutter integration](checkout/flutter/khalti-checkout.md)

<!-- - Khalti integration for custom payment interface
For Khalti wallet: [https://docs.khalti.com/checkout/diy-wallet/](https://docs.khalti.com/checkout/diy-wallet/)
For Ebanking wallet: [https://docs.khalti.com/checkout/diy-banking/ ](https://docs.khalti.com/checkout/diy-banking/ ) -->

- Khalti integration via plugins
- [For WooCommerce](https://docs.khalti.com/plugins/woocommerce/)
- [For Opencart](https://docs.khalti.com/plugins/opencart/)
- [For Magneto](https://docs.khalti.com/plugins/magneto/)
- [For Prestashop](https://docs.khalti.com/plugins/prestashop/)
- [For WHMCS](https://docs.khalti.com/plugins/whmcs/)
- [For WooCommerce](plugins/woocommerce.md)

## 3. What to do after a successful test transaction ?
After a successful test transaction, you will able to accept payments live. However, before going live, [please contact our team for the necessary coordination](https://docs.khalti.com/contact-us/)

## 4. Does Khalti have SDK for hybrid Apps?

We do have SDK for [Flutter](https://flutter.dev/). But for hybrid apps based on other frameworks, we don't have a specific SDK.
We do have SDK for [Flutter](checkout/flutter/khalti-checkout.md). But for hybrid apps based on other frameworks, we don't have a specific SDK.
Find options in `Client Integration`, which support Khalti checkout integration with your app.

## 5. Can I share merchant keys?

*Secret key* must not be shared with anyone. Ensure it does not get leaked by any means. If you key got compromised you can regenerate new one from your merchant dashboard.

## 6. Can I integrate Khalti in my static/HTML website?

Complete Khalti integration in Static/HTML site is not possible. If the currently available options failed to meet your requirement leave us your [feedback](/#support).
<!-- ## 6. Can I integrate Khalti in my static/HTML website?
## 7. What can I resolve an issue while installing the plugin ?
Complete Khalti integration in Static/HTML site is not possible. If the currently available options failed to meet your requirement leave us your [feedback](/#support). -->

First, check if cURL is enabled. You should check if you miss out any dependency or extension. There might be common SSL issues. You can also tweak the code (of the plugin you got from GitHub) on your own.
<!-- ## 7. What can I resolve an issue while installing the plugin ?
First, check if cURL is enabled. You should check if you miss out any dependency or extension. There might be common SSL issues. You can also tweak the code (of the plugin you got from GitHub) on your own.
For debugging paste this in your code to get the configuration and predefined variables.
```
<?php phpinfo();?>
```
Also, see your server log.
Also, see your server log. -->

## 8. What is Khalti mPIN?
## 6. What is Khalti mPIN?

Khalti mPIN is the four digit pin, used by the user while making payment of third party transactions.

It can created or changed at the Transaction Pin section under Account in khalti web and Settings in khalti app.

## 9. I need to refund payment to the user. How can I refund a transaction?
## 7. I need to refund payment to the user. How can I refund a transaction?

You can refund the payment to the user from your dashboard.

Expand Down
Binary file added content/img/kpg _mobilesdk.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/img/kpgv2-light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 30 additions & 22 deletions content/index.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
# Introduction

This site hosts documentation for developers who are looking to integrate
Khalti as a Payment Option in their online platform. If you fall into that
category, please keep reading.

Khalti is a payment gateway, digital wallet and API provider system for
various online services for Nepal.
## What is Khalti Payment Gateway(KPG)?

With Khalti SDK/API, you can accepts payments from:
Khalti Payment Gateway (KPG) is a comprehensive payment solution, digital wallet, and API provider designed specifically for online services in Nepal. Whether you have a web application or a mobile application, integrating KPG enables you to seamlessly accept online payments. This documentation serves as your comprehensive guide through the integration process.

By incorporating the KPG ePayment Gateway (for web) and SDKs (for mobile), you can accept payments from various sources:

1. Khalti users.
2. eBanking users of our partner banks.
3. Mobile banking users of our mobile banking partner banks.
4. SCT/VISA card holders.
5. connectIPS users.

Using Khalti Payment Gateway, you do not need to integrate with individual banks.
Integration with Khalti Payment Gateway (KPG) streamlines the process of receiving online payments by eliminating the need to integrate individually with multiple banks.



## Features

* Multiple Payment Options for Customers
* Highly secure and Easy Integrations
* SDKs are available for Web (JavaScript), Android and iOS.
* Customers can make wallet payments without leaving your
platform.
* Secured Transaction uses 2 step authentication i.e Khalti Pin and Khalti Password.
Transaction Processing is disabled on multiple request for wrong Khalti Pin.
* Merchant Dashboard to view transactions, issue refunds, filter and download reports etc.
* Multi User System
* Realtime Balance updates in Merchant Dashboard on every successful payments made by customers
* Amount collected in Merchant Dashboard can we deposited/transferred to bank accounts anytime
### For consumers

- **Convenient Wallet Payments**: Customers can make payments without leaving your platform.

- **Multiple Payment Options**: Provides various payment options for customers.

- **Secured Transactions**: Utilizes 2-step authentication (Khalti Pin and Khalti Password) for enhanced security. Transaction processing is disabled after multiple incorrect pin attempts.

### For merchants

- **Highly Secure and Easy Integrations**: Offers seamless integration with strong security measures.
- **SDK Availability**: SDKs are available for Web Flutter and Android.
- **Merchant Dashboard**: Allows merchants to view transactions, issue refunds, filter and download reports, etc.
- **Multi-User System**: Supports multiple users within a single account.
- **Real-Time Balance Updates**: Provides real-time updates on balances in the Merchant Dashboard for every successful customer transaction.
- **Flexibility in Fund Transfer**: Amount collected in the Merchant Dashboard can be deposited or transferred to bank accounts at any time.


## Support

##Support
** For Queries, feel free to call us at: **
For any inquiries regarding Khalti Payment Gateway, feel free to reach out to us through:

* Mobile (Viber / Whatsapp / Skype): 9801165557, 9801165565
+ Mobile (Viber / Whatsapp / Skype): 9801165557, 9801890085
+ Email: merchant@khalti.com

* Email: merchant@khalti.com
We are here to assist you with any questions or concerns you may have.
11 changes: 6 additions & 5 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ nav:
- Opencart: plugins/opencart.md
- Magento 2: plugins/magneto.md
- Prestashop: plugins/prestashop.md
- WHMCS Khalti Module: plugins/whmcs.md
- Resources: resources.md
- WHMCS Khalti Module: plugins/whmcs.md
- Resources: resources.md

- FAQ's and Gotchas: gotchas.md
- Contribution: contribution.md
- Contact Us: contact-us.md
Expand All @@ -43,11 +44,11 @@ theme:
features:
- content.code.annotate
palette:
- scheme: slate
- scheme: default
toggle:
icon: material/weather-sunny
name: Switch to light mode
- scheme: default
- scheme: slate
toggle:
icon: material/weather-night
name: Switch to dark mode
Expand All @@ -62,7 +63,7 @@ site_dir: docs
repo_name: "khalti/docs.khalti.com"
repo_url: "https://github.com/khalti/docs.khalti.com"
edit_uri: "edit/master/content/"
copyright: "Copyright &copy; 2023 Khalti Private Limited"
copyright: "Copyright &copy; 2024 Khalti Private Limited"
# plugins:
# - social
extra:
Expand Down

0 comments on commit 628078f

Please sign in to comment.