@@ -329,12 +329,36 @@ function initRegisterPage() {
329329 // Show success message with payment information
330330 const paymentAddress = subscriptionData . subscription . payment_address ;
331331 const amount = subscriptionData . subscription . amount ;
332+ const cryptoAmount = subscriptionData . subscription . crypto_amount ? subscriptionData . subscription . crypto_amount . toFixed ( 8 ) : 'calculating...' ;
332333 const coin = subscriptionData . subscription . payment_method . toUpperCase ( ) ;
333334
334- alert ( `Registration successful! Please send ${ amount } USD worth of ${ coin } to: ${ paymentAddress } ` ) ;
335-
336- // Redirect to the API keys page
337- window . router . navigate ( '/api-keys' ) ;
335+ // Enhanced dialog with the payment information and copyable fields
336+ PfDialog . alert ( `
337+ <div class="payment-success">
338+ <h3 style="color: #2563eb; margin-bottom: 15px;">Registration Successful!</h3>
339+ <p style="margin-bottom: 20px;">Please send <strong>${ amount } USD</strong> (<strong>${ cryptoAmount } ${ coin } </strong>) to the address below:</p>
340+
341+ <div style="margin-bottom: 15px;">
342+ <label style="display: block; font-weight: 600; margin-bottom: 5px;">Amount:</label>
343+ <div style="display: flex; align-items: center;">
344+ <input type="text" value="${ cryptoAmount } ${ coin } " readonly
345+ style="flex: 1; padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; background-color: #f9fafb;">
346+ <button onclick="navigator.clipboard.writeText('${ cryptoAmount } ${ coin } ').then(() => this.textContent = 'Copied!'); setTimeout(() => this.textContent = 'Copy', 2000)"
347+ style="margin-left: 8px; padding: 8px 12px; background-color: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer;">Copy</button>
348+ </div>
349+ </div>
350+
351+ <div style="margin-bottom: 15px;">
352+ <label style="display: block; font-weight: 600; margin-bottom: 5px;">Address:</label>
353+ <div style="display: flex; align-items: center;">
354+ <input type="text" value="${ paymentAddress } " readonly
355+ style="flex: 1; padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; background-color: #f9fafb;">
356+ <button onclick="navigator.clipboard.writeText('${ paymentAddress } ').then(() => this.textContent = 'Copied!'); setTimeout(() => this.textContent = 'Copy', 2000)"
357+ style="margin-left: 8px; padding: 8px 12px; background-color: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer;">Copy</button>
358+ </div>
359+ </div>
360+ </div>
361+ ` , 'Payment Details' , ( ) => window . router . navigate ( '/api-keys' ) , 'Continue' ) ;
338362 } catch ( error ) {
339363 console . error ( 'Registration error:' , error ) ;
340364 submitButton . textContent = originalButtonText ;
0 commit comments