paypal-rust

所属分类:支付接口
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-05-30 09:52:39
上 传 者sh-1993
说明:  贝宝锈病,,
(paypal-rust,,)

文件列表:
.rustfmt.toml (23, 2023-05-30)
Cargo.toml (1091, 2023-05-30)
LICENSE-APACHE (11357, 2023-05-30)
LICENSE-MIT (1069, 2023-05-30)
examples/ (0, 2023-05-30)
examples/order.rs (1724, 2023-05-30)
examples/payments.rs (2497, 2023-05-30)
examples/webhooks.rs (1528, 2023-05-30)
src/ (0, 2023-05-30)
src/client/ (0, 2023-05-30)
src/client/app_info.rs (442, 2023-05-30)
src/client/auth.rs (3172, 2023-05-30)
src/client/endpoint.rs (2151, 2023-05-30)
src/client/error.rs (2911, 2023-05-30)
src/client/mod.rs (256, 2023-05-30)
src/client/paypal.rs (11404, 2023-05-30)
src/client/request.rs (14193, 2023-05-30)
src/client/response.rs (200, 2023-05-30)
src/lib.rs (2777, 2023-05-30)
src/resources/ (0, 2023-05-30)
src/resources/address.rs (585, 2023-05-30)
src/resources/address_details.rs (1083, 2023-05-30)
src/resources/address_portable.rs (2728, 2023-05-30)
src/resources/amount_breakdown.rs (2817, 2023-05-30)
src/resources/amount_with_breakdown.rs (1263, 2023-05-30)
src/resources/authorization_status_details.rs (327, 2023-05-30)
src/resources/authorization_with_additional_data.rs (351, 2023-05-30)
src/resources/capture.rs (2532, 2023-05-30)
src/resources/capture_status_details.rs (376, 2023-05-30)
src/resources/card_address_portable.rs (1343, 2023-05-30)
src/resources/card_response.rs (1614, 2023-05-30)
src/resources/date_no_time.rs (675, 2023-05-30)
src/resources/email.rs (498, 2023-05-30)
src/resources/enums/ (0, 2023-05-30)
src/resources/enums/authorization_status_reason.rs (667, 2023-05-30)
src/resources/enums/avs_code.rs (4735, 2023-05-30)
src/resources/enums/capture_status.rs (1077, 2023-05-30)
src/resources/enums/capture_status_reason.rs (3270, 2023-05-30)
... ...

# paypal-rust --- [![Downloads](https://img.shields.io/crates/d/paypal-rust?style=for-the-badge)](https://crates.io/crates/paypal-rust) [![Version](https://img.shields.io/crates/v/paypal-rust?style=for-the-badge)](https://crates.io/crates/paypal-rust) Rust bindings for the [PayPal REST API](https://developer.paypal.com/api/rest). This library is a work in progress. While functional, it is not yet advised to be used in production (The API will change, tests are not yet complete, etc). For more information on the PayPal REST API, visit the [PayPal Developer Portal](https://developer.paypal.com/api/rest). We aren't affiliated with PayPal in any way and this library is not endorsed by them. ## Usage ```rust use dotenv::dotenv; use paypal_rust::client::AppInfo; use paypal_rust::{ AmountWithBreakdown, Client, CreateOrderDto, CurrencyCode, Environment, Order, OrderApplicationContext, OrderIntent, PurchaseUnitRequest }; #[tokio::main] async fn main() { dotenv().ok(); let username = std::env::var("CLIENT_ID").expect("CLIENT_ID must be set"); let password = std::env::var("CLIENT_SECRET").expect("CLIENT_SECRET must be set"); let client = Client::new(username, password, Environment::Sandbox) .unwrap() .with_app_info(AppInfo { name: "PayPal Rust Test App".to_string(), version: "1.0".to_string(), website: None, }); client.authenticate().await.unwrap(); let order = Order::create( &client, CreateOrderDto { intent: OrderIntent::Capture, payer: None, purchase_units: vec![PurchaseUnitRequest::new(AmountWithBreakdown::new( CurrencyCode::Euro, "10.00".to_string(), ))], application_context: Some( OrderApplicationContext::new() .return_url("https://example.com/#/return".to_string()) .cancel_url("https://example.com/#/cancel".to_string()), ), }, ).await.unwrap(); println!("Created order: {:?}", order); } ``` # Features This library offers a "utils" feature that enables the `utils` module. This module contains some useful functions for working with the PayPal API.

近期下载者

相关文件


收藏者