Skip to content

Commit

Permalink
Merge pull request #67 from khalti/Ishwor-Shrestha/update/android-ret…
Browse files Browse the repository at this point in the history
…urn-url-note

Add note for return_url in `android.md`
  • Loading branch information
Ishwor-Shrestha committed Apr 4, 2024
2 parents 120e5af + 72edf12 commit c51a500
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions content/checkout/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ Khalti.init(

> Note : Make sure the context you passed to `Khalti` can be used to open an activity.
> Note: Make sure you are passing the exact same value for `returnUrl` that you used while requesting for `pidx`
##### Callbacks

| Callback | Description |
| :------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `onPaymentResult(result: PaymentResult, khalti: Khalti)` | Invoked on completion of payment. Inside this callback you'll have access to `PaymentResult` object and `Khalti` object<br><br>After completion of payment process, `khalti` will internally trigger the verification API. It's result is then propagated through the `onPaymentResult` callback. You'll receive an object of `PaymentResult`.<br> |
| `onMessage(payload: OnMessagePayload, khalti: Khalti)` | Invoked on failures and exceptions at any point of time. Inside this callback you'll have access to `OnMessagePayload` and `Khalti` object<br><br>`OnMessagePalyload` contains `onMessageEvent` that dictates what type of event triggered the callback. It also contains a flag `needsPaymentConfirmation` which if `true` indicates that you must verify the status of the payment. It can be done through the `Khalti` object passed to this callback. Use `khalti.verify()`. |
| `onReturn(khalti: Khalti)` | This is an optional callback that is invoked when `return_url`'s page is successfully loaded. Inside this callback you'll have access to `Khalti` object
| Callback | Description |
| :------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `onPaymentResult(result: PaymentResult, khalti: Khalti)` | Invoked on completion of payment. Inside this callback you'll have access to `PaymentResult` object and `Khalti` object<br><br>After completion of payment process, `khalti` will internally trigger the verification API. It's result is then propagated through the `onPaymentResult` callback. You'll receive an object of `PaymentResult`.<br> |
| `onMessage(payload: OnMessagePayload, khalti: Khalti)` | Invoked on failures and exceptions at any point of time. Inside this callback you'll have access to `OnMessagePayload` and `Khalti` object<br><br>`OnMessagePalyload` contains `onMessageEvent` that dictates what type of event triggered the callback. It also contains a flag `needsPaymentConfirmation` which if `true` indicates that you must verify the status of the payment. It can be done through the `Khalti` object passed to this callback. Use `khalti.verify()`.<br><br>`onMessage` should not be considered as an error by itself. Always consult the `OnMessageEvent` for further clarification. |
| `onReturn(khalti: Khalti)` | This is an optional callback that is invoked when `return_url`'s page is successfully loaded. Inside this callback you'll have access to `Khalti` object

#### Schema
```
Expand Down

0 comments on commit c51a500

Please sign in to comment.