feat: 接入微信小程序支付
This commit is contained in:
@@ -268,6 +268,42 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn mark_profile_recharge_order_paid(
|
||||
&self,
|
||||
order_id: String,
|
||||
paid_at_micros: i64,
|
||||
provider_transaction_id: Option<String>,
|
||||
) -> Result<
|
||||
(
|
||||
RuntimeProfileRechargeCenterRecord,
|
||||
RuntimeProfileRechargeOrderRecord,
|
||||
),
|
||||
SpacetimeClientError,
|
||||
> {
|
||||
let procedure_input = module_runtime::build_runtime_profile_recharge_order_paid_input(
|
||||
order_id,
|
||||
paid_at_micros,
|
||||
provider_transaction_id,
|
||||
)
|
||||
.map_err(SpacetimeClientError::validation_failed)?
|
||||
.into();
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.mark_profile_recharge_order_paid_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 submit_profile_feedback(
|
||||
&self,
|
||||
user_id: String,
|
||||
|
||||
Reference in New Issue
Block a user