| name | stripe-payments |
| description | Best practices for Stripe payment integration. Use when implementing payments, subscriptions, checkout flows, or any monetization feature in games or web apps. Covers CheckoutSessions, Payment Element, subscriptions, and Connect. |
| metadata | {"author":"misskim","version":"1.0","origin":"Concept from Stripe official best practices, adapted for our game/app monetization"} |
Stripe Payments Integration
๊ฒ์/์น์ฑ ์์ตํ๋ฅผ ์ํ Stripe ๊ฒฐ์ ํตํฉ ๊ฐ์ด๋.
ํต์ฌ ์์น
๋ฐ๋์ ์ฌ์ฉ
- CheckoutSessions API โ ์ํ์ ๊ฒฐ์ + ๊ตฌ๋
์ ๊ธฐ๋ณธ
- Stripe ํธ์คํธ ์ฒดํฌ์์ ๋๋ ์๋ฒ ๋๋ ์ฒดํฌ์์ ์ฐ์
- ๋์ ๊ฒฐ์ ์๋จ โ ๋์๋ณด๋์์ ํ์ฑํ (payment_method_types ํ๋์ฝ๋ฉ ๊ธ์ง)
- ์ต์ API ๋ฒ์ + SDK ์ฌ์ฉ
์ ๋ ๊ธ์ง
- โ Charges API (๋ ๊ฑฐ์, PaymentIntents๋ก ๋ง์ด๊ทธ๋ ์ด์
)
- โ Card Element / Payment Element card ๋ชจ๋ (๋ ๊ฑฐ์)
- โ Sources API (deprecated)
- โ Tokens API (SetupIntents ์ฌ์ฉ)
- โ payment_method_types ํ๋์ฝ๋ฉ (๋์ ๊ฒฐ์ ์๋จ ์ฌ์ฉ)
์ฐ๋ฆฌ ๊ฒ์/์ฑ์ ์ ์ฉ
์๋๋ฆฌ์ค๋ณ ์ ํ
์์ตํ ์ ํ โ ๋ฌด์์ ํ๋๊ฐ?
โโ ์ผํ์ฑ ๊ฒ์ ๊ตฌ๋งค โ CheckoutSessions (one-time)
โโ ์ธ์ฑ ๊ตฌ๋งค/์์ดํ
โ CheckoutSessions + metadata
โโ ์์ ์ก ๊ตฌ๋
โ Billing API + CheckoutSessions
โโ ๊ธฐ๋ถ/ํ์ โ Payment Links (๊ฐ์ฅ ๊ฐ๋จ)
โโ ๋ง์ผํ๋ ์ด์ค โ Stripe Connect (destination charges)
๊ธฐ๋ณธ ๊ตฌํ ํจํด
const session = await stripe.checkout.sessions.create({
mode: 'payment',
line_items: [{
price_data: {
currency: 'usd',
product_data: { name: 'Game Premium' },
unit_amount: 999,
},
quantity: 1,
}],
success_url: 'https://eastsea.monster/thanks?session_id={CHECKOUT_SESSION_ID}',
cancel_url: 'https://eastsea.monster/games/',
});
๊ตฌ๋
๋ชจ๋ธ (SaaS/๊ฒ์ ํ๋ฆฌ๋ฏธ์)
- Billing API โ ๊ตฌ๋
์ค๊ณ ๊ฐ์ด๋: docs.stripe.com/billing/subscriptions/designing-integration
- CheckoutSessions + Billing ์กฐํฉ ์ฐ์
- ์นํ
์ผ๋ก ๊ตฌ๋
์ํ ๋ณ๊ฒฝ ๊ฐ์ง
ํ๋ซํผ (์ฌ๋ฌ ๊ฒ์ ๊ฐ๋ฐ์) โ Connect
- destination charges โ ์ฐ๋ฆฌ๊ฐ liability ์์ฉ
- on_behalf_of ํ๋ผ๋ฏธํฐ๋ก merchant of record ์ ์ด
- charge type ํผํฉ ๊ธ์ง
๋ณด์ ์ฒดํฌ๋ฆฌ์คํธ
์ฐธ๊ณ ๋ฌธ์
- ํตํฉ ์ต์
: docs.stripe.com/payments/payment-methods/integration-options
- API ํฌ์ด: docs.stripe.com/payments-api/tour
- Go-live ์ฒดํฌ๋ฆฌ์คํธ: docs.stripe.com/get-started/checklist/go-live