fix: 修复微信支付回跳刷新与查单确认

This commit is contained in:
2026-05-14 23:52:01 +08:00
parent cf3dcc6195
commit 2801b55d2f
21 changed files with 880 additions and 119 deletions

View File

@@ -177,6 +177,7 @@ use module_runtime::{
build_runtime_profile_play_stats_get_input, build_runtime_profile_play_stats_record,
build_runtime_profile_recharge_center_get_input, build_runtime_profile_recharge_center_record,
build_runtime_profile_recharge_order_create_input,
build_runtime_profile_recharge_order_get_input,
build_runtime_profile_redeem_code_admin_disable_input,
build_runtime_profile_redeem_code_admin_list_input,
build_runtime_profile_redeem_code_admin_upsert_input, build_runtime_profile_redeem_code_record,

View File

@@ -163,6 +163,16 @@ impl From<module_runtime::RuntimeProfileRechargeCenterGetInput>
}
}
impl From<module_runtime::RuntimeProfileRechargeOrderGetInput>
for RuntimeProfileRechargeOrderGetInput
{
fn from(input: module_runtime::RuntimeProfileRechargeOrderGetInput) -> Self {
Self {
order_id: input.order_id,
}
}
}
impl From<module_runtime::RuntimeProfileRechargeOrderCreateInput>
for RuntimeProfileRechargeOrderCreateInput
{

View File

@@ -0,0 +1,59 @@
// 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_get_input_type::RuntimeProfileRechargeOrderGetInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetProfileRechargeOrderAndReturnArgs {
pub input: RuntimeProfileRechargeOrderGetInput,
}
impl __sdk::InModule for GetProfileRechargeOrderAndReturnArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_profile_recharge_order_and_return`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_profile_recharge_order_and_return {
fn get_profile_recharge_order_and_return(&self, input: RuntimeProfileRechargeOrderGetInput) {
self.get_profile_recharge_order_and_return_then(input, |_, _| {});
}
fn get_profile_recharge_order_and_return_then(
&self,
input: RuntimeProfileRechargeOrderGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_profile_recharge_order_and_return for super::RemoteProcedures {
fn get_profile_recharge_order_and_return_then(
&self,
input: RuntimeProfileRechargeOrderGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRechargeCenterProcedureResult>(
"get_profile_recharge_order_and_return",
GetProfileRechargeOrderAndReturnArgs { input },
__callback,
);
}
}

View File

@@ -320,6 +320,7 @@ pub mod get_player_progression_or_default_procedure;
pub mod get_profile_dashboard_procedure;
pub mod get_profile_play_stats_procedure;
pub mod get_profile_recharge_center_procedure;
pub mod get_profile_recharge_order_and_return_procedure;
pub mod get_profile_referral_invite_center_procedure;
pub mod get_profile_task_center_procedure;
pub mod get_puzzle_agent_session_procedure;
@@ -620,6 +621,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_get_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;
@@ -1135,6 +1137,7 @@ pub use get_player_progression_or_default_procedure::get_player_progression_or_d
pub use get_profile_dashboard_procedure::get_profile_dashboard;
pub use get_profile_play_stats_procedure::get_profile_play_stats;
pub use get_profile_recharge_center_procedure::get_profile_recharge_center;
pub use get_profile_recharge_order_and_return_procedure::get_profile_recharge_order_and_return;
pub use get_profile_referral_invite_center_procedure::get_profile_referral_invite_center;
pub use get_profile_task_center_procedure::get_profile_task_center;
pub use get_puzzle_agent_session_procedure::get_puzzle_agent_session;
@@ -1435,6 +1438,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_get_input_type::RuntimeProfileRechargeOrderGetInput;
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;

View File

@@ -0,0 +1,15 @@
// 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 RuntimeProfileRechargeOrderGetInput {
pub order_id: String,
}
impl __sdk::InModule for RuntimeProfileRechargeOrderGetInput {
type Module = super::RemoteModule;
}

View File

@@ -268,6 +268,33 @@ impl SpacetimeClient {
.await
}
pub async fn get_profile_recharge_order(
&self,
order_id: String,
) -> Result<
(
RuntimeProfileRechargeCenterRecord,
RuntimeProfileRechargeOrderRecord,
),
SpacetimeClientError,
> {
let procedure_input = build_runtime_profile_recharge_order_get_input(order_id)
.map_err(SpacetimeClientError::validation_failed)?
.into();
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.get_profile_recharge_order_and_return_then(procedure_input, move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_runtime_profile_recharge_order_procedure_result);
send_once(&sender, mapped);
});
})
.await
}
pub async fn mark_profile_recharge_order_paid(
&self,
order_id: String,