Skip to content

Commit 2acc6c4

Browse files
chore: use real payment data
1 parent 9dbed6e commit 2acc6c4

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

dapps/pos-app/app/payment-success.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { StatusBar } from "expo-status-bar";
2121

2222
interface SuccessParams extends UnknownOutputParams {
2323
amount: string;
24-
network: string;
24+
chainName: string;
2525
token: string;
2626
timestamp: string;
2727
paymentId: string;
@@ -118,7 +118,7 @@ export default function PaymentSuccessScreen() {
118118
params.paymentId,
119119
Number(amount),
120120
params.token,
121-
params.network,
121+
params.chainName,
122122
params.timestamp,
123123
)
124124
}

dapps/pos-app/app/scan.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Spacing } from "@/constants/spacing";
88
import { useTheme } from "@/hooks/use-theme-color";
99
import { useSettingsStore } from "@/store/useSettingsStore";
1010
import { resetNavigation } from "@/utils/navigation";
11+
import { PaymentStatusSuccessResponse } from "@/utils/types";
1112
import { useAssets } from "expo-asset";
1213
import { Image } from "expo-image";
1314
import { router, UnknownOutputParams, useLocalSearchParams } from "expo-router";
@@ -31,16 +32,18 @@ export default function QRModalScreen() {
3132

3233
const { amount } = params;
3334

34-
const onSuccess = useCallback(() => {
35+
const onSuccess = useCallback((data: PaymentStatusSuccessResponse) => {
36+
const { paymentId, chainName, token, amount, createdAt } = data;
37+
3538
router.dismiss();
3639
router.replace({
3740
pathname: "/payment-success",
3841
params: {
3942
amount,
4043
paymentId,
41-
network: "Base",
42-
token: "USDC",
43-
timestamp: new Date().toISOString(),
44+
chainName,
45+
token,
46+
timestamp: new Date(createdAt * 1000).toISOString(),
4447
},
4548
});
4649
}, [amount, paymentId]);
@@ -98,7 +101,7 @@ export default function QRModalScreen() {
98101
enabled: !!paymentId && !isLoading,
99102
onTerminalState: (data) => {
100103
if (data.status === "completed") {
101-
onSuccess();
104+
onSuccess(data);
102105
} else if (data.status === "failed") {
103106
onFailure(data.error);
104107
}

dapps/pos-app/app/settings.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ export default function Settings() {
3333
showErrorToast("Failed to connect to printer");
3434
return;
3535
}
36-
await printWalletConnectReceipt("1234567890", 15, "USDC", "Base");
36+
await printWalletConnectReceipt(
37+
"69e4355c-e0d3-42d6-b63b-ce82e23b68e9",
38+
15,
39+
"USDC",
40+
"Base",
41+
);
3742
} catch (error) {
3843
console.error("Failed to test printer:", error);
3944
}

0 commit comments

Comments
 (0)