mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
refactor(server): payment service (#8906)
This commit is contained in:
@@ -586,15 +586,6 @@ const InvoiceLine = ({
|
||||
}
|
||||
}, [invoice.link, urlService]);
|
||||
|
||||
const planText =
|
||||
invoice.plan === SubscriptionPlan.AI
|
||||
? 'AFFiNE AI'
|
||||
: invoice.plan === SubscriptionPlan.Pro
|
||||
? invoice.recurring === SubscriptionRecurring.Lifetime
|
||||
? 'AFFiNE Cloud Believer'
|
||||
: 'AFFiNE Cloud'
|
||||
: null;
|
||||
|
||||
return (
|
||||
<SettingRow
|
||||
key={invoice.id}
|
||||
@@ -603,7 +594,7 @@ const InvoiceLine = ({
|
||||
invoice.status === InvoiceStatus.Paid
|
||||
? t['com.affine.payment.billing-setting.paid']()
|
||||
: ''
|
||||
} $${invoice.amount / 100} - ${planText}`}
|
||||
} $${invoice.amount / 100}`}
|
||||
>
|
||||
<Button onClick={open}>
|
||||
{t['com.affine.payment.billing-setting.view-invoice']()}
|
||||
|
||||
@@ -72,11 +72,13 @@ export class SubscriptionStore extends Store {
|
||||
const data = await this.gqlService.gql({
|
||||
query: resumeSubscriptionMutation,
|
||||
variables: {
|
||||
idempotencyKey,
|
||||
plan,
|
||||
},
|
||||
context: {
|
||||
signal: abortSignal,
|
||||
headers: {
|
||||
'Idempotency-Key': idempotencyKey,
|
||||
},
|
||||
},
|
||||
});
|
||||
return data.resumeSubscription;
|
||||
@@ -90,11 +92,13 @@ export class SubscriptionStore extends Store {
|
||||
const data = await this.gqlService.gql({
|
||||
query: cancelSubscriptionMutation,
|
||||
variables: {
|
||||
idempotencyKey,
|
||||
plan,
|
||||
},
|
||||
context: {
|
||||
signal: abortSignal,
|
||||
headers: {
|
||||
'Idempotency-Key': idempotencyKey,
|
||||
},
|
||||
},
|
||||
});
|
||||
return data.cancelSubscription;
|
||||
@@ -118,10 +122,14 @@ export class SubscriptionStore extends Store {
|
||||
return this.gqlService.gql({
|
||||
query: updateSubscriptionMutation,
|
||||
variables: {
|
||||
idempotencyKey,
|
||||
plan,
|
||||
recurring,
|
||||
},
|
||||
context: {
|
||||
headers: {
|
||||
'Idempotency-Key': idempotencyKey,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user