feat: 接入微信小程序支付

This commit is contained in:
2026-05-14 00:16:17 +08:00
parent bf4423e53b
commit ae58a443a3
42 changed files with 2265 additions and 191 deletions

View File

@@ -0,0 +1,62 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::runtime_profile_recharge_center_procedure_result_type::RuntimeProfileRechargeCenterProcedureResult;
use super::runtime_profile_recharge_order_paid_input_type::RuntimeProfileRechargeOrderPaidInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct MarkProfileRechargeOrderPaidAndReturnArgs {
pub input: RuntimeProfileRechargeOrderPaidInput,
}
impl __sdk::InModule for MarkProfileRechargeOrderPaidAndReturnArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `mark_profile_recharge_order_paid_and_return`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait mark_profile_recharge_order_paid_and_return {
fn mark_profile_recharge_order_paid_and_return(
&self,
input: RuntimeProfileRechargeOrderPaidInput,
) {
self.mark_profile_recharge_order_paid_and_return_then(input, |_, _| {});
}
fn mark_profile_recharge_order_paid_and_return_then(
&self,
input: RuntimeProfileRechargeOrderPaidInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl mark_profile_recharge_order_paid_and_return for super::RemoteProcedures {
fn mark_profile_recharge_order_paid_and_return_then(
&self,
input: RuntimeProfileRechargeOrderPaidInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRechargeCenterProcedureResult>(
"mark_profile_recharge_order_paid_and_return",
MarkProfileRechargeOrderPaidAndReturnArgs { input },
__callback,
);
}
}

View File

@@ -367,6 +367,7 @@ pub mod list_puzzle_works_procedure;
pub mod list_square_hole_works_procedure;
pub mod list_visual_novel_runtime_history_procedure;
pub mod list_visual_novel_works_procedure;
pub mod mark_profile_recharge_order_paid_and_return_procedure;
pub mod match_3_d_agent_message_finalize_input_type;
pub mod match_3_d_agent_message_row_type;
pub mod match_3_d_agent_message_submit_input_type;
@@ -616,6 +617,7 @@ pub mod runtime_profile_recharge_center_get_input_type;
pub mod runtime_profile_recharge_center_procedure_result_type;
pub mod runtime_profile_recharge_center_snapshot_type;
pub mod runtime_profile_recharge_order_create_input_type;
pub mod runtime_profile_recharge_order_paid_input_type;
pub mod runtime_profile_recharge_order_snapshot_type;
pub mod runtime_profile_recharge_order_status_type;
pub mod runtime_profile_recharge_product_kind_type;
@@ -1177,6 +1179,7 @@ pub use list_puzzle_works_procedure::list_puzzle_works;
pub use list_square_hole_works_procedure::list_square_hole_works;
pub use list_visual_novel_runtime_history_procedure::list_visual_novel_runtime_history;
pub use list_visual_novel_works_procedure::list_visual_novel_works;
pub use mark_profile_recharge_order_paid_and_return_procedure::mark_profile_recharge_order_paid_and_return;
pub use match_3_d_agent_message_finalize_input_type::Match3DAgentMessageFinalizeInput;
pub use match_3_d_agent_message_row_type::Match3DAgentMessageRow;
pub use match_3_d_agent_message_submit_input_type::Match3DAgentMessageSubmitInput;
@@ -1426,6 +1429,7 @@ pub use runtime_profile_recharge_center_get_input_type::RuntimeProfileRechargeCe
pub use runtime_profile_recharge_center_procedure_result_type::RuntimeProfileRechargeCenterProcedureResult;
pub use runtime_profile_recharge_center_snapshot_type::RuntimeProfileRechargeCenterSnapshot;
pub use runtime_profile_recharge_order_create_input_type::RuntimeProfileRechargeOrderCreateInput;
pub use runtime_profile_recharge_order_paid_input_type::RuntimeProfileRechargeOrderPaidInput;
pub use runtime_profile_recharge_order_snapshot_type::RuntimeProfileRechargeOrderSnapshot;
pub use runtime_profile_recharge_order_status_type::RuntimeProfileRechargeOrderStatus;
pub use runtime_profile_recharge_product_kind_type::RuntimeProfileRechargeProductKind;

View File

@@ -18,7 +18,8 @@ pub struct ProfileRechargeOrder {
pub amount_cents: u64,
pub status: RuntimeProfileRechargeOrderStatus,
pub payment_channel: String,
pub paid_at: __sdk::Timestamp,
pub paid_at: Option<__sdk::Timestamp>,
pub provider_transaction_id: Option<String>,
pub created_at: __sdk::Timestamp,
pub points_delta: i64,
pub membership_expires_at: Option<__sdk::Timestamp>,
@@ -41,7 +42,8 @@ pub struct ProfileRechargeOrderCols {
pub status:
__sdk::__query_builder::Col<ProfileRechargeOrder, RuntimeProfileRechargeOrderStatus>,
pub payment_channel: __sdk::__query_builder::Col<ProfileRechargeOrder, String>,
pub paid_at: __sdk::__query_builder::Col<ProfileRechargeOrder, __sdk::Timestamp>,
pub paid_at: __sdk::__query_builder::Col<ProfileRechargeOrder, Option<__sdk::Timestamp>>,
pub provider_transaction_id: __sdk::__query_builder::Col<ProfileRechargeOrder, Option<String>>,
pub created_at: __sdk::__query_builder::Col<ProfileRechargeOrder, __sdk::Timestamp>,
pub points_delta: __sdk::__query_builder::Col<ProfileRechargeOrder, i64>,
pub membership_expires_at:
@@ -61,6 +63,10 @@ impl __sdk::__query_builder::HasCols for ProfileRechargeOrder {
status: __sdk::__query_builder::Col::new(table_name, "status"),
payment_channel: __sdk::__query_builder::Col::new(table_name, "payment_channel"),
paid_at: __sdk::__query_builder::Col::new(table_name, "paid_at"),
provider_transaction_id: __sdk::__query_builder::Col::new(
table_name,
"provider_transaction_id",
),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
points_delta: __sdk::__query_builder::Col::new(table_name, "points_delta"),
membership_expires_at: __sdk::__query_builder::Col::new(

View File

@@ -0,0 +1,17 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct RuntimeProfileRechargeOrderPaidInput {
pub order_id: String,
pub paid_at_micros: i64,
pub provider_transaction_id: Option<String>,
}
impl __sdk::InModule for RuntimeProfileRechargeOrderPaidInput {
type Module = super::RemoteModule;
}

View File

@@ -18,7 +18,8 @@ pub struct RuntimeProfileRechargeOrderSnapshot {
pub amount_cents: u64,
pub status: RuntimeProfileRechargeOrderStatus,
pub payment_channel: String,
pub paid_at_micros: i64,
pub paid_at_micros: Option<i64>,
pub provider_transaction_id: Option<String>,
pub created_at_micros: i64,
pub points_delta: i64,
pub membership_expires_at_micros: Option<i64>,

View File

@@ -8,7 +8,15 @@ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[sats(crate = __lib)]
#[derive(Copy, Eq, Hash)]
pub enum RuntimeProfileRechargeOrderStatus {
Pending,
Paid,
Failed,
Closed,
Refunded,
}
impl __sdk::InModule for RuntimeProfileRechargeOrderStatus {