---
page_title: 4. Handle Payment Response
product: Hypercheckout
platform: Cordova
page_source: https://juspay.io/in/docs/hyper-checkout/cordova/base-sdk-integration/handle-payment-response
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/hyper-checkout/llms.txt
---


# 4. Handle Payment Response




### Step 4.1. Handle Payment Events from SDK


All payment responses are sent by the SDK in the hyperSDKCallback under the `process_result`event. Implement the highlighted code snippet in your app for proper handling of all events and status



#### Code Snippets: -

#### Javascript Code Snippet:

```javascript
{"success":false,"message":"Failed to fetch snippet"}
```



### Step 4.2. Check Payment Status


After receiving `process_result` from SDK, it is mandatory to do a Server-to-Server Order Status API call to determine the final payment status. Please ensure that you verify the order ID and amount transaction.

To understand how to handle payment status, [refer to this section](/hyper-checkout/cordova/resources/transaction-status)

![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/hyper-checkout/payment_status_handling.png)

### Mermaid code for the above image

```mermaid
flowchart TD
    1[1. Transaction completed on bank page]

    1 -->|On App/I-Frame Web| 2_1[2.1 SDK gives callback in process_result]
    1 -->|On Web| 2_2[2.2 User is redirected to RETURN_URL]

    2_1 --> 4
    2_2 --> 4
    2_1 -.->|Asynchronously| 3[3. Asynchronously listen for webhooks]
    2_2 -.->|Asynchronously| 3

    4[4. Call Order Status S2S API]

    4 -->|Status = CHARGED| 5[5. Show Success Screen & Fulfill order]
    4 -->|Status = AUTHORIZATION_FAILED / AUTHENTICATION_FAILED| 6[6. Show Failure Screen & decline the order]
    4 -->|Status = PENDING_VBV / AUTHORIZING| OFW{Order Fulfillment Window Over?}

    OFW -->|No| 7[7. Show Pending Screen]
    7 -->|After 10 Seconds| 4

    OFW -->|Yes| 8[8. Show Failure Screen & decline the order]

    8 -.-> SWR{Success Webhook Received post fulfillment window?}

    SWR -.-> 9[9. Do Manual Refund from Juspay Dashboard]
    SWR -.-> 10[10. Do Refund via Refund API]
    SWR -.-> 11[11. Handle Refund via Auto-Refund Feature]

    style 5 fill:#00897B,color:#fff
    style 6 fill:#E91E63,color:#fff
    style 7 fill:#FFC107,color:#000
    style 8 fill:#E91E63,color:#fff
```





#### Code Snippets: -

#### Javascript Code Snippet:

```javascript
{"success":false,"message":"Failed to fetch snippet"}
```



### Step 4.3. Display Payment Status


Once the payment status is determined via the API, the final status should be displayed to the user. This screen needs to be handled by the merchant, it is not provided by the SDK



#### Code Snippets: -

#### Javascript Code Snippet:

```javascript
{"success":false,"message":"Failed to fetch snippet"}
```


---

## Complete Code Reference

The following code files are referenced in the steps above:

### snippets.txt

```
{"success":false,"message":"Failed to fetch snippet"}
```


---

## See Also

- [3. Open Hypercheckout Screen](https://juspay.io/in/docs/hyper-checkout/cordova/base-sdk-integration/open-hypercheckout-screen)
- [Introduction](https://juspay.io/in/docs/hyper-checkout/cordova/mandates/introduction)
