This commit is contained in:
2026-05-05 14:43:09 +04:00
parent 5eb7b2dcba
commit fb6e00c00b
2 changed files with 22 additions and 14 deletions

View File

@@ -34,10 +34,12 @@ interface QrStatusResponse {
}
interface CreateFastcheckResponse {
fastcheck: string;
expiration: string;
code: string;
Status: boolean;
id?: string; // real field name from server
fastcheck?: string; // per API doc fallback
expiration?: string;
code?: string;
amount?: number;
Status?: boolean;
}
/** Generate a v4-like UUID without crypto dependency. */
@@ -225,15 +227,17 @@ export class CreatePage {
)
.subscribe({
next: (res) => {
if (res?.fastcheck) {
this.store.setCreated({
fastcheck: res.fastcheck,
code: res.code,
amount: this.amount() ?? null,
expiration: res.expiration
});
const fcNumber = res?.id ?? res?.fastcheck ?? '';
const payload = {
fastcheck: fcNumber,
code: res?.code ?? '',
amount: res?.amount ?? this.amount() ?? null,
expiration: res?.expiration
};
if (fcNumber) {
this.store.setCreated(payload);
}
this.router.navigate(['/']);
this.router.navigate(['/'], { state: fcNumber ? payload : {} });
},
error: () => this.router.navigate(['/'])
});