| Sessions flow |
-
+ |
- To make `\sessions` API call use `AdyenDropIn.getReturnURL()` to fetch `returnUrl`.
+To make `\sessions` API call use `AdyenDropIn.getReturnURL()` to fetch `returnUrl`.
- ```js
- const returnUrl = Platform.select({
- ios: 'myapp://payment',
- android: await AdyenDropIn.getReturnURL(),
- });
- ```
+```js
+const returnUrl = Platform.select({
+ ios: 'myapp://payment',
+ android: await AdyenDropIn.getReturnURL(),
+});
+```
|
@@ -293,19 +289,21 @@ const MyCheckoutView = () => {
};
```
-### Sessions flow
+### Sessions Flow
```javascript
import { AdyenCheckout } from '@adyen/react-native';
import { useCallback } from 'react';
- const onComplete = useCallback( (result, nativeComponent ) => {
- /* When this callbeck executed, you must call `component.hide(true | false)` to dismiss the payment UI. */
- }, [some, dependency]);
- const onError = useCallback( (error, component) => {
- /* Handle errors or termination by shopper */
- /* When the API request is completed, you must now call `component.hide(false)` to dismiss the payment UI. */
- }, []);
+const onComplete = useCallback((result, component) => {
+ // Payment was completed - call `component.hide(true)` to dismiss the payment UI.
+ // Call /sessions/(sessionId)?sessionResult={result} API to get more information about the payment outcome.
+}, []);
+
+const onError = useCallback((error, component) => {
+ // Payment was terminated by shopper or encountered an error
+ // Call `component.hide(false)` to dismiss the payment UI.
+}, []);