alipay-global

所属分类:支付接口
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-08-25 07:03:08
上 传 者sh-1993
说明:  支付宝全球,,
(alipay-global,,)

文件列表:
.vscode/ (0, 2023-09-25)
.vscode/settings.json (114, 2023-09-25)
Cargo.toml (1125, 2023-09-25)
src/ (0, 2023-09-25)
src/errors.rs (960, 2023-09-25)
src/inquiry.rs (1778, 2023-09-25)
src/integrations/ (0, 2023-09-25)
src/integrations/juniper.rs (0, 2023-09-25)
src/integrations/mod.rs (0, 2023-09-25)
src/lib.rs (1523, 2023-09-25)
src/models.rs (26453, 2023-09-25)
src/pay.rs (3649, 2023-09-25)
src/refund.rs (1924, 2023-09-25)
src/response.rs (506, 2023-09-25)
src/sign.rs (3598, 2023-09-25)
src/webhook.rs (3478, 2023-09-25)

# Alipay Global use [Alipay Global](https://global.alipay.com) without any pain. ## Getting Started ```shell # add this line to your Cargo.toml [dependencies] alipay-global = "0.1" ``` ## Example ```rust use alipay_global::pay::cashier_payment; use alipay_global::models::*; use std::path::PathBuf; // load client id and private pem key from environment for test purpose let client_id = std::env::var("CLIENT_ID").expect("Missing CLIENT_ID environment variable"); let private_key_pem_path = std::env::var("PEM_PATH").expect("Missing PEM_PATH environment variable"); // Client secret object contains all the information regarding your Alipay Global Account let secret = AlipayClientSecret {client_id: String::from(client_id), sandbox: true, private_key_pem: None, private_key_pem_file: Some(Box::new(PathBuf::from(&private_key_pem_path))), }; // CashierPayment Object contains order info let p = CashierPaymentSimple { payment_request_id: uuid::Uuid::new_v4().to_string(), currency: String::from("USD"), amount: 100, redict_url: String::from("https://google.com"), notifiy_url: String::from("https://google.com"), reference_order_id: None, order_description: String::from("order_description"), terminal_type: Some(TerminalType::WEB), }; // Call the API let r = cashier_payment(&secret, &p); ```

近期下载者

相关文件


收藏者