Refactor PaymentService methods for clarity and consistency
- Rename methods in PaymentService for improved readability: payInvoiceWithUserWallet to payWithWallet, openExternalLightningWallet to openExternalWallet, and handlePaymentWithFallback to handlePayment. - Update related composables (useTicketPurchase, useLightningPayment) to reflect method name changes, ensuring consistent usage across the application. - Modify RelayHub initialization process to set relay URLs before calling initialize, enhancing configuration clarity. - Remove legacy compatibility flags in RelayHub to streamline the codebase and improve maintainability.
This commit is contained in:
parent
0bced11623
commit
099c16abc9
5 changed files with 33 additions and 37 deletions
|
|
@ -22,7 +22,7 @@ export function useLightningPayment() {
|
|||
async function payInvoice(paymentRequest: string, orderId?: string): Promise<boolean> {
|
||||
try {
|
||||
// Use PaymentService with custom success message
|
||||
const paymentResult = await paymentService.payInvoiceWithUserWallet(
|
||||
const paymentResult = await paymentService.payWithWallet(
|
||||
paymentRequest,
|
||||
undefined, // No specific amount requirement
|
||||
{
|
||||
|
|
@ -61,14 +61,14 @@ export function useLightningPayment() {
|
|||
|
||||
// Open external Lightning wallet (fallback) - delegate to PaymentService
|
||||
function openExternalLightningWallet(paymentRequest: string) {
|
||||
paymentService.openExternalLightningWallet(paymentRequest)
|
||||
paymentService.openExternalWallet(paymentRequest)
|
||||
}
|
||||
|
||||
// Main payment handler - tries wallet first, falls back to external
|
||||
async function handlePayment(paymentRequest: string, orderId?: string): Promise<void> {
|
||||
try {
|
||||
// Use PaymentService's automatic fallback handling
|
||||
const result = await paymentService.handlePaymentWithFallback(
|
||||
const result = await paymentService.handlePayment(
|
||||
paymentRequest,
|
||||
undefined, // No specific amount requirement
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue