pub struct Wechat {
pub appid: String,
pub secret: String,
pub sp_mchid: String,
pub serial_no: String,
pub app_private: String,
pub apikey: String,
pub apiv2: String,
pub notify_url: String,
}Fields§
§appid: String服务商APPID
secret: String密钥
sp_mchid: String服务商户号
serial_no: String证书号
app_private: StringAPI证书私钥
apikey: StringAPIv3密钥
apiv2: StringAPIv2密钥
notify_url: StringImplementations§
Source§impl Wechat
impl Wechat
pub fn http( &mut self, url: &str, method: Method, body: JsonValue, ) -> Result<JsonValue, String>
pub fn sign_v2(&mut self, body: JsonValue) -> Result<String, String>
pub fn sign( &mut self, method: &str, url: &str, body: &str, ) -> Result<String, String>
pub fn paysign(&mut self, prepay_id: &str) -> Result<JsonValue, String>
Trait Implementations§
Source§impl PayMode for Wechat
impl PayMode for Wechat
fn login(&mut self, code: &str) -> Result<JsonValue, String>
Source§fn pay_query(
&mut self,
out_trade_no: &str,
sub_mchid: &str,
) -> Result<JsonValue, String>
fn pay_query( &mut self, out_trade_no: &str, sub_mchid: &str, ) -> Result<JsonValue, String>
订单查询 Read more
Source§fn refund(
&mut self,
sub_mchid: &str,
out_trade_no: &str,
transaction_id: &str,
out_refund_no: &str,
amount: f64,
total: f64,
currency: &str,
) -> Result<JsonValue, String>
fn refund( &mut self, sub_mchid: &str, out_trade_no: &str, transaction_id: &str, out_refund_no: &str, amount: f64, total: f64, currency: &str, ) -> Result<JsonValue, String>
订单退款
Source§fn pay_notify(
&mut self,
nonce: &str,
ciphertext: &str,
associated_data: &str,
) -> Result<JsonValue, String>
fn pay_notify( &mut self, nonce: &str, ciphertext: &str, associated_data: &str, ) -> Result<JsonValue, String>
支付成功通知
Source§fn refund_query(
&mut self,
_trade_no: &str,
out_refund_no: &str,
sub_mchid: &str,
) -> Result<JsonValue, String>
fn refund_query( &mut self, _trade_no: &str, out_refund_no: &str, sub_mchid: &str, ) -> Result<JsonValue, String>
退款查询
Source§fn refund_notify(
&mut self,
nonce: &str,
ciphertext: &str,
associated_data: &str,
) -> Result<JsonValue, String>
fn refund_notify( &mut self, nonce: &str, ciphertext: &str, associated_data: &str, ) -> Result<JsonValue, String>
退款通知
fn auth(&mut self, _code: &str) -> Result<JsonValue, String>
fn config(&mut self) -> JsonValue
Source§fn pay(
&mut self,
types: Types,
sub_mchid: &str,
out_trade_no: &str,
description: &str,
total_fee: f64,
sp_openid: &str,
) -> Result<JsonValue, String>
fn pay( &mut self, types: Types, sub_mchid: &str, out_trade_no: &str, description: &str, total_fee: f64, sp_openid: &str, ) -> Result<JsonValue, String>
支付 Read more
fn micropay( &mut self, auth_code: &str, sub_mchid: &str, out_trade_no: &str, description: &str, total_fee: f64, org_openid: &str, ip: &str, ) -> Result<JsonValue, String>
fn notify(&mut self, _data: JsonValue) -> Result<JsonValue, String>
fn pay_micropay_query( &mut self, out_trade_no: &str, sub_mchid: &str, ) -> Result<JsonValue, String>
fn micropay_refund( &mut self, sub_mchid: &str, out_trade_no: &str, transaction_id: &str, out_refund_no: &str, amount: f64, total: f64, currency: &str, refund_text: &str, ) -> Result<JsonValue, String>
Auto Trait Implementations§
impl Freeze for Wechat
impl RefUnwindSafe for Wechat
impl Send for Wechat
impl Sync for Wechat
impl Unpin for Wechat
impl UnwindSafe for Wechat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more