Giter Site home page Giter Site logo

khalti / docs.khalti.com Goto Github PK

View Code? Open in Web Editor NEW
51.0 51.0 62.0 4.67 MB

Khalti Payment Gateway Documentation

Home Page: https://docs.khalti.com

CSS 100.00%
digital-wallet documentation epayment khalti kpg kpg2 payment-gateway-in-nepal payment-gateway-integration-nepal

docs.khalti.com's People

Contributors

aaeronn avatar aashishbaidya avatar aatishnn avatar abnormalbbk avatar acpmasquerade avatar apricots-muesli avatar ayyshim avatar bibeklekhak avatar biplab-khalti avatar chapagainmanoj avatar ishwor-shrestha avatar ludbek avatar manishmodi avatar mrshrestha0000 avatar om-ghimire avatar poudel avatar rajsubit avatar rjndra avatar sampi-ai avatar samundra avatar sarbagyastha avatar sashant-khalti avatar shirshak55 avatar sthasashant avatar swetakhalti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs.khalti.com's Issues

productUrl required

"productUrl" required, though the documentation specifies it as required : false.

Pipx has been deprecated.

If you are using pipx for managing python dependency.
The project has been handed over to another project.

I see some traces of it here. Just replace it with pip or poetry and install mkdoc using it.

One more tech debt to get rid of, yeah !!!

Invalid Token Error

I encountered an issue while using the Khalti payment gateway where I consistently receive an "Invalid token" error message, despite ensuring that the correct token_secret provided in the admin panel is being passed.

Screenshot 2024-04-17 at 10 01 51 AM

Sample successful/error response missing

It would be great and easy if there were samples for successful and error responses for each of the api calls(specially verification call) for khalti checkout.

Get Merchant Amount

Is there any rest API to get the amount of money left in merchant account?

Ruby Eg for Transaction

 uri = URI.parse("https://khalti.com/api/merchant-transaction/<idx>/") # adding the ending slash (/) prevents 301 redirects
      request = Net::HTTP::Get.new(uri)
      request["Authorization"] = "Key <key>"

      req_options = {
          use_ssl: uri.scheme == "https",
      }

      res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
        http.request(request)
      end

A working code used in Grasruts to retrieve transaction data .

missing ')' in PHP example

$args = http_build_query(array(
        'token' => 'QUao9cqFzxPgvWJNi9aKac',
        'amount'  => 1000
       );

The example is missing another closing )

Getting CORS error for epayment/initiate api while impleme khalti-epayment

added test test_secret_key on the authorization header and pointed API is https://a.khalti.com/api/v2/epayment/initiate

interface

export interface Ikhalti {
 return_url: string;
 website_url: string;
 amount: number;
 purchase_order_id: string;
 purchase_order_name: string;
 customer_info: {
   name: string;
   email: string;
   phone: string;
 },
 amount_breakdown: {
   label: string;
   amount: number;
 }[];
 product_details: {
   identity: string;
   name: string;
   total_price: number;
   quantity: number;
   unit_price: number;
 }[];
} 

used dummy from repayment docs body

   return_url: 'http://localhost:8100/tabs/home',
   website_url: 'http://localhost:8100/tabs/home',
   amount: 1300,
   purchase_order_id: 'test12',
   purchase_order_name: 'test',
   customer_info: {
     name: 'Ashim Upadhaya',
     email: '[email protected]',
     phone: '9811496763'
   },
   amount_breakdown: [
     {
       label: 'Mark Price',
       amount: 1000
     },
     {
       label: 'VAT',
       amount: 300
     }
   ],
   product_details: [
     {
       identity: '1234567890',
       name: 'Khalti logo',
       total_price: 1300,
       quantity: 1,
       unit_price: 1300
     }
   ]
 }; 

method

payment(): Observable<any> {
    const headers = new HttpHeaders();
    headers.set('Authorization', '<test_secret_key>');
    headers.set('content-type', 'application/json');
    headers.set('Access-Control-Allow-Origin', '*');
    return this.httpClient.post('https://a.khalti.com/api/v2/epayment/initiate', {body: this.body },
    {'headers':headers});
  } 

Getting CORS error for verification.

i am getting cors error while making POST request to merchant API for verification. And when i try to use reverse proxy i.e. https://cors-anywhere.herokuapp.com , i got 403 unuathorized error

Access to XMLHttpRequest at 'https://khalti.com/api/v2/payment/verify/' from origin 'http://localhost:3000/' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

while using reverse proxy
Failed to load resource: the server responded with a status of 403 (Forbidden)

Postman Collection

I think we can add postman collection so it will be easy to browse and check ??

Network Error when I try to verify from React JS

When khalti returns token for a transaction, then I tried calling the verify request to the khalti API but it says net::ERR_Failed
Here is my code reference for calling the verify request:
axios({
url: "https://khalti.com/api/v2/payment/verify/",
method: "POST",
headers: {
Authorization: "my_secret_key",
},
data: {
token: props.token, // this contains my token key provided by khalti in the response
amount: props.amount, // this contains the amount
},
})
//Here Both the token and amount along with the Authorization are correct
But I receive an error like this
b4b67e51-bf21-48a5-936e-497c7c4888fc

What is the reason behind this error?

Client side web SDK error on "#" character on GET request to initiate payment

In the client side javascript config
var config = { // replace the publicKey with yours "publicKey": "test_public_key_5", "productIdentity": "{{product.slug}}", "productName": "PRODUCT #1", "productUrl": "http://khalti.com", "paymentPreference": [ "KHALTI", "EBANKING", "MOBILE_BANKING", "CONNECT_IPS", "SCT", ], "eventHandler": { onSuccess (payload) {console.log(payload); }, onError (error) { console.log(error); }, onClose () { console.log('widget is closing'); } } };
Here the productName will cause the payment flow to crash because GET parameters does not get read due to the "#" character right in between. This will throw off an error state like sourceMobile missing.

Ruby Example for Verification

Hi guys,

If you guys are planning on to add a ruby example code, here it is:

headers = {
  Authorization: 'Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b'
 }
uri = URI.parse('https://khalti.com/api/payment/verify/')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.set_form_data('token' => params[:token], 'amount' => params[:amount])
response = https.request(request)

Editor Config?

Was trying to PR API portion but I didn't understand the convention used for writing docs. Can we create custom editor config and create contribution guide. And it will be useful to use Jekyll as we don't need to duplicate many codes.

addons for wowonder php script

hello i have buy wowonder social platform and wanted to put khalti as payment portal.can any body help in making wowonder khalti payment portal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.