This commit is contained in:
Edgar 2022-05-12 09:58:44 +02:00
parent a4c4838aaf
commit 7714124270
No known key found for this signature in database
GPG key ID: 8731E6C0166EAA85
5 changed files with 15 additions and 9 deletions

View file

@ -103,7 +103,9 @@ pub struct GetInvoice {
impl GetInvoice { impl GetInvoice {
/// New constructor. /// New constructor.
pub fn new(invoice_id: impl ToString) -> Self { pub fn new(invoice_id: impl ToString) -> Self {
Self { invoice_id: invoice_id.to_string() } Self {
invoice_id: invoice_id.to_string(),
}
} }
} }
@ -172,7 +174,9 @@ pub struct DeleteInvoice {
impl DeleteInvoice { impl DeleteInvoice {
/// New constructor. /// New constructor.
pub fn new(invoice_id: impl ToString) -> Self { pub fn new(invoice_id: impl ToString) -> Self {
Self { invoice_id: invoice_id.to_string() } Self {
invoice_id: invoice_id.to_string(),
}
} }
} }
@ -255,7 +259,10 @@ pub struct CancelInvoice {
impl CancelInvoice { impl CancelInvoice {
/// New constructor. /// New constructor.
pub fn new(invoice_id: impl ToString, reason: CancelReason) -> Self { pub fn new(invoice_id: impl ToString, reason: CancelReason) -> Self {
Self { invoice_id: invoice_id.to_string(), reason } Self {
invoice_id: invoice_id.to_string(),
reason,
}
} }
} }

View file

@ -2,4 +2,4 @@
pub mod invoice; pub mod invoice;
pub mod orders; pub mod orders;
pub mod payments; pub mod payments;

View file

@ -268,4 +268,4 @@ pub struct SellerProtection {
pub status: SellerProtectionStatus, pub status: SellerProtectionStatus,
/// An array of conditions that are covered for the transaction. /// An array of conditions that are covered for the transaction.
pub dispute_categories: Vec<DisputeCategory>, pub dispute_categories: Vec<DisputeCategory>,
} }

View file

@ -2,8 +2,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use super::common::{AuthorizationStatusDetails, Money, SellerProtection, LinkDescription}; use super::common::{AuthorizationStatusDetails, LinkDescription, Money, SellerProtection};
/// Payment Status /// Payment Status
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone, Copy)] #[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone, Copy)]
@ -52,4 +51,4 @@ pub struct AuthorizedPaymentDetails {
pub create_time: chrono::DateTime<chrono::Utc>, pub create_time: chrono::DateTime<chrono::Utc>,
/// The date and time when the transaction was last updated /// The date and time when the transaction was last updated
pub update_time: chrono::DateTime<chrono::Utc>, pub update_time: chrono::DateTime<chrono::Utc>,
} }

View file

@ -6,7 +6,7 @@
//! [![Docs](https://docs.rs/paypal-rs/badge.svg)](https://docs.rs/paypal-rs) //! [![Docs](https://docs.rs/paypal-rs/badge.svg)](https://docs.rs/paypal-rs)
//! //!
//! A rust library that wraps the [paypal api](https://developer.paypal.com/docs/api) asynchronously in a strongly typed manner. //! A rust library that wraps the [paypal api](https://developer.paypal.com/docs/api) asynchronously in a strongly typed manner.
//! //!
//! If there is a missing endpoint that you need, you may try to implement the [Endpoint](endpoint::Endpoint) and pass it to [Client::execute](client::Client::execute) //! If there is a missing endpoint that you need, you may try to implement the [Endpoint](endpoint::Endpoint) and pass it to [Client::execute](client::Client::execute)
//! //!
//! Currently in early development. //! Currently in early development.