Skip to content

Commit

Permalink
Merge pull request #30 from om-ghimire/main
Browse files Browse the repository at this point in the history
Updated Service layer status
  • Loading branch information
omG-himire authored Nov 13, 2024
2 parents 387d9db + 0602534 commit 2d2b73d
Show file tree
Hide file tree
Showing 107 changed files with 15,869 additions and 6,387 deletions.
1 change: 0 additions & 1 deletion content/Bus/bus-booking.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This document describes the API for booking a bus ticket. The API allows users t
<pre><code class="json">
{
"token: "{{live_token}}",
"reference": "{{$guid}}",
"session_id": "{{session_id}}",
"bus_id": "{{bus_id}}",
"seats": "["{{seat1}}", "{{seat2}}"] (array of selected seats)"
Expand Down
1 change: 0 additions & 1 deletion content/Bus/seat.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This document describes the API for retrieving seating information for a specifi
"token":"{{token}}",
"bus_id": "{{bus_id}}",
"session_id": "{{session_id}}",
"reference": "{{$guid}}"
</code></pre>
## API Response

Expand Down
9 changes: 6 additions & 3 deletions content/Servicescodes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
## **Change Log**

**Version 6.9, Novemeber 12 2024**

**Version 6.7 October 24 2024**
* Updated Service layer status

**Version 6.8 October 24 2024**

* Updated Typo mistake in document
* Updated Typo mistake


**Version 6.7 October 24 2024**

* Added Bus v2 APi in docs
* Added Bus v2 API

* Added Max tv

Expand Down
39 changes: 39 additions & 0 deletions content/Servicescodes/dlr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# DLR Sample

<pre><code class="json">
Content-Type: multipart/form-data
{
"reference": "Unique id sent by you",
"amount": "amount",
"status": "status",
"detail": "detail regarding the service",
"response_id": "response id from ntc/ncell or other provider"
}
</code></pre>


**NOTE ON FIELD VALIDATION** : Enforce a length of 50 alphanumeric characters as a default validation unless explicitly mentioned.

## **Service Layer State**

| HTTP Response Code | Status | act | Remarks |
| :---- | :---- | :---- | :---- |
| 200 | Success | Check state in response data and proceed based on state | Check state in response data and proceed based on state |
| 400 | Error | Hold | Need to check the transaction state to proceed. |
| 404 | Error | Refund | Service not found |
| \>= 500 | Server error | Hold | Server is failed to provide the response **Third Party should hold the transaction and call lookup api after at least 5 mins to get transaction status to proceed further** |
| Other any status code or No status code received | Timeout | Hold | Server is failed to provide the response **Third Party should hold the transaction and call lookup api after at least 5 mins to get transaction status to proceed further** |




| State | Act | Description |
| :---- | :---- | :---- |
| Success | Process | Transaction Successful. **Deduct Client amount** |
| Queued | Hold | Transaction in pending state. **Third Party should hold the transaction and call lookup api after at least after 5 mins to get transaction status to proceed further** |
| Processing | Hold | Transaction in pending state. **Third Party should hold the transaction and call lookup api after atleast 5 mins to get transaction status to proceed further** |
| Expired | Refund | Transaction not possible. **Refund client amount** |
| Error | Refund | Transaction error. **Refund Client amount** |
| Failed | Refund | Transaction Error. **Refund Client amount.** |
| Any other state or no state received | Hold | Server is failed the provide the response **Third Party should hold the transaction and call lookup api after atleast 5 mins to get transaction status to proceed further** |
| Timeout | Hold | **Third Party should hold the transaction and call lookup api after atleast 5 mins to get transaction status to proceed further** |
46 changes: 3 additions & 43 deletions content/Servicescodes/statecode.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Transaction Processing Guide

## State List

# State List

| **State** | **Description** | **Action Required** |
|----------------|--------------------------------------------------------|----------------------------------|
Expand All @@ -21,44 +21,4 @@

- **State Handling**:
- If the state is **Queued** or **Processing**, you will receive the final status of the transaction in the DLR callback later.
- If the state is **Success**, **Failed**, or **Error**, take action based on the state immediately. No need to wait for DLR.

## DLR Sample

<pre><code class="json">
Content-Type: multipart/form-data
{
"reference": "Unique id sent by you",
"amount": "amount",
"status": "status",
"detail": "detail regarding the service",
"response_id": "response id from ntc/ncell or other provider"
}
</code></pre>


**NOTE ON FIELD VALIDATION** : Enforce a length of 50 alphanumeric characters as a default validation unless explicitly mentioned.

## **Service Layer State**

| HTTP Response Code | Status | act | Remarks |
| :---- | :---- | :---- | :---- |
| 200 | Success | Check state in response data and proceed based on state | Check state in response data and proceed based on state |
| 400 | Error | Hold | Need to check the transaction state to proceed. |
| 404 | Error | Refund | Service not found |
| \>= 500 | Server error | Hold | Server is failed to provide the response **Third Party should hold the transaction and call lookup api after at least 5 mins to get transaction status to proceed further** |
| Other any status code or No status code received | Timeout | Hold | Server is failed to provide the response **Third Party should hold the transaction and call lookup api after at least 5 mins to get transaction status to proceed further** |




| State | Act | Description |
| :---- | :---- | :---- |
| Success | Process | Transaction Successful. **Deduct Client amount** |
| Queued | Hold | Transaction in pending state. **Third Party should hold the transaction and call lookup api after at least after 5 mins to get transaction status to proceed further** |
| Processing | Hold | Transaction in pending state. **Third Party should hold the transaction and call lookup api after atleast 5 mins to get transaction status to proceed further** |
| Expired | Refund | Transaction not possible. **Refund client amount** |
| Error | Refund | Transaction error. **Refund Client amount** |
| Failed | Refund | Transaction Error. **Refund Client amount.** |
| Any other state or no state received | Hold | Server is failed the provide the response **Third Party should hold the transaction and call lookup api after atleast 5 mins to get transaction status to proceed further** |
| Timeout | Hold | **Third Party should hold the transaction and call lookup api after atleast 5 mins to get transaction status to proceed further** |
- If the state is **Success**, **Failed**, or **Error**, take action based on the state immediately. No need to wait for DLR.
4 changes: 2 additions & 2 deletions content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# **Khalti Services Documentation**


## *Version 6.8*
## *Version 6.9*

## *Last Update 28 October, 2024*
## *Last Update 12 Novemeber, 2024*

**Check the [Change Log]( Servicescodes/changelog.md) here.**

Expand Down
189 changes: 128 additions & 61 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,146 @@







<li class="md-nav__item md-nav__item--nested">



<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >


<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">


<span class="md-ellipsis">
Service Status Check
</span>


<span class="md-nav__icon md-icon"></span>
</label>

<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Service Status Check
</label>
<ul class="md-nav__list" data-md-scrollfix>







<li class="md-nav__item">
<a href="/Servicescodes/statecode/" class="md-nav__link">


<span class="md-ellipsis">
Service Layer State
State List
</span>


</a>
</li>










<li class="md-nav__item">
<a href="/Servicescodes/dlr/" class="md-nav__link">


<span class="md-ellipsis">
DLR
</span>


</a>
</li>










<li class="md-nav__item">
<a href="/Servicescodes/balance_check/" class="md-nav__link">


<span class="md-ellipsis">
Service Balance Check
</span>


</a>
</li>










<li class="md-nav__item">
<a href="/Servicescodes/lookup/" class="md-nav__link">


<span class="md-ellipsis">
Service LookUp API
</span>


</a>
</li>










<li class="md-nav__item">
<a href="/Servicescodes/bulkservice/" class="md-nav__link">


<span class="md-ellipsis">
Bulk Service Lookup
</span>


</a>
</li>




</ul>
</nav>

</li>





Expand Down Expand Up @@ -2632,66 +2759,6 @@



<li class="md-nav__item">
<a href="/Servicescodes/balance_check/" class="md-nav__link">


<span class="md-ellipsis">
Service Balance Check
</span>


</a>
</li>









<li class="md-nav__item">
<a href="/Servicescodes/lookup/" class="md-nav__link">


<span class="md-ellipsis">
Service LookUp API
</span>


</a>
</li>









<li class="md-nav__item">
<a href="/Servicescodes/bulkservice/" class="md-nav__link">


<span class="md-ellipsis">
Bulk Service Lookup
</span>


</a>
</li>









<li class="md-nav__item">
<a href="/Servicescodes/changelog/" class="md-nav__link">

Expand Down
Loading

0 comments on commit 2d2b73d

Please sign in to comment.