refactor: 更新项目引用路径从perfect-panel/ppanel-server到perfect-panel/server
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
feat: 添加版本和构建时间变量 fix: 修正短信队列类型注释错误 style: 清理未使用的代码和测试文件 docs: 更新安装文档中的下载链接 chore: 迁移数据库脚本添加日志和订阅配置
This commit is contained in:
@@ -5,7 +5,9 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/perfect-panel/ppanel-server/pkg/logger"
|
||||
"github.com/stripe/stripe-go/v81/webhookendpoint"
|
||||
|
||||
"github.com/perfect-panel/server/pkg/logger"
|
||||
"github.com/stripe/stripe-go/v81"
|
||||
"github.com/stripe/stripe-go/v81/customer"
|
||||
"github.com/stripe/stripe-go/v81/ephemeralkey"
|
||||
@@ -193,3 +195,16 @@ func (c *Client) RetrievePaymentMethod(id string) (*stripe.PaymentMethod, error)
|
||||
stripe.Key = c.SecretKey
|
||||
return paymentmethod.Get(id, nil)
|
||||
}
|
||||
|
||||
// CreateWebhookEndpoint 创建 webhook endpoint
|
||||
func (c *Client) CreateWebhookEndpoint(url string) (*stripe.WebhookEndpoint, error) {
|
||||
stripe.Key = c.SecretKey
|
||||
params := &stripe.WebhookEndpointParams{
|
||||
URL: stripe.String(url),
|
||||
EnabledEvents: []*string{
|
||||
stripe.String("payment_intent.succeeded"),
|
||||
stripe.String("payment_intent.payment_failed"),
|
||||
},
|
||||
}
|
||||
return webhookendpoint.New(params)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ func TestStripeAlipay(t *testing.T) {
|
||||
}
|
||||
user := User{
|
||||
UserId: 1,
|
||||
Email: "tension@muran.org",
|
||||
Email: "tension@ppanel.dev",
|
||||
}
|
||||
result, err := client.CreatePaymentSheet(&order, &user)
|
||||
if err != nil {
|
||||
@@ -45,7 +45,7 @@ func TestStripeWechat(t *testing.T) {
|
||||
}
|
||||
user := User{
|
||||
UserId: 1,
|
||||
Email: "tension@muran.org",
|
||||
Email: "tension@ppanel.dev",
|
||||
}
|
||||
result, err := client.CreatePaymentSheet(&order, &user)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user