Skip to content

Commit

Permalink
fix: invoice validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Extheoisah committed Apr 10, 2024
1 parent 510ee02 commit 009bf3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/invoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const validateInvoice = (invoice: string) => {
};
}
if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") {
if (decodedInvoice.prefix !== INVOICE_PREFIX.mainnet) {
if (!decodedInvoice.prefix?.includes(INVOICE_PREFIX.mainnet)) {
return {
success: false,
message: "Invalid invoice. Please use a mainnet invoice",
Expand All @@ -36,6 +36,7 @@ export const validateInvoice = (invoice: string) => {
message: "Invoice is valid",
};
} catch (error) {
console.error("validateInvoice error", error);
return {
success: false,
message: "Invalid invoice",
Expand Down

0 comments on commit 009bf3e

Please sign in to comment.