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
|
|
@ -130,7 +130,7 @@ export class PaymentService extends BaseService {
|
|||
/**
|
||||
* Pay Lightning invoice with user's wallet
|
||||
*/
|
||||
async payInvoiceWithUserWallet(
|
||||
async payWithWallet(
|
||||
paymentRequest: string,
|
||||
requiredAmountSats?: number,
|
||||
options: PaymentOptions = {}
|
||||
|
|
@ -194,7 +194,7 @@ export class PaymentService extends BaseService {
|
|||
/**
|
||||
* Open external Lightning wallet
|
||||
*/
|
||||
openExternalLightningWallet(paymentRequest: string): void {
|
||||
openExternalWallet(paymentRequest: string): void {
|
||||
if (!paymentRequest) {
|
||||
toast.error('No payment request available')
|
||||
return
|
||||
|
|
@ -223,7 +223,7 @@ export class PaymentService extends BaseService {
|
|||
* Handle payment with automatic fallback
|
||||
* Tries wallet payment first, falls back to external wallet
|
||||
*/
|
||||
async handlePaymentWithFallback(
|
||||
async handlePayment(
|
||||
paymentRequest: string,
|
||||
requiredAmountSats?: number,
|
||||
options: PaymentOptions = {}
|
||||
|
|
@ -236,7 +236,7 @@ export class PaymentService extends BaseService {
|
|||
// Try wallet payment first if user has balance
|
||||
if (this.hasWalletWithBalance) {
|
||||
try {
|
||||
return await this.payInvoiceWithUserWallet(
|
||||
return await this.payWithWallet(
|
||||
paymentRequest,
|
||||
requiredAmountSats,
|
||||
options
|
||||
|
|
@ -248,7 +248,7 @@ export class PaymentService extends BaseService {
|
|||
}
|
||||
|
||||
// Fallback to external wallet
|
||||
this.openExternalLightningWallet(paymentRequest)
|
||||
this.openExternalWallet(paymentRequest)
|
||||
return null // External wallet payment status unknown
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue