Struct labrador::WeChatPayClient
source · [−]pub struct WeChatPayClient<T: SessionStore> {
pub appid: String,
pub mch_id: Option<String>,
/* private fields */
}Fields
appid: Stringmch_id: Option<String>商户编号
Implementations
sourceimpl<T: SessionStore> WeChatPayClient<T>
impl<T: SessionStore> WeChatPayClient<T>
sourcepub fn new<S: Into<String>>(appid: S, secret: S, session: T) -> WeChatPayClient<T>
Available on crate feature wechat only.
pub fn new<S: Into<String>>(appid: S, secret: S, session: T) -> WeChatPayClient<T>
wechat only.get the wechat client
pub fn key_v3(self, key: String) -> Self
Available on crate feature
wechat only.pub fn key(self, key: String) -> Self
Available on crate feature
wechat only.pub fn mch_id(self, mch_id: String) -> Self
Available on crate feature
wechat only.pub fn private_key(self, private_key: String) -> Self
Available on crate feature
wechat only.pub fn set_private_key_path(self, private_key_path: &str) -> LabradorResult<Self>
Available on crate feature
wechat only.pub fn serial_no(self, serial_no: String) -> Self
Available on crate feature
wechat only.pub fn pkcs12_path(self, pkcs12_path: String) -> Self
Available on crate feature
wechat only.pub fn access_token(&self) -> String
Available on crate feature
wechat only.pub fn token<F: Serialize>(
&self,
req: &LabraRequest<F>,
mch_id: Option<String>
) -> LabradorResult<String>
Available on crate feature
wechat only.sourcepub async fn verify(
&self,
serial_number: &str,
message: &str,
signature: &str
) -> bool
Available on crate feature wechat only.
pub async fn verify(
&self,
serial_number: &str,
message: &str,
signature: &str
) -> bool
wechat only.V3 验证签名
sourcepub async fn auto_load_cert(&self) -> LabradorResult<()>
Available on crate feature wechat only.
pub async fn auto_load_cert(&self) -> LabradorResult<()>
wechat only.自动加载证书
sourcepub async fn get_certificates(
&self
) -> LabradorResult<Vec<PlatformCertificateResponse>>
Available on crate feature wechat only.
pub async fn get_certificates(
&self
) -> LabradorResult<Vec<PlatformCertificateResponse>>
wechat only.Trait Implementations
sourceimpl<T: Clone + SessionStore> Clone for WeChatPayClient<T>
Available on crate feature wechat only.
impl<T: Clone + SessionStore> Clone for WeChatPayClient<T>
Available on crate feature
wechat only.sourcefn clone(&self) -> WeChatPayClient<T>
fn clone(&self) -> WeChatPayClient<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<T: Debug + SessionStore> Debug for WeChatPayClient<T>
Available on crate feature wechat only.
impl<T: Debug + SessionStore> Debug for WeChatPayClient<T>
Available on crate feature
wechat only.Auto Trait Implementations
impl<T> !RefUnwindSafe for WeChatPayClient<T>
impl<T> Send for WeChatPayClient<T> where
T: Send,
impl<T> Sync for WeChatPayClient<T> where
T: Sync,
impl<T> Unpin for WeChatPayClient<T> where
T: Unpin,
impl<T> !UnwindSafe for WeChatPayClient<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more