chore: update deps and use dotenvy instead of dotenv

This commit is contained in:
Edgar 2022-11-09 10:07:28 +01:00
parent 557113084b
commit 7a764c5cfe
9 changed files with 21 additions and 18 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "paypal-rs"
version = "0.2.3"
version = "0.2.4"
authors = ["Edgar <git@edgarluque.com>"]
description = "A library that wraps the paypal api asynchronously."
repository = "https://github.com/edg-l/paypal-rs/"
@ -14,12 +14,12 @@ edition = "2021"
[dependencies]
reqwest = { version = "0.11.12", default-features = false, features = ["json"] }
serde = { version = "1.0.145", features = ["derive"] }
serde_json = "1.0.85"
serde = { version = "1.0.147", features = ["derive"] }
serde_json = "1.0.87"
serde_with = "2.0.1"
chrono = { version = "0.4.22", features = ["serde"] }
jsonwebtoken = "8.1.1"
base64 = "0.13.0"
base64 = "0.13.1"
log = "0.4.17"
bytes = "1.2.1"
derive_builder = "0.11.2"
@ -27,9 +27,9 @@ serde_qs = "0.10.1"
[dev-dependencies]
tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] }
dotenv = "0.15.0"
dotenvy = "0.15.6"
color-eyre = "0.6.2"
wiremock = "0.5.14"
wiremock = "0.5.15"
[features]
default = ["reqwest/native-tls"]

View File

@ -25,7 +25,7 @@ use paypal_rs::{
#[tokio::main]
async fn main() {
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let clientid = std::env::var("PAYPAL_CLIENTID").unwrap();
let secret = std::env::var("PAYPAL_SECRET").unwrap();

View File

@ -6,7 +6,7 @@ use paypal_rs::{data::common::Currency, Client};
#[tokio::main]
async fn main() -> Result<()> {
color_eyre::install()?;
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let clientid = std::env::var("PAYPAL_CLIENTID")?;
let secret = std::env::var("PAYPAL_SECRET")?;

View File

@ -397,7 +397,7 @@ mod tests {
use crate::Client;
async fn create_client() -> Client {
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let clientid = std::env::var("PAYPAL_CLIENTID").unwrap();
let secret = std::env::var("PAYPAL_SECRET").unwrap();

View File

@ -92,7 +92,7 @@ impl Client {
///
/// #[tokio::main]
/// async fn main() {
/// # dotenv::dotenv().ok();
/// # dotenvy::dotenv().ok();
/// let clientid = std::env::var("PAYPAL_CLIENTID").unwrap();
/// let secret = std::env::var("PAYPAL_SECRET").unwrap();
///

View File

@ -1,6 +1,6 @@
//! Paypal object definitions used by the orders api.
use super::{common::*, invoice::BillingInfo};
use super::common::*;
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
@ -669,7 +669,7 @@ pub struct PaymentCard {
/// The card owner name.
pub name: String,
/// The billing address.
pub billing_address: Address
pub billing_address: Address,
}
/// A transaction reference.
@ -695,7 +695,7 @@ pub struct StoredCredential {
/// The stored credential usage, e.g: SUBSEQUENT
pub usage: String,
/// The billing address.
pub previous_network_transaction_reference: TransactionReference
pub previous_network_transaction_reference: TransactionReference,
}
/// A order payload to be used when creating an order.

View File

@ -1,6 +1,5 @@
//! This module contains the endpoint trait used to implemented api endpoints.
use crate::{LIVE_ENDPOINT, SANDBOX_ENDPOINT, PaypalEnv};
use serde::{de::DeserializeOwned, Serialize};
use std::borrow::Cow;

View File

@ -24,7 +24,7 @@
//!
//! #[tokio::main]
//! async fn main() {
//! dotenv::dotenv().ok();
//! dotenvy::dotenv().ok();
//! let clientid = std::env::var("PAYPAL_CLIENTID").unwrap();
//! let secret = std::env::var("PAYPAL_SECRET").unwrap();
//!
@ -180,7 +180,7 @@ mod tests {
use std::str::FromStr;
pub async fn create_client() -> Client {
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let clientid = env::var("PAYPAL_CLIENTID").unwrap();
let secret = env::var("PAYPAL_SECRET").unwrap();

View File

@ -8,13 +8,17 @@ use wiremock::{
};
fn create_client(url: &str) -> Client {
Client::new("clientid".to_string(), "secret".to_string(), PaypalEnv::Mock(url.to_string()))
Client::new(
"clientid".to_string(),
"secret".to_string(),
PaypalEnv::Mock(url.to_string()),
)
}
#[tokio::test]
async fn test_auth() -> color_eyre::Result<()> {
color_eyre::install()?;
let mock_server = MockServer::start().await;
let access_token: serde_json::Value = serde_json::from_str(include_str!("resources/oauth_token.json")).unwrap();