fix: mock purchase now actually activates subscription
POST /api/v1/subscription/purchase only creates an order without activating. Add POST /api/v1/subscription/mock-purchase that does purchase + verify in one step (non-production only). Miniprogram subscribe page now calls mock-purchase so subscriptions take effect.
这个提交包含在:
@@ -147,7 +147,7 @@ Page({
|
||||
doPurchase: function (plan) {
|
||||
var self = this
|
||||
self.setData({ purchasing: true })
|
||||
api.purchase(plan.key).then(function (order) {
|
||||
api.mockPurchase(plan.key).then(function (order) {
|
||||
self.setData({ purchasing: false })
|
||||
wx.showToast({ title: '支付成功', icon: 'success' })
|
||||
setTimeout(function () {
|
||||
|
||||
@@ -21,6 +21,7 @@ module.exports = {
|
||||
getSubscription: function () { return http.get('/api/v1/subscription') },
|
||||
activateTrial: function () { return http.post('/api/v1/subscription/trial') },
|
||||
purchase: function (plan) { return http.post('/api/v1/subscription/purchase', { plan: plan }) },
|
||||
mockPurchase: function (plan) { return http.post('/api/v1/subscription/mock-purchase', { plan: plan }) },
|
||||
|
||||
// Treatment
|
||||
getRecords: function (params) { return http.get('/api/v1/treatment/history', params) },
|
||||
|
||||
在新工单中引用
屏蔽一个用户