A rust library that wraps the paypal api asynchronously in a strongly typed manner.
Go to file
2022-05-11 21:23:09 +02:00
.github Create FUNDING.yml 2020-07-21 01:31:54 +02:00
examples fixes and utility for money type 2022-04-28 10:06:29 +02:00
src Improve usability of predefined Money constructors 2022-05-11 21:23:09 +02:00
.gitignore initial commit 2020-06-08 22:31:40 +02:00
Cargo.toml Allow switching to rustls TLS implementation 2022-04-28 09:40:53 +02:00
LICENSE-APACHE relicense to MIT OR APACHE-2.0 2021-07-02 11:27:57 +02:00
LICENSE-MIT relicense to MIT OR APACHE-2.0 2021-07-02 11:27:57 +02:00
README.md update readme 2022-04-27 09:27:59 +02:00
rustfmt.toml progress with orders 2020-06-10 12:29:13 +02:00

paypal-rs

Version Downloads License Rust Docs

A rust library that wraps the paypal api asynchronously in a strongly typed manner.

Crate: https://crates.io/crates/paypal-rs

Documentation: https://docs.rs/paypal-rs

Currently in early development.

Example

use paypal_rs::{
    Client,
    api::orders::*,
    data::orders::*,
    data::common::Currency,
};

#[tokio::main]
async fn main() {
    dotenv::dotenv().ok();
    let clientid = std::env::var("PAYPAL_CLIENTID").unwrap();
    let secret = std::env::var("PAYPAL_SECRET").unwrap();

    let mut client = Client::new(clientid, secret, true);

    client.get_access_token().await.unwrap();

    let order = OrderPayloadBuilder::default()
        .intent(Intent::Authorize)
        .purchase_units(vec![PurchaseUnit::new(Amount::new(Currency::EUR, "10.0"))])
        .build().unwrap();

    let create_order = CreateOrder::new(order);

    let _order_created = client
        .execute(create_order).await.unwrap();
}

Testing

You need the enviroment variables PAYPAL_CLIENTID and PAYPAL_SECRET to be set.

cargo test

Roadmap

  • Orders API - 0.1.0
    • Create order
    • Update order
    • Show order details
    • Authorize payment for order
    • Capture payment for order
  • Invoicing API - 0.2.0
  • Payments API - 0.3.0
  • Tracking API - 0.4.0
  • Subscriptions API - 0.5.0
  • Identity API - 0.6.0
  • Disputes API - 0.7.0
  • Catalog Products API - 0.8.0
  • Partner Referrals API - 0.9.0
  • Payouts API - 0.10.0
  • Transaction Search API - 0.11.0
  • Referenced Payouts API - 0.12.0
  • Vault API - 0.13.0
  • Webhooks Management API - 0.14.0
  • Payment Experience Web Profiles API - 1.0.0

License: MIT OR Apache-2.0