@@ -9,15 +9,15 @@ import {
99 WidgetController ,
1010} from './controller'
1111import type { WidgetConfig } from './types'
12- import { PaymentConfirmation } from './views/confirmation/confirmation'
12+ import { PaymentInitiate } from './views/confirmation/confirmation'
1313import { HomeView , type SubmitEventDetail } from './views/home/home'
14- import { PaymentInteraction } from './views/interaction/interaction'
14+ import { PaymentWaiting } from './views/interaction/interaction'
1515import styles from './widget.css?raw'
1616
1717const COMPONENTS = {
1818 'wm-payment-home' : HomeView ,
19- 'wm-payment-confirmation ' : PaymentConfirmation ,
20- 'wm-payment-interaction ' : PaymentInteraction ,
19+ 'wm-payment-initiate ' : PaymentInitiate ,
20+ 'wm-payment-waiting ' : PaymentWaiting ,
2121}
2222
2323export class PaymentWidget extends LitElement {
@@ -38,7 +38,7 @@ export class PaymentWidget extends LitElement {
3838
3939 @property ( { type : Boolean } ) isOpen = false
4040
41- @state ( ) private currentView : 'home' | 'confirmation ' | 'interact ' = 'home'
41+ @state ( ) private currentView : 'home' | 'initiate ' | 'waiting ' = 'home'
4242
4343 static styles = unsafeCSS ( styles )
4444
@@ -70,7 +70,7 @@ export class PaymentWidget extends LitElement {
7070 walletAddress : walletInfo ,
7171 receiver : await this . #receiver,
7272 } )
73- this . currentView = 'confirmation '
73+ this . currentView = 'initiate '
7474 } catch ( error ) {
7575 return error instanceof Error
7676 ? error . message
@@ -97,24 +97,24 @@ export class PaymentWidget extends LitElement {
9797 }
9898
9999 private handleInteractionCancelled ( ) {
100- this . currentView = 'confirmation '
100+ this . currentView = 'initiate '
101101 }
102102
103103 private renderCurrentView ( ) {
104104 switch ( this . currentView ) {
105105 case 'home' :
106106 return this . renderHomeView ( )
107- case 'confirmation ' :
108- return this . renderConfirmationView ( )
109- case 'interact ' :
110- return this . renderInteractionView ( )
107+ case 'initiate ' :
108+ return this . renderInitiateView ( )
109+ case 'waiting ' :
110+ return this . renderWaitingView ( )
111111 default :
112112 return this . renderHomeView ( )
113113 }
114114 }
115115
116116 private navigateToInteraction ( ) {
117- this . currentView = 'interact '
117+ this . currentView = 'waiting '
118118 }
119119
120120 private navigateToHome ( ) {
@@ -136,27 +136,29 @@ export class PaymentWidget extends LitElement {
136136 `
137137 }
138138
139- private renderConfirmationView ( ) {
139+ private renderInitiateView ( ) {
140140 return html `
141- < wm-payment-confirmation
141+ < wm-payment-initiate
142142 .configController =${ this . configController }
143143 .controller =${ this . #controller}
144144 .note=${ this . config . note || '' }
145145 @back=${ this . navigateToHome }
146146 @close=${ this . toggleWidget }
147147 @payment-confirmed=${ this . navigateToInteraction }
148- > </ wm-payment-confirmation >
148+ > </ wm-payment-initiate >
149149 `
150150 }
151151
152- private renderInteractionView ( ) {
152+ private renderWaitingView ( ) {
153+ const { paymentId, grantRedirectUrl } = this . configController . state
153154 return html `
154- < wm-payment-interaction
155- .configController =${ this . configController }
155+ < wm-payment-waiting
156+ .paymentId =${ paymentId }
157+ .grantRedirectUrl =${ grantRedirectUrl }
156158 .controller=${ this . #controller}
157159 @interaction-cancelled=${ this . handleInteractionCancelled }
158160 @back=${ this . navigateToHome }
159- > </ wm-payment-interaction >
161+ > </ wm-payment-waiting >
160162 `
161163 }
162164
0 commit comments