Skip to content

Commit f697a17

Browse files
authored
Merge pull request #19 from teacoder-team/dev
feat(payment): enable SBP payment method
2 parents 6cd327d + 200b740 commit f697a17

3 files changed

Lines changed: 34 additions & 11 deletions

File tree

src/api/generated/initPaymentRequestMethod.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
/**
1010
* Payment method
1111
*/
12-
export type InitPaymentRequestMethod = typeof InitPaymentRequestMethod[keyof typeof InitPaymentRequestMethod];
13-
12+
export type InitPaymentRequestMethod =
13+
(typeof InitPaymentRequestMethod)[keyof typeof InitPaymentRequestMethod]
1414

1515
// eslint-disable-next-line @typescript-eslint/no-redeclare
1616
export const InitPaymentRequestMethod = {
17-
BANK_CARD: 'BANK_CARD',
18-
SBP: 'SBP',
19-
YOOMONEY: 'YOOMONEY',
20-
CRYPTO: 'CRYPTO',
21-
} as const;
17+
BANK_CARD: 'BANK_CARD',
18+
SBP: 'SBP',
19+
YOOMONEY: 'YOOMONEY',
20+
STARS: 'STARS',
21+
CRYPTO: 'CRYPTO'
22+
} as const

src/app/(public)/premium/page.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
import { Metadata } from 'next'
2+
import { headers } from 'next/headers'
3+
14
import { Premium } from '@/src/components/premium/premium'
25

3-
export default function PremiumPage() {
6+
export const metadata: Metadata = {
7+
title: 'Подписка'
8+
}
9+
10+
export default async function PremiumPage() {
11+
const headersStore = await headers()
12+
13+
const allHeaders = Object.fromEntries(headersStore.entries())
14+
console.log(allHeaders)
15+
416
return <Premium />
517
}

src/components/premium/payment-methods.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CreditCardIcon } from 'lucide-react'
1+
import { BitcoinIcon, CreditCardIcon, StarIcon } from 'lucide-react'
22
import { ComponentType, SVGProps } from 'react'
33
import { Control } from 'react-hook-form'
44

@@ -39,7 +39,7 @@ const paymentMethods: PaymentMethod[] = [
3939
icon: SbpIcon,
4040
textColor: 'text-blue-600',
4141
bgColor: 'bg-blue-100',
42-
isAllowed: false
42+
isAllowed: true
4343
},
4444
{
4545
id: InitPaymentRequestMethod.YOOMONEY,
@@ -51,12 +51,22 @@ const paymentMethods: PaymentMethod[] = [
5151
isAllowed: false
5252
}
5353
// {
54+
// id: InitPaymentRequestMethod.STARS,
55+
// name: 'Telegram Stars',
56+
// description: 'Оплата подписки через звёзды Telegram',
57+
// icon: StarIcon,
58+
// textColor: 'text-blue-600',
59+
// bgColor: 'bg-blue-100',
60+
// isAllowed: true
61+
// }
62+
// {
5463
// id: 'CRYPTO',
5564
// name: 'Криптовалюта',
5665
// description: 'Оплата с помощью BTC, USDT, TON',
5766
// icon: BitcoinIcon,
5867
// textColor: 'text-blue-600',
59-
// bgColor: 'bg-blue-100'
68+
// bgColor: 'bg-blue-100',
69+
// isAllowed: true
6070
// }
6171
]
6272

0 commit comments

Comments
 (0)