Skip to content

Commit 527347c

Browse files
committed
Migrate to initTransaction v2
1 parent 590f8e7 commit 527347c

5 files changed

Lines changed: 7 additions & 18 deletions

File tree

src/app/core/models/InitializedTransaction.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ export type InitializedTransaction = {
44
client_id: string,
55
request_uri: string,
66
request_uri_method: RequestUriMethod,
7-
transaction_id: string
7+
transaction_id: string,
8+
authorization_request_uri: string
89
}

src/app/core/services/verifier-endpoint.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {ActiveTransaction} from "@core/models/ActiveTransaction";
1414
import { SessionStorageService } from './session-storage.service';
1515

1616
const SAME_DEVICE_UI_RE_ENTRY_URL = '/get-wallet-code?response_code={RESPONSE_CODE}';
17-
const PRESENTATIONS_ENDPOINT = 'ui/presentations';
17+
const PRESENTATIONS_ENDPOINT = 'ui/presentations/v2';
1818
const VALIDATE_SD_JWT_VC_PRESENTATION_ENDPOINT = 'utilities/validations/sdJwtVc';
1919

2020
@Injectable()

src/app/features/invoke-wallet/components/qr-code/qr-code.component.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { MatButtonModule } from '@angular/material/button';
2020
import { MatCardModule } from '@angular/material/card';
2121
import { MatDividerModule } from '@angular/material/divider';
2222
import {MatProgressBarModule} from '@angular/material/progress-bar';
23-
import { RequestUriMethod } from '@app/core/models/TransactionInitializationRequest';
2423

2524
@Component({
2625
selector: 'vc-qr-code',
@@ -51,7 +50,7 @@ export class QrCodeComponent implements OnInit, OnDestroy {
5150
transaction!: ActiveTransaction;
5251

5352
deepLinkTxt!: string;
54-
scheme!: string;
53+
5554
qrCodeDownloadLink!: SafeUrl;
5655
readonly dialog!: MatDialog;
5756

@@ -70,12 +69,6 @@ export class QrCodeComponent implements OnInit, OnDestroy {
7069
this.localStorageService = this.injector.get(LocalStorageService);
7170
this.dialog = this.injector.get(MatDialog);
7271
this.isCrossDevice = this.deviceDetectorService.isDesktop();
73-
74-
if (this.localStorageService.get(constants.SCHEME)) {
75-
this.scheme = this.localStorageService.get(constants.SCHEME) ?? constants.DEFAULT_SCHEME;
76-
} else {
77-
this.scheme = constants.DEFAULT_SCHEME;
78-
}
7972
}
8073

8174
ngOnInit(): void {
@@ -85,7 +78,7 @@ export class QrCodeComponent implements OnInit, OnDestroy {
8578
if (!this.transaction) {
8679
this.navigateService.goHome();
8780
} else {
88-
this.deepLinkTxt = this.buildQrCode(this.transaction.initialized_transaction);
81+
this.deepLinkTxt = this.transaction.initialized_transaction.authorization_request_uri;
8982
if (this.isCrossDevice) {
9083
this.pollingRequest(this.transaction.initialized_transaction.transaction_id);
9184
}
@@ -132,10 +125,6 @@ export class QrCodeComponent implements OnInit, OnDestroy {
132125
return concludedTransaction;
133126
}
134127

135-
private buildQrCode(data: { client_id: string, request_uri: string, request_uri_method: RequestUriMethod, transaction_id: string }): string {
136-
return `${this.scheme}?client_id=${encodeURIComponent(data.client_id)}&request_uri=${encodeURIComponent(data.request_uri)}&request_uri_method=${encodeURIComponent(data.request_uri_method)}`;
137-
}
138-
139128
openLogs() {
140129
this.dialog.open(OpenLogsComponent, {
141130
data: {

src/app/features/presentation-request-preparation/home/home.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h4>Define your presentation request</h4>
3434

3535
<mat-step>
3636
<div style="padding-top: 10px">
37-
<ng-template matStepLabel>...select request options and submit</ng-template>
37+
<ng-template matStepLabel>...select presentation options and submit</ng-template>
3838

3939
<vc-presentation-options
4040
[presentationProfileControl]="presentationProfileControl"
@@ -62,7 +62,7 @@ <h4>Define your presentation request</h4>
6262
</div>
6363
<div class="button-container">
6464
<button mat-raised-button matStepperPrevious type="button">Back</button>
65-
<button mat-raised-button matStepperNext type="button" (click)="proceedToInvokeWallet()" [disabled]="!canProceed()">Next
65+
<button mat-raised-button matStepperNext type="button" (click)="proceedToInvokeWallet()" [disabled]="!canProceed()">Submit
6666
</button>
6767
</div>
6868
</mat-step>

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
},
4949
"types": [
5050
"jest",
51-
"node_modules/@types",
5251
"node"
5352
]
5453
},

0 commit comments

Comments
 (0)