Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .brotasks/default.sh

This file was deleted.

Binary file removed .icons/img/favicon.png
Binary file not shown.
Binary file removed .icons/img/khalti_logo.png
Binary file not shown.
60 changes: 0 additions & 60 deletions .icons/img/khalti_logo.png.svg

This file was deleted.

Binary file removed .icons/img/logo.png
Binary file not shown.
91 changes: 46 additions & 45 deletions content/api/transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Replace `<secret key>` with test or live secret key as per required.

**Response** is paginated and in the following format:

```python
```json
{
"total_pages": 1,
"total_records": 2,
Expand Down Expand Up @@ -82,60 +82,61 @@ Replace `<secret key>` with test or live secret key as per required.

## API Request Examples

### CURL
=== "cURL"

```curl
curl https://khalti.com/api/v2/merchant-transaction/ -H "Authorization:Key <secret key>
```
``` bash
curl https://khalti.com/api/v2/merchant-transaction/ \
-H "Authorization:Key <secret key>
```

### PHP
```php
$url = "https://khalti.com/api/v2/merchant-transaction/";
=== "php"

# Make the call using API.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
``` php
<?php
$url = "https://khalti.com/api/v2/merchant-transaction/";

$headers = ['Authorization: Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b'];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

// Response
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
# Make the call using API.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

```
$headers = ['Authorization: Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b'];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

### Python
// Response
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
```

```python
import requests
=== "Python"

url = "https://khalti.com/api/v2/merchant-transaction/"
payload = {}
headers = {
"Authorization": "Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b"
}

response = requests.get(url, payload, headers = headers)
```
``` python
import requests

url = "https://khalti.com/api/v2/merchant-transaction/"
payload = {}
headers = {
"Authorization": "Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b"
}

### Ruby
response = requests.get(url, payload, headers = headers)
```

```ruby
require 'uri'
require 'net/http'
=== "Ruby"

headers = {
Authorization: "Key live_secret_key_fc1207298be544b99fa3ad41c7d7b324"
}
uri = URI.parse("https://khalti.com/api/v2/merchant-transaction/")
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri, headers)
response = https.request(request)
``` ruby
require 'uri'
require 'net/http'

puts response.body
```
headers = {
Authorization: "Key live_secret_key_fc1207298be544b99fa3ad41c7d7b324"
}
uri = URI.parse("https://khalti.com/api/v2/merchant-transaction/")
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri, headers)
response = https.request(request)

puts response.body
```
90 changes: 45 additions & 45 deletions content/api/transaction_details.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Replace `<secret key>` with test or live secret key as per required.

**Response** is in the following format:

```python
```json
{
"idx": "xeR2tuRqEvBLmeJcZzMb5U",
"type": {
Expand Down Expand Up @@ -81,60 +81,60 @@ Replace `<secret key>` with test or live secret key as per required.

## API Request Examples

###CURL
=== "cURL"

```curl
curl https://khalti.com/api/v2/merchant-transaction/<idx>/ -H "Authorization:Key <secret key>
```

### PHP
```php

$url = "https://khalti.com/api/v2/merchant-transaction/<idx>/";
``` bash
curl https://khalti.com/api/v2/merchant-transaction/<idx>/ \
-H "Authorization:Key <secret key>
```

# Make the call using API.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
=== "php"

$headers = ['Authorization: Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b'];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
``` php
<?php
$url = "https://khalti.com/api/v2/merchant-transaction/<idx>/";

// Response
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
# Make the call using API.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

```
$headers = ['Authorization: Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b'];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

### Python
// Response
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
```

```python
import requests

url = "https://khalti.com/api/v2/merchant-transaction/<idx>/"
headers = {
"Authorization": "Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b"
}
=== "Python"

response = requests.get(url, headers = headers)
```
``` python
import requests

url = "https://khalti.com/api/v2/merchant-transaction/<idx>/"
headers = {
"Authorization": "Key test_secret_key_f59e8b7d18b4499ca40f68195a846e9b"
}

### Ruby
response = requests.get(url, headers = headers)
```

```ruby
require 'uri'
require 'net/http'
=== "Ruby"

headers = {
Authorization: "Key live_secret_key_fc1207298be544b99fa3ad41c7d7b324"
}
uri = URI.parse("https://khalti.com/api/v2/merchant-transaction/<idx>/")
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri, headers)
response = https.request(request)
``` ruby
require 'uri'
require 'net/http'

puts response.body
```
headers = {
Authorization: "Key live_secret_key_fc1207298be544b99fa3ad41c7d7b324"
}
uri = URI.parse("https://khalti.com/api/v2/merchant-transaction/<idx>/")
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri, headers)
response = https.request(request)

puts response.body
```
Loading