diff --git a/example/App.tsx b/example/App.tsx
index 96c3ed8..307aef2 100644
--- a/example/App.tsx
+++ b/example/App.tsx
@@ -35,7 +35,7 @@ function App(): React.JSX.Element {
-
+
{loading ? : null}
diff --git a/example/PaymentScreen.tsx b/example/PaymentScreen.tsx
index 84c6795..861a6cb 100644
--- a/example/PaymentScreen.tsx
+++ b/example/PaymentScreen.tsx
@@ -18,8 +18,10 @@ export enum CurrencyTypes {
}
const PaymentScreen = ({
+ language,
setLoading,
}: {
+ language: string;
setLoading: Dispatch>;
}) => {
const [amount, setAmount] = useState('');
@@ -37,7 +39,7 @@ const PaymentScreen = ({
}
// fetch a session Id to initiate payment
- const sessionId = await createSession({amount, currency});
+ const sessionId = await createSession({amount, currency, language});
setLoading(false);
// invoke createPayment method with sessionId as parameters to open the payment portal
diff --git a/example/services/sessionService.ts b/example/services/sessionService.ts
index a69148f..02f6b1e 100644
--- a/example/services/sessionService.ts
+++ b/example/services/sessionService.ts
@@ -7,11 +7,13 @@ import {CREATE_SESSION_URL} from './constants';
type createSessionProps = {
amount: string;
currency: string;
+ language: string;
};
const createSession = async ({
amount,
currency,
+ language,
}: createSessionProps): Promise => {
try {
const options = {
@@ -23,6 +25,7 @@ const createSession = async ({
body: JSON.stringify({
amount,
currency,
+ language,
}),
};
const response = await fetch(CREATE_SESSION_URL, options);