Getting Started
8. Payment Methods
Configure WxPay, PayPal, Stripe, Lantu quick login.
Objectives
- Configure membership model
- WeChat Pay configuration
Membership Model
Default membership modes are vip
svip
with/without expiration time. After all, it's SaaS providing rental services to customers, the simpler the better.
app/app.config.ts
Configuration
Website title settings, website URL from environment variables.
export default defineAppConfig({
// Website name
name: 'Hot Products SaaS',
subName: 'Demo Site',
// Website URL
homeUrl: process.env.NUXT_PUBLIC_SITE_URL,
Member type code, price, whether it will expire.
// Membership
member: [
{
code: 'vip',
price: 0.01
},
{
code: 'svip',
price: 0.01
},
{
code: 'ssvip',
price: 0.01
}
],
// Enable member expiration
enableMemberExpire: true,
WeChat Pay
- WeChat Pay Backend https://pay.weixin.qq.com/
- WeChat Official Account https://mp.weixin.qq.com/
.env
Parameters
# wxpay official
WX_APPID=""
WX_MCHID=""
WX_PUBLIC_KEY="cert/wx/xxx.pem"
WX_PRIVATE_KEY="cert/wx/xxx.pem"
WX_SERIAL_NO=""
WX_APIV3_PRIVATE_KEY=""
WX_NOTIFY_URL="http://localhost:3000/api/payer/wx_notify"
- WX_APPID Developer ID(AppID)
- WX_MCHID Login Account
- Certificate, WX_SERIAL_NO Certificate Serial Number
- WX_APIV3_PRIVATE_KEY Decrypt Callback
Stripe Payment
- Developer Dashboard
https://dashboard.stripe.com/developers
- .env File
# stripe test
NUXT_PUBLIC_STRIPE_KEY=""
NUXT_STRIPE_KEY=""
NUXT_STRIPE_WEBHOOK_SECRET=""
- NUXT_PUBLIC_STRIPE_KEY Public Key
https://dashboard.stripe.com/apikeys
- NUXT_STRIPE_KEY Secret Key
Same image as above
- NUXT_STRIPE_WEBHOOK_SECRET Webhook Secret
end